Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Dashboard screen #570

Open
wants to merge 129 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
1de3db3
feat: Initial work towards Material 3
barbeau Nov 19, 2021
19c8988
feat: Initial work towards Dashboard screen
barbeau Nov 22, 2021
f41124c
feat: Add CFs
barbeau Nov 22, 2021
923020c
feat: Initial mockup of GNSS cards
barbeau Nov 23, 2021
a940edd
feat: Wire up GNSS APIs to Dashboard, add images and strings
barbeau Nov 24, 2021
4bc8f6f
chore: Remove extra variable
barbeau Nov 24, 2021
46e75ee
feat: Add progress indicator while loading
barbeau Nov 24, 2021
438ff14
feat: Use progress indicator within Card
barbeau Nov 24, 2021
5b3303d
feat: Add scan for CFs coroutine, with progress indicators
barbeau Nov 24, 2021
cf64ccf
docs: Move comment
barbeau Nov 24, 2021
b335cbc
feat: Add determinate progress indicator based on remaining scan time
barbeau Nov 29, 2021
5b87fb0
feat: Add SBAS, add more progress context to UI
barbeau Dec 1, 2021
774a9ee
fix: Progress when tracking off, colors of headings
barbeau Dec 1, 2021
a1aef0c
feat: Add feature support list, dual-frequency item
barbeau Dec 1, 2021
016aa5e
feat: Add raw measurements
barbeau Dec 1, 2021
5dcb87a
feat: Add carrier phase, animated dual-frequency icon
barbeau Dec 3, 2021
77512a7
feat: Switch dual-frequency image to solid background, transparency f…
barbeau Dec 4, 2021
03d7231
chore: Revise feature support icon with solid background
barbeau Dec 6, 2021
42d2cdb
feat: Improve carrier phase icon
barbeau Dec 6, 2021
2e4498a
feat: Add navigation messages
barbeau Dec 6, 2021
f550e0e
feat: Add GNSS antenna info
barbeau Dec 6, 2021
21ebc29
feat: Initial implementation of inject PSDS/time
barbeau Dec 6, 2021
ce0c918
fix: Manual refresh of injecting time/PSDS
barbeau Dec 8, 2021
8726972
chore: Replace nav messages icon (language->atom)
barbeau Dec 8, 2021
a4c2ed3
fix: Detailed message pushing check off screen
barbeau Dec 8, 2021
8260715
fix: Immediately showing results
barbeau Dec 9, 2021
c4588ff
chore: Remove done TODOs
barbeau Dec 10, 2021
6aa12ee
refactor: Group scan info into model class
barbeau Dec 10, 2021
7d13204
feat: Add delete assist data
barbeau Dec 10, 2021
43a9d4d
chore: Add dialog for clearing assist data
barbeau Dec 14, 2021
e7aab41
feat: Show GNSS antenna CFs if available
barbeau Dec 14, 2021
d77ad25
chore: Add divider
barbeau Dec 14, 2021
6272459
feat: Add NMEA and auto gain control
barbeau Dec 14, 2021
8a789d2
chore: Auto-format
barbeau Dec 14, 2021
afe933c
feat: Add vertical accuracy
barbeau Dec 14, 2021
b035cea
chore: Split features list
barbeau Dec 16, 2021
d057d47
refactor: Size of text and icons
barbeau Jan 6, 2022
98fba56
feat: Add error check for valid CFs
barbeau Jan 11, 2022
cab6fcc
chore: Fix formatting
barbeau Jan 11, 2022
4636fb1
refactor: Improve bad frequency text and code
barbeau Jan 12, 2022
776febb
feat: Add GPS week rollover
barbeau Jan 14, 2022
eafb829
feat: Add duplicate CF check
barbeau Jan 14, 2022
ad20097
feat: Add azimuth/elevation mismatch check
barbeau Jan 18, 2022
99b351b
feat: Add azimuth and elevation to error message
barbeau Jan 18, 2022
8a108ce
chore: String tweaks
barbeau Jan 19, 2022
92a70b9
feat: Mismatch almanac and ephemeris
barbeau Jan 19, 2022
c49be01
feat: Missing almanac and ephemeris
barbeau Jan 19, 2022
6b50806
refactor: String names
barbeau Jan 19, 2022
21f6f7d
fix: Fix logic for missing almanac/ephemeris
barbeau Jan 19, 2022
5e8090e
chore: Remove unnecessary qualifiers
barbeau Jan 19, 2022
ed88ba8
refactor: Checks for "no signals"
barbeau Jan 20, 2022
10f5ca6
feat: Geoid offset integrity
barbeau Jan 21, 2022
4421526
chore: Tweak text
barbeau Jan 21, 2022
53d636e
feat: Handle approx equal for geoid integrity
barbeau Jan 21, 2022
e02788f
feat: Add Datum check
barbeau Jan 21, 2022
5349df6
chore: Apply formatting
barbeau Jan 21, 2022
fe02f37
feat: More tests, bug fix
barbeau Jan 24, 2022
e5dbaef
feat: Bad GNSS antenna info check
barbeau Jan 24, 2022
96d33a4
feat: Signals without data check
barbeau Jan 25, 2022
5dcd014
chore: Improve missing signal display
barbeau Jan 25, 2022
91e2f4c
chore: Improve missing signal, datum error checks
barbeau Jan 27, 2022
74c4536
chore: Add parens for clarity
barbeau Jan 27, 2022
731aaf5
chore: Remove description from many errors to shrink output
barbeau Jan 31, 2022
765eef2
chore: Refactor frequency image to re-use same code
barbeau Jan 31, 2022
ec55409
feat: Add strikethrough to bad CF image
barbeau Jan 31, 2022
6e5c9f6
chore: Import enums
barbeau Jan 31, 2022
4fcf092
feat: Initial working Orbit animation
barbeau Feb 1, 2022
4ed02ae
chore: Improve orbit animations
barbeau Feb 3, 2022
9a2bf20
chore: Increase oval height
barbeau Feb 4, 2022
9c04a80
feat: Add animated globe image
barbeau Feb 4, 2022
b9ab9f9
chore: Reduce globe stroke
barbeau Feb 4, 2022
0cb1ca8
feat: Add help text dialog for Error Checks
barbeau Feb 4, 2022
426d84e
chore: Tweak globe rotation
barbeau Feb 8, 2022
a065a08
chore: Make alerts scrollable
barbeau Feb 9, 2022
f1310c7
chore: Update static icons for dynamic versions
barbeau Feb 9, 2022
76c17b2
refactor: Icons into Composable passed for feature checks
barbeau Feb 9, 2022
c71f818
chore: Use old dual-frequency image for missing signal info
barbeau Feb 9, 2022
cfcf885
refactor: Common dialog code into OkDialog composable
barbeau Feb 11, 2022
7a90199
feat: Add ADR state to dialog
barbeau Feb 15, 2022
c648537
feat: Add Device Properties list
barbeau Feb 16, 2022
f2b00ae
chore: Tweak formatting of build version
barbeau Feb 16, 2022
40e8ba3
chore: Tweak text
barbeau Feb 16, 2022
9708c81
chore: Fix typos
barbeau Feb 18, 2022
a9efb53
chore: Merge missing al/eph into general missing data
barbeau Feb 18, 2022
8c810d9
feat: Change time sync to be different than week rollover
barbeau Feb 18, 2022
42a5fca
feat: Add time between updates
barbeau Feb 18, 2022
4fb579d
fix: Remove period from end of URL
barbeau Feb 22, 2022
a86e55a
feat: Add user country to Device Properties
barbeau Feb 24, 2022
0c4a999
refactor: Blank string check
barbeau Feb 24, 2022
92775e2
chore: Increasing GNSS progress card height to avoid pop in
barbeau Feb 24, 2022
db07a7f
chore: Handle turning GNSS on and off
barbeau Feb 24, 2022
f95a8b9
feat: Initial implementation of signal summary
barbeau Mar 3, 2022
5ecfff0
feat: Animate signal summary graphs
barbeau Mar 5, 2022
7019d15
chore: Factor out CircleGraph size, standardize signal image
barbeau Mar 9, 2022
17bd6d5
fix: Missing imports
barbeau Mar 11, 2022
55dff03
chore: Handle no signals waiting, refactor CircleGraph properties
barbeau Mar 11, 2022
5df9ed0
feat: Add summaries for each CF type
barbeau Mar 16, 2022
2829296
feat: Add expand icon to signal summary card
barbeau Mar 18, 2022
03efb60
refactor: CollapsibleCard into it's own component
barbeau Mar 18, 2022
deeff19
chore: Shrink signal circle graphs
barbeau Mar 18, 2022
322c26a
chore: Reduce width of CF chip in circle graphs
barbeau Mar 18, 2022
dd237f3
feat: Add "Last updated" to signal summary card
barbeau Mar 18, 2022
a325111
chore: Make four CF graphs fit on one row
barbeau Mar 22, 2022
3fb5dac
refactor: LastUpdatedText, add it to Status too
barbeau Mar 22, 2022
217a140
refactor: Title and help button into file
barbeau Mar 22, 2022
26dec9c
refactor: ExpandIcon
barbeau Mar 23, 2022
701791e
refactor: Top and bottom content
barbeau Mar 24, 2022
b454ef6
feat: Add LockIcon to DashboardScreen.kt
barbeau Mar 24, 2022
6c18206
chore: Make small graph title bold
barbeau Mar 24, 2022
c2c1d84
chore: Make SignalSummaryCard.kt background primary color
barbeau Mar 30, 2022
555bb42
chore: Right-align help icon, shrink size to match Google app
barbeau Mar 30, 2022
27e4ff2
Merge remote-tracking branch 'origin/material3' into dashboard-material3
barbeau Apr 5, 2022
293a93c
chore: Reformat GNSS/SBAS as rows within card
barbeau Apr 7, 2022
5ea697b
chore: Reformat cards and titles
barbeau Apr 7, 2022
19b9bd9
chore: Fix/reduce top/bottom padding for cards with titles
barbeau Apr 12, 2022
31520a5
chore: Make dark card container darker, light more purple/theme
barbeau Apr 12, 2022
dda9af4
chore: Cleanup - theme colors, refactor components, paddings
barbeau Apr 14, 2022
4059a62
fix: Color reference
barbeau Apr 14, 2022
a83ee45
chore: Change primary dark color for better contrast
barbeau Apr 14, 2022
a947254
refactor: Gnss and Sbas List into it's own file
barbeau Jul 18, 2022
dbad836
feat: Migrate tracking preference to Jetpack Datastore
barbeau Aug 10, 2022
057c459
fix: Fix AGC in Dashboard for Android 13 devices
barbeau Aug 11, 2022
72f60ef
chore: Tweak dark primary color for better contrast
barbeau Aug 11, 2022
a8841bd
fix: Hide filter menu item unless in Status or Sky
barbeau Aug 11, 2022
62589af
fix: Implement pref repo for FDroid flavor
barbeau Aug 11, 2022
d756d7b
fix: Add prefsRepo to instrumented tests
barbeau Aug 11, 2022
63fccab
fix: Guard against observing prefsFlow multiple times
barbeau Aug 12, 2022
2ec633e
fix: Transition all observers from locRepo.receivingLocationUpdates t…
barbeau Sep 15, 2022
f019588
fix: Formatting
barbeau Sep 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions GPSTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'

android {
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 24
Expand Down Expand Up @@ -134,8 +134,7 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
Expand Down Expand Up @@ -195,19 +194,24 @@ dependencies {

// Integration with activities
implementation 'androidx.activity:activity-compose:1.4.0'
implementation "androidx.compose.compiler:compiler:1.1.0-beta02"
implementation "androidx.compose.compiler:compiler:1.2.0-alpha06"
// Compose Material Design
implementation 'androidx.compose.material:material:1.0.5'
implementation 'androidx.compose.material3:material3:1.0.0-alpha08'
implementation 'com.google.android.material:material:1.5.0'
// Bridging XML themes to Compose
implementation "com.google.android.material:compose-theme-adapter:1.1.0"
implementation "com.google.android.material:compose-theme-adapter:1.1.6"
// Animations
implementation 'androidx.compose.animation:animation:1.1.0-beta02'
implementation 'androidx.compose.animation:animation:1.1.0-beta03'
// For FlowRow
implementation 'com.google.accompanist:accompanist-flowlayout:0.23.1'
// Tooling support (Previews, etc.)
implementation 'androidx.compose.ui:ui-tooling:1.0.5'
// Integration with ViewModels
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0'
//Integration with LiveData
implementation 'androidx.compose.runtime:runtime-livedata:1.1.0-beta02'
implementation 'androidx.compose.runtime:runtime-livedata:1.1.0-beta03'
// Preference datastore
implementation "androidx.datastore:datastore-preferences:1.0.0"
// UI Tests
androidTestImplementation 'androidx.compose.ui:ui-test-junit4:1.0.5'

Expand Down
210 changes: 210 additions & 0 deletions GPSTest/src/androidTest/java/com/android/gpstest/SatelliteUtilsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@
package com.android.gpstest

import android.location.GnssMeasurement.*
import android.location.Location
import android.os.Build
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
import com.android.gpstest.model.GeoidAltitude
import com.android.gpstest.model.GnssType
import com.android.gpstest.model.SatelliteStatus
import com.android.gpstest.model.SatelliteStatus.Companion.NO_DATA
import com.android.gpstest.model.SbasType
import com.android.gpstest.util.SatelliteUtil.altitudeComparedTo
import com.android.gpstest.util.SatelliteUtil.isMissingData
import com.android.gpstest.util.SatelliteUtil.isTimeApproxEqualTo
import com.android.gpstest.util.SatelliteUtils
import org.junit.Assert.*
import org.junit.Test
Expand Down Expand Up @@ -226,4 +232,208 @@ class SatelliteUtilsTest {
adrState = ADR_STATE_CYCLE_SLIP or ADR_STATE_HALF_CYCLE_REPORTED or ADR_STATE_RESET
assertFalse(SatelliteUtils.isAccumulatedDeltaRangeStateValid(adrState))
}

/**
* Test for comparing WGS84 altitude, height of the geoid above the WGS84 ellipsoid,
* and altitude above mean sea level.
*
* H = -N + h
*
* or
* N = h - H
*
* ..where:
* * H = geoidAltitude.altitudeMsl, or geoid altitude
* * N = geoidAltitude.heightOfGeoid above the WGS84 ellipsoid
* * h = Location.altitude], or the location WGS84 altitude (height above the WGS84 ellipsoid)
*
* See https://issuetracker.google.com/issues/191674805 for details.
*/
@Test
fun testLocationAltitudeComparedToGeoidAltitude() {
val geoidAltitude = GeoidAltitude(altitudeMsl = 18.1, heightOfGeoid = -24.0)
val location = Location("test")
location.altitude = -5.9
assertTrue(location.altitudeComparedTo(geoidAltitude).isSame)

location.altitude = -5.91111
assertTrue(location.altitudeComparedTo(geoidAltitude).isSame)

location.altitude = -5.99999
assertFalse(location.altitudeComparedTo(geoidAltitude).isSame)

// Based on data from Samsung Galaxy S21+
val `geoidAltitude16-1` = GeoidAltitude(altitudeMsl = 16.1, heightOfGeoid = -24.0)
location.altitude = -7.88262939453125
assertTrue(location.altitudeComparedTo(`geoidAltitude16-1`).isSame)

val `geoidAltitude16-0` = GeoidAltitude(altitudeMsl = 16.0, heightOfGeoid = -24.0)
location.altitude = -7.979248046875
assertTrue(location.altitudeComparedTo(`geoidAltitude16-0`).isSame)

location.altitude = -7.99603271484375
assertTrue(location.altitudeComparedTo(`geoidAltitude16-0`).isSame)

location.altitude = -7.9793701171875
assertTrue(location.altitudeComparedTo(`geoidAltitude16-0`).isSame)

val `geoidAltitude15-7` = GeoidAltitude(altitudeMsl = 15.7, heightOfGeoid = -24.0)
location.altitude = -8.302093505859375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.3095703125
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.311126708984375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.3275146484375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.252044677734375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.2552490234375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.277252197265625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.28192138671875
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.284088134765625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.286651611328125
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.30511474609375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.306427001953125
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

location.altitude = -8.346435546875
assertTrue(location.altitudeComparedTo(`geoidAltitude15-7`).isSame)

val `geoidAltitude15-8` = GeoidAltitude(altitudeMsl = 15.8, heightOfGeoid = -24.0)
location.altitude = -8.194122314453125
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.181121826171875
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.1817626953125
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.185455322265625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.18609619140625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.2017822265625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.21240234375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.2166748046875
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.237640380859375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.2392578125
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.243896484375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

location.altitude = -8.245269775390625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-8`).isSame)

val `geoidAltitude15-6` = GeoidAltitude(altitudeMsl = 15.6, heightOfGeoid = -24.0)
location.altitude = -8.353424072265625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-6`).isSame)

location.altitude = -8.37744140625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-6`).isSame)

location.altitude = -8.37994384765625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-6`).isSame)

location.altitude = -8.38427734375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-6`).isSame)

val `geoidAltitude15-5` = GeoidAltitude(altitudeMsl = 15.5, heightOfGeoid = -24.0)
location.altitude = -8.51861572265625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-5`).isSame)

location.altitude = -8.523681640625
assertTrue(location.altitudeComparedTo(`geoidAltitude15-5`).isSame)

location.altitude = -8.529998779296875
assertTrue(location.altitudeComparedTo(`geoidAltitude15-5`).isSame)

location.altitude = -8.53466796875
assertTrue(location.altitudeComparedTo(`geoidAltitude15-5`).isSame)

val `geoidAltitude15-4` = GeoidAltitude(altitudeMsl = 15.4, heightOfGeoid = -24.0)
location.altitude = -8.589202880859375
assertTrue(location.altitudeComparedTo(`geoidAltitude15-4`).isSame)
}

/**
* Tests if a location time is approximately equal to geoidAltitude time
*/
@Test
fun testLocationIsTimeApproxEqualTo() {
val geoidAltitude = GeoidAltitude(1000, altitudeMsl = 18.1, heightOfGeoid = -24.0)
val location = Location("test")
location.time = 1000
assertTrue(location.isTimeApproxEqualTo(geoidAltitude))

location.time = 1899
assertTrue(location.isTimeApproxEqualTo(geoidAltitude))

location.time = 101
assertTrue(location.isTimeApproxEqualTo(geoidAltitude))

location.time = 1900
assertFalse(location.isTimeApproxEqualTo(geoidAltitude))

location.time = 100
assertFalse(location.isTimeApproxEqualTo(geoidAltitude))
}

@Test
fun testStatusMissingData() {
// GPS with missing data
val statusMissingDataNotUsed = SatelliteStatus(1,
GnssType.NAVSTAR,
30f,
false,
false,
false,
NO_DATA,
NO_DATA);
assertTrue(statusMissingDataNotUsed.isMissingData())

// FIXME - this is way too noisy for missing ephemeris data, so skip this check
// until we figure out how to handle this (separate check?)
// val statusMissingDataUsed = SatelliteStatus(1,
// GnssType.NAVSTAR,
// 30f,
// false,
// true,
// true,
// NO_DATA,
// NO_DATA);
// assertTrue(statusMissingDataUsed.isMissingData())

// Good signal
assertFalse(gpsL1(1, true).isMissingData())
}
}
Loading