├── studio ├── base │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── nl │ │ │ │ │ └── sogeti │ │ │ │ │ └── android │ │ │ │ │ └── gpstracker │ │ │ │ │ └── ng │ │ │ │ │ └── base │ │ │ │ │ ├── location │ │ │ │ │ ├── LatLng.kt │ │ │ │ │ └── LocationFactory.kt │ │ │ │ │ ├── BaseConfiguration.kt │ │ │ │ │ ├── dagger │ │ │ │ │ ├── ExecutorQualifiers.kt │ │ │ │ │ ├── SystemModule.kt │ │ │ │ │ └── AppModule.kt │ │ │ │ │ └── common │ │ │ │ │ └── controllers │ │ │ │ │ ├── gpsstatus │ │ │ │ │ ├── GpsStatusController.kt │ │ │ │ │ ├── BaseGpsStatusControllerImpl.kt │ │ │ │ │ ├── GpsStatusControllerFactory.kt │ │ │ │ │ ├── GnnsStatusControllerImpl.kt │ │ │ │ │ └── GpsStatusControllerImpl.kt │ │ │ │ │ └── content │ │ │ │ │ └── ContentController.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── activated_selector.xml │ │ │ │ └── values │ │ │ │ ├── palette.xml │ │ │ │ └── styles.xml │ │ ├── test │ │ │ └── java │ │ │ │ └── nl │ │ │ │ └── sogeti │ │ │ │ └── android │ │ │ │ └── gpstracker │ │ │ │ └── ng │ │ │ │ └── base │ │ │ │ └── common │ │ │ │ └── controllers │ │ │ │ └── gpsstatus │ │ │ │ └── GpsStatusControllerFactoryTest.kt │ │ └── mock │ │ │ └── java │ │ │ └── nl │ │ │ └── sogeti │ │ │ └── android │ │ │ └── gpstracker │ │ │ └── ng │ │ │ ├── dagger │ │ │ └── MockAppComponent.kt │ │ │ └── mock │ │ │ └── MockLocationFactory.kt │ ├── proguard-rules.pro │ └── build.gradle ├── wear │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ ├── wear.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ ├── styles.xml │ │ │ │ │ ├── dimens.xml │ │ │ │ │ ├── palette.xml │ │ │ │ │ └── strings.xml │ │ │ │ └── drawable │ │ │ │ │ ├── progress_background.xml │ │ │ │ │ ├── ic_stop_black_24dp.xml │ │ │ │ │ ├── ic_pause_black_24dp.xml │ │ │ │ │ ├── ic_navigation_black_24dp.xml │ │ │ │ │ ├── ic_sync_black_24dp.xml │ │ │ │ │ ├── ic_cross.xml │ │ │ │ │ └── ic_sync_disabled_black_24dp.xml │ │ │ └── java │ │ │ │ └── nl │ │ │ │ └── sogeti │ │ │ │ └── android │ │ │ │ └── gpstracker │ │ │ │ └── v2 │ │ │ │ └── wear │ │ │ │ ├── databinding │ │ │ │ └── WearBindingComponent.kt │ │ │ │ ├── common │ │ │ │ └── WearApplication.kt │ │ │ │ ├── communication │ │ │ │ └── WearMessageListenerService.kt │ │ │ │ └── HolderFragment.kt │ │ └── mock │ │ │ └── res │ │ │ └── values │ │ │ └── strings.xml │ └── proguard-rules.pro ├── features │ ├── .gitignore │ ├── src │ │ ├── test │ │ │ ├── resources │ │ │ │ └── mockito-extensions │ │ │ │ │ └── org.mockito.plugins.MockMaker │ │ │ └── java │ │ │ │ └── nl │ │ │ │ └── sogeti │ │ │ │ └── android │ │ │ │ └── gpstracker │ │ │ │ └── ng │ │ │ │ └── features │ │ │ │ ├── trackedit │ │ │ │ └── TrackTypeDescriptionsTest.kt │ │ │ │ ├── graphs │ │ │ │ └── GraphDataHelpersTest.kt │ │ │ │ ├── databinding │ │ │ │ ├── CommonBindingAdaptersTest.kt │ │ │ │ └── FeaturesBindingComponentTest.kt │ │ │ │ └── summary │ │ │ │ └── SummaryCalculatorTest.kt │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── layout.xml │ │ │ │ ├── linegraph_attrs.xml │ │ │ │ └── dimens.xml │ │ │ ├── values-sw600dp │ │ │ │ └── layout.xml │ │ │ ├── drawable │ │ │ │ ├── pressed_rounded_accent.xml │ │ │ │ ├── transparent_button_background.xml │ │ │ │ ├── ic_stop_black_24dp.xml │ │ │ │ ├── ic_track_type_default.xml │ │ │ │ ├── ic_file_download_black_24dp.xml │ │ │ │ ├── ic_pause_black_24dp.xml │ │ │ │ ├── ic_navigation_black_24dp.xml │ │ │ │ ├── ic_delete_black_24dp.xml │ │ │ │ ├── ic_playlist_add_black_24dp.xml │ │ │ │ ├── ic_mode_edit_black_24dp.xml │ │ │ │ ├── ic_pin_start_24dp.xml │ │ │ │ ├── ic_format_list_numbered_black_24dp.xml │ │ │ │ ├── ic_map_black_24dp.xml │ │ │ │ ├── ic_pin_end_24dp.xml │ │ │ │ ├── ic_search_black_24dp.xml │ │ │ │ ├── ic_track_type_walk.xml │ │ │ │ ├── ic_track_type_run.xml │ │ │ │ ├── ic_directions_run_black_24dp.xml │ │ │ │ ├── ic_lock_outline_black_24dp.xml │ │ │ │ ├── ic_my_location_black_24dp.xml │ │ │ │ ├── ic_track_type_train.xml │ │ │ │ ├── ic_track_type_car.xml │ │ │ │ ├── ic_share_black_24dp.xml │ │ │ │ ├── ic_track_type_boat.xml │ │ │ │ ├── ic_track_type_bike.xml │ │ │ │ ├── ic_graphs.xml │ │ │ │ ├── ic_satellite_none.xml │ │ │ │ ├── ic_overflow.xml │ │ │ │ ├── ic_satellite_low.xml │ │ │ │ └── ic_satellite_medium.xml │ │ │ ├── color │ │ │ │ ├── gps_status.xml │ │ │ │ ├── card_text.xml │ │ │ │ └── card_background.xml │ │ │ ├── anim │ │ │ │ ├── enter_from_left.xml │ │ │ │ └── exit_to_left.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── menu │ │ │ │ ├── search.xml │ │ │ │ ├── import_export.xml │ │ │ │ ├── map.xml │ │ │ │ └── track.xml │ │ │ ├── layout │ │ │ │ ├── activity_graph.xml │ │ │ │ ├── row_track_type.xml │ │ │ │ ├── activity_tracklist.xml │ │ │ │ ├── fragment_about.xml │ │ │ │ ├── fragment_graphs.xml │ │ │ │ ├── include_graphs.xml │ │ │ │ ├── fragment_map.xml │ │ │ │ └── fragment_tracklist.xml │ │ │ └── layout-sw600dp │ │ │ │ ├── fragment_tracklist.xml │ │ │ │ └── fragment_graphs.xml │ │ │ └── java │ │ │ └── nl │ │ │ └── sogeti │ │ │ └── android │ │ │ └── gpstracker │ │ │ └── ng │ │ │ └── features │ │ │ ├── graphs │ │ │ ├── widgets │ │ │ │ ├── GraphValueDescriptor.kt │ │ │ │ ├── LineGraphBindings.kt │ │ │ │ └── GraphPoint.kt │ │ │ ├── GraphSpeedConverter.kt │ │ │ ├── GraphsActivity.kt │ │ │ └── dataproviders │ │ │ │ ├── GraphDataProvider.kt │ │ │ │ └── SpeedRangePicker.kt │ │ │ ├── dagger │ │ │ ├── FeatureScope.kt │ │ │ └── VersionInfoModule.kt │ │ │ ├── util │ │ │ ├── ImmediateExecutor.kt │ │ │ ├── StringResources.kt │ │ │ ├── AbstractTrackPresenter.kt │ │ │ ├── AbstractSelectedTrackPresenter.kt │ │ │ └── LoggingStateBroadcastReceiver.kt │ │ │ ├── model │ │ │ ├── TrackSearch.kt │ │ │ └── TrackSelection.kt │ │ │ ├── tracklist │ │ │ ├── TrackListAdapterListener.kt │ │ │ └── TrackListViewModel.kt │ │ │ ├── FeatureConfiguration.kt │ │ │ ├── activityrecognition │ │ │ └── ActivityRecognizerLoggingBroadcastReceiver.kt │ │ │ ├── trackedit │ │ │ ├── TrackTypesBindingAdapters.kt │ │ │ └── TrackTypeSpinnerAdapter.kt │ │ │ ├── trackdelete │ │ │ └── TrackDeleteModel.kt │ │ │ ├── map │ │ │ ├── rendering │ │ │ │ ├── TrackTileProviderFactory.kt │ │ │ │ └── Point.java │ │ │ └── TrackReaderFactory.kt │ │ │ ├── control │ │ │ └── ControlViewModel.kt │ │ │ ├── gpximport │ │ │ └── ImportTrackTypeModel.kt │ │ │ └── track │ │ │ └── TrackViewModel.kt │ └── proguard-rules.pro ├── service │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── drawable │ │ │ │ │ ├── ic_maps_indicator_current_position.png │ │ │ │ │ ├── ic_play_arrow_24dp.xml │ │ │ │ │ └── ic_pause_24dp.xml │ │ │ │ └── values │ │ │ │ │ └── strings_integration.xml │ │ │ ├── java │ │ │ │ └── nl │ │ │ │ │ └── sogeti │ │ │ │ │ └── android │ │ │ │ │ └── gpstracker │ │ │ │ │ └── service │ │ │ │ │ ├── dagger │ │ │ │ │ ├── ServiceConfiguration.kt │ │ │ │ │ ├── ServiceComponent.kt │ │ │ │ │ └── ServiceModule.kt │ │ │ │ │ ├── integration │ │ │ │ │ ├── ServiceCommanderInterface.kt │ │ │ │ │ └── ServiceManagerInterface.java │ │ │ │ │ └── logger │ │ │ │ │ ├── LoggingConstants.java │ │ │ │ │ └── PowerManager.java │ │ │ └── aidl │ │ │ │ └── nl │ │ │ │ └── sogeti │ │ │ │ └── android │ │ │ │ └── gpstracker │ │ │ │ └── integration │ │ │ │ └── IGPSLoggerServiceRemote.aidl │ │ ├── mock │ │ │ ├── java │ │ │ │ └── nl │ │ │ │ │ └── sogeti │ │ │ │ │ └── android │ │ │ │ │ └── gpstracker │ │ │ │ │ └── service │ │ │ │ │ └── dagger │ │ │ │ │ ├── MockServiceComponent.kt │ │ │ │ │ └── MockServiceModule.kt │ │ │ ├── res │ │ │ │ └── xml │ │ │ │ │ └── searchable.xml │ │ │ └── AndroidManifest.xml │ │ ├── store │ │ │ └── res │ │ │ │ └── xml │ │ │ │ └── searchable.xml │ │ └── develop │ │ │ └── res │ │ │ └── xml │ │ │ └── searchable.xml │ └── proguard-rules.pro ├── utils │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── nl │ │ │ └── sogeti │ │ │ └── android │ │ │ └── gpstracker │ │ │ └── utils │ │ │ ├── VersionHelper.kt │ │ │ ├── concurrent │ │ │ ├── ExecutorFactory.kt │ │ │ └── BackgroundThreadFactory.kt │ │ │ ├── ActivityResultLambda.kt │ │ │ ├── PermissionChecker.kt │ │ │ ├── test │ │ │ └── WithResources.kt │ │ │ ├── ActivityResultLambdaFragment.kt │ │ │ └── FragmentResultLambda.kt │ ├── proguard-rules.pro │ └── build.gradle ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── xml │ │ │ │ │ └── backup_scheme.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── values │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ ├── wear.xml │ │ │ │ │ └── strings.xml │ │ │ │ └── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── ic_launcher-web.png │ │ │ └── AndroidManifest.xml │ │ ├── androidTestMock │ │ │ └── java │ │ │ │ └── nl │ │ │ │ └── sogeti │ │ │ │ └── android │ │ │ │ └── gpstracker │ │ │ │ └── ng │ │ │ │ ├── robots │ │ │ │ └── GraphRobot.kt │ │ │ │ ├── ui │ │ │ │ └── fragments │ │ │ │ │ └── TrackListFragmentEspressoTest.java │ │ │ │ └── util │ │ │ │ ├── WebViewIdlingResource.kt │ │ │ │ ├── EspressoTestMatchers.java │ │ │ │ └── IdlingMapResource.kt │ │ ├── develop │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── store │ │ │ └── AndroidManifest.xml │ │ └── mock │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ └── values │ │ │ └── strings.xml │ └── proguard-rules.pro ├── test-utils │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── nl │ │ │ └── renedegroot │ │ │ └── android │ │ │ └── test │ │ │ └── utils │ │ │ └── MockitoHelper.kt │ ├── proguard-rules.pro │ └── build.gradle ├── wear-shared │ ├── .gitignore │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── mockito-extensions │ │ │ │ └── org.mockito.plugins.MockMaker │ │ └── main │ │ │ ├── java │ │ │ └── nl │ │ │ │ └── sogeti │ │ │ │ └── android │ │ │ │ └── gpstracker │ │ │ │ └── v2 │ │ │ │ └── sharedwear │ │ │ │ ├── util │ │ │ │ ├── Resources.kt │ │ │ │ ├── LocaleProvider.kt │ │ │ │ ├── getFloat.kt │ │ │ │ ├── BaseObservable.kt │ │ │ │ ├── Attempting.kt │ │ │ │ └── TimeSpanCalculator.kt │ │ │ │ ├── messaging │ │ │ │ └── MessageSenderFactory.kt │ │ │ │ └── model │ │ │ │ ├── StatisticsMessage.kt │ │ │ │ ├── StatusMessage.kt │ │ │ │ └── WearMessage.kt │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ ├── values-en │ │ │ └── constants.xml │ │ │ ├── values-en-rUS │ │ │ └── constants.xml │ │ │ └── values │ │ │ ├── constants.xml │ │ │ └── strings.xml │ ├── proguard-rules.pro │ └── build.gradle ├── debug.keystore ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── signing.gradle ├── gradle.properties ├── build.gradle └── flavors.gradle ├── resources ├── artwork │ ├── app-icon.png │ ├── app-icon.xcf │ ├── functie-image.png │ ├── functie-image.xcf │ ├── ogt-ng-pictogram.png │ └── ogt-ng-pictogram.xcf └── screenshots │ ├── g-nex-map-estland.png │ └── g-nex-list-estland.png ├── README.md └── .gitignore /studio/base/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /studio/wear/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /studio/features/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /studio/service/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /studio/utils/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /studio/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /store 3 | -------------------------------------------------------------------------------- /studio/test-utils/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /studio/wear-shared/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /studio/test-utils/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /studio/features/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline -------------------------------------------------------------------------------- /studio/utils/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /studio/wear-shared/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline -------------------------------------------------------------------------------- /studio/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/debug.keystore -------------------------------------------------------------------------------- /studio/app/src/main/res/xml/backup_scheme.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/artwork/app-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/resources/artwork/app-icon.png -------------------------------------------------------------------------------- /resources/artwork/app-icon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/resources/artwork/app-icon.xcf -------------------------------------------------------------------------------- /studio/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':utils', ':wear', ':wear-shared', ':service', ':base', ':features', ':test-utils' 2 | -------------------------------------------------------------------------------- /resources/artwork/functie-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/resources/artwork/functie-image.png -------------------------------------------------------------------------------- /resources/artwork/functie-image.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/resources/artwork/functie-image.xcf -------------------------------------------------------------------------------- /resources/artwork/ogt-ng-pictogram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/resources/artwork/ogt-ng-pictogram.png -------------------------------------------------------------------------------- /resources/artwork/ogt-ng-pictogram.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/resources/artwork/ogt-ng-pictogram.xcf -------------------------------------------------------------------------------- /studio/app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /studio/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /resources/screenshots/g-nex-map-estland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/resources/screenshots/g-nex-map-estland.png -------------------------------------------------------------------------------- /resources/screenshots/g-nex-list-estland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/resources/screenshots/g-nex-list-estland.png -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/util/Resources.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.sharedwear.util 2 | 3 | -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /studio/wear/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/wear/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /studio/wear/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/wear/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /studio/wear/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/wear/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # open-gpstracker-ng 2 | A modern replacement of Open GPS Tracker Android app 3 | 4 | Project moved to Gitlab: 5 | https://gitlab.com/rcgroot/open-gps-tracker 6 | -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /studio/base/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/wear/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /studio/features/src/main/res/values/layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | 5 | -------------------------------------------------------------------------------- /studio/test-utils/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /studio/wear/src/mock/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | OGT Mock - Control 4 | 5 | -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /studio/features/src/main/res/values-sw600dp/layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /studio/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #DBDBDB 4 | -------------------------------------------------------------------------------- /studio/app/src/androidTestMock/java/nl/sogeti/android/gpstracker/ng/robots/GraphRobot.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.robots 2 | 3 | class GraphRobot : Robot("graph") { 4 | } -------------------------------------------------------------------------------- /studio/app/src/main/res/values/wear.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | gps_track_record 4 | 5 | 6 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/values/wear.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | gps_track_control 4 | 5 | 6 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/location/LatLng.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.location 2 | 3 | data class LatLng(val latitude: Double, val longitude: Double) 4 | -------------------------------------------------------------------------------- /studio/service/src/main/res/drawable/ic_maps_indicator_current_position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker-ng/HEAD/studio/service/src/main/res/drawable/ic_maps_indicator_current_position.png -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/graphs/widgets/GraphValueDescriptor.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.graphs.widgets 2 | 3 | import android.content.Context 4 | -------------------------------------------------------------------------------- /studio/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | *.iml 9 | 10 | keystore.properties 11 | *.iml 12 | .idea 13 | 14 | spoon-output/ 15 | -------------------------------------------------------------------------------- /studio/service/src/main/java/nl/sogeti/android/gpstracker/service/dagger/ServiceConfiguration.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.dagger 2 | 3 | object ServiceConfiguration { 4 | 5 | lateinit var serviceComponent: ServiceComponent 6 | } 7 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/pressed_rounded_accent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /studio/features/src/main/res/color/gps_status.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #339922 4 | #881133 5 | 6 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/dagger/FeatureScope.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.dagger 2 | 3 | import javax.inject.Scope 4 | 5 | @Scope 6 | @Retention(AnnotationRetention.RUNTIME) 7 | annotation class FeatureScope 8 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/util/LocaleProvider.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.sharedwear.util 2 | 3 | import java.util.* 4 | 5 | class LocaleProvider { 6 | 7 | fun getLocale(): Locale = Locale.getDefault() 8 | } 9 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/location/LocationFactory.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.location 2 | 3 | interface LocationFactory { 4 | 5 | fun getLocationCoordinates(): LatLng? 6 | 7 | fun getLocationName(): String? 8 | 9 | } -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/transparent_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /studio/utils/src/main/java/nl/sogeti/android/gpstracker/utils/VersionHelper.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.utils 2 | 3 | import android.os.Build 4 | 5 | class VersionHelper { 6 | 7 | fun isAtLeast(minimalVersion: Int): Boolean = Build.VERSION.SDK_INT >= minimalVersion 8 | } 9 | -------------------------------------------------------------------------------- /studio/service/src/mock/java/nl/sogeti/android/gpstracker/service/dagger/MockServiceComponent.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.dagger 2 | 3 | import dagger.Component 4 | 5 | @Component(modules = [(MockServiceModule::class)]) 6 | interface MockServiceComponent : ServiceComponent 7 | -------------------------------------------------------------------------------- /studio/features/src/main/res/color/card_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /studio/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Feb 09 20:17:11 CET 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /studio/features/src/main/res/color/card_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/BaseConfiguration.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base 2 | 3 | import nl.sogeti.android.gpstracker.ng.base.dagger.AppComponent 4 | 5 | object BaseConfiguration { 6 | 7 | lateinit var appComponent: AppComponent 8 | 9 | } 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /studio/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/util/ImmediateExecutor.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.util 2 | 3 | import java.util.concurrent.Executor 4 | 5 | class ImmediateExecutor : Executor { 6 | 7 | override fun execute(command: Runnable?) { 8 | command?.run() 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /studio/features/src/main/res/anim/enter_from_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | -------------------------------------------------------------------------------- /studio/features/src/main/res/anim/exit_to_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | -------------------------------------------------------------------------------- /studio/base/src/main/res/drawable/activated_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/drawable/progress_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /studio/wear/src/main/java/nl/sogeti/android/gpstracker/v2/wear/databinding/WearBindingComponent.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.wear.databinding 2 | 3 | import androidx.databinding.DataBindingComponent 4 | 5 | open class WearBindingComponent : DataBindingComponent { 6 | 7 | override fun getWearBindingAdapters(): WearBindingAdapters = WearBindingAdapters() 8 | } 9 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/drawable/ic_stop_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_stop_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/service/src/main/res/drawable/ic_play_arrow_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/service/src/main/res/drawable/ic_pause_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/util/StringResources.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.util 2 | 3 | import androidx.annotation.StringRes 4 | 5 | 6 | sealed class Text { 7 | data class String(@StringRes val id: Int) 8 | data class Plural(@StringRes val id: Int) 9 | class StringFormat(@StringRes val id: Int, vararg formatArgs: Any ) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_track_type_default.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | @color/accent 4 | @color/primary_dark 5 | @color/primary_dark 6 | @color/primary_light 7 | @color/primary 8 | 9 | -------------------------------------------------------------------------------- /studio/features/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /studio/service/src/main/java/nl/sogeti/android/gpstracker/service/integration/ServiceCommanderInterface.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.integration 2 | 3 | import android.net.Uri 4 | 5 | interface ServiceCommanderInterface { 6 | fun hasForInitialName(trackUri: Uri): Boolean 7 | fun startGPSLogging() 8 | fun stopGPSLogging() 9 | fun pauseGPSLogging() 10 | fun resumeGPSLogging() 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | /*/build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_file_download_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/utils/src/main/java/nl/sogeti/android/gpstracker/utils/concurrent/ExecutorFactory.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.utils.concurrent 2 | 3 | import java.util.concurrent.ExecutorService 4 | import java.util.concurrent.Executors 5 | 6 | class ExecutorFactory { 7 | fun createExecutor(threads: Int, name: String): ExecutorService = 8 | Executors.newFixedThreadPool(threads, BackgroundThreadFactory(name)) 9 | } 10 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/drawable/ic_pause_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_pause_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/model/TrackSearch.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.model 2 | 3 | import androidx.lifecycle.MutableLiveData 4 | import nl.sogeti.android.gpstracker.ng.features.dagger.FeatureScope 5 | import javax.inject.Inject 6 | 7 | @FeatureScope 8 | class TrackSearch @Inject constructor() { 9 | 10 | val query: MutableLiveData = MutableLiveData() 11 | } 12 | -------------------------------------------------------------------------------- /studio/test-utils/src/main/java/nl/renedegroot/android/test/utils/MockitoHelper.kt: -------------------------------------------------------------------------------- 1 | package nl.renedegroot.android.test.utils 2 | 3 | import org.mockito.Mockito 4 | 5 | //region any() as seen on https://medium.com/@elye.project/befriending-kotlin-and-mockito-1c2e7b0ef791#.o6fwp9tpe 6 | public fun any(): T { 7 | Mockito.any() 8 | return uninitialized() 9 | } 10 | 11 | private fun uninitialized(): T = null as T 12 | //endregion 13 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/util/getFloat.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.sharedwear.util 2 | 3 | import android.content.res.Resources 4 | import androidx.annotation.StringRes 5 | 6 | fun Resources.getFloat(@StringRes resourceId: Int): Float { 7 | val stringValue: String? = this.getString(resourceId) 8 | checkNotNull(stringValue) 9 | 10 | return stringValue.toFloat() 11 | } 12 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/drawable/ic_navigation_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_navigation_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/messaging/MessageSenderFactory.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.sharedwear.messaging 2 | 3 | import android.content.Context 4 | import java.util.concurrent.Executor 5 | 6 | class MessageSenderFactory { 7 | 8 | fun createMessageSender(context: Context, capability: MessageSender.Capability, executor: Executor) = MessageSender(context, capability, executor) 9 | } 10 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/dagger/ExecutorQualifiers.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.dagger 2 | 3 | import javax.inject.Qualifier 4 | 5 | @Qualifier 6 | @Retention(AnnotationRetention.RUNTIME) 7 | annotation class DiskIO 8 | 9 | @Qualifier 10 | @Retention(AnnotationRetention.RUNTIME) 11 | annotation class NetworkIO 12 | 13 | @Qualifier 14 | @Retention(AnnotationRetention.RUNTIME) 15 | annotation class Computation -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_delete_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/values/linegraph_attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /studio/utils/src/main/java/nl/sogeti/android/gpstracker/utils/ActivityResultLambda.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.utils 2 | 3 | import android.content.Intent 4 | 5 | interface ActivityResultLambda { 6 | 7 | /** 8 | * Implementing Activity or Fragment should call the resultHandler when the called 9 | * Activity returns an RESULT_OK with its Intent value 10 | */ 11 | fun startActivityForResult(intent: Intent, resultHandler: (Intent?) -> Unit) 12 | } -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_playlist_add_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/common/controllers/gpsstatus/GpsStatusController.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.common.controllers.gpsstatus 2 | 3 | interface GpsStatusController { 4 | 5 | fun startUpdates() 6 | fun stopUpdates() 7 | 8 | interface Listener { 9 | fun onStartListening() 10 | fun onChange(usedSatellites: Int, maxSatellites: Int) 11 | fun onFirstFix() 12 | fun onStopListening() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /studio/features/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 180dp 6 | 16dp 7 | 16dp 8 | 8dp 9 | 8dp 10 | 11 | -------------------------------------------------------------------------------- /studio/features/src/main/res/menu/search.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /studio/service/src/main/aidl/nl/sogeti/android/gpstracker/integration/IGPSLoggerServiceRemote.aidl: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.integration; 2 | 3 | import android.net.Uri; 4 | import android.location.Location; 5 | 6 | interface IGPSLoggerServiceRemote { 7 | 8 | long getTrackId(); 9 | int loggingState(); 10 | boolean isMediaPrepared(); 11 | Uri storeMediaUri(in Uri mediaUri); 12 | Uri storeMetaData(in String key, in String value); 13 | Location getLastWaypoint(); 14 | float getTrackedDistance(); 15 | } -------------------------------------------------------------------------------- /studio/app/src/develop/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /studio/app/src/store/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_mode_edit_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_pin_start_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/tracklist/TrackListAdapterListener.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.tracklist 2 | 3 | import android.net.Uri 4 | 5 | interface TrackListAdapterListener { 6 | fun didSelectTrack(track: Uri, name: String) 7 | fun didDeleteTrack(track: Uri) 8 | fun didEditTrack(track: Uri) 9 | fun didSelectExportToDirectory() 10 | fun didSelectImportFromDirectory() 11 | fun didSelectExportTrack(track: Uri) 12 | fun didSelectImportTrack() 13 | } 14 | -------------------------------------------------------------------------------- /studio/utils/src/main/java/nl/sogeti/android/gpstracker/utils/concurrent/BackgroundThreadFactory.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.utils.concurrent 2 | 3 | import java.util.concurrent.ThreadFactory 4 | 5 | class BackgroundThreadFactory(name: String) : ThreadFactory { 6 | private val group = ThreadGroup(name) 7 | 8 | init { 9 | group.isDaemon = false 10 | group.maxPriority = android.os.Process.THREAD_PRIORITY_BACKGROUND 11 | } 12 | 13 | override fun newThread(task: Runnable?) = Thread(group, task) 14 | } 15 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_format_list_numbered_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/menu/import_export.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/util/BaseObservable.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.sharedwear.util 2 | 3 | import androidx.databinding.BaseObservable 4 | import androidx.databinding.Observable 5 | 6 | fun BaseObservable.observe(changed: (sender: Observable) -> Unit) = 7 | this.addOnPropertyChangedCallback(object : Observable.OnPropertyChangedCallback() { 8 | override fun onPropertyChanged(sender: Observable, propertyId: Int) { 9 | changed(sender) 10 | } 11 | }) 12 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_map_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_pin_end_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_search_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_track_type_walk.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/drawable/ic_sync_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/service/src/main/java/nl/sogeti/android/gpstracker/service/integration/ServiceManagerInterface.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.integration; 2 | 3 | import androidx.annotation.Nullable; 4 | 5 | public interface ServiceManagerInterface { 6 | 7 | void startup(@Nullable Runnable runnable); 8 | 9 | void shutdown(); 10 | 11 | int getLoggingState(); 12 | 13 | long getTrackId(); 14 | 15 | void startGPSLogging(@Nullable String trackName); 16 | 17 | void stopGPSLogging(); 18 | 19 | void pauseGPSLogging(); 20 | 21 | void resumeGPSLogging(); 22 | 23 | boolean isPackageInstalled(); 24 | } 25 | -------------------------------------------------------------------------------- /studio/service/src/main/res/values/strings_integration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Access to start and stop the GPS logger in Open GPS Tracker is required to continue. 4 | Access to the tracks stored in Open GPS Tracker is required to continue. 5 | Missing installation 6 | The original Open GPS Tracker is required to run this application 7 | Install 8 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/FeatureConfiguration.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features 2 | 3 | import androidx.databinding.DataBindingUtil 4 | import nl.sogeti.android.gpstracker.ng.features.dagger.FeatureComponent 5 | import nl.sogeti.android.gpstracker.ng.features.databinding.FeaturesBindingComponent 6 | 7 | object FeatureConfiguration { 8 | 9 | lateinit var featureComponent: FeatureComponent 10 | 11 | fun setupDefaultViewBinding() { 12 | val bindingComponent = FeaturesBindingComponent() 13 | DataBindingUtil.setDefaultComponent(bindingComponent) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/graphs/GraphSpeedConverter.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.graphs 2 | 3 | import javax.inject.Inject 4 | 5 | class GraphSpeedConverter @Inject constructor() { 6 | 7 | fun speedToYValue(meterPerSecond: Float): Float { 8 | if (meterPerSecond < 0.001) { 9 | return 0F 10 | } 11 | return (1F / meterPerSecond) / 0.06F 12 | } 13 | 14 | fun yValueToSpeed(minutePerKilometer: Float): Float { 15 | val kilometerPerMinute = 1F / minutePerKilometer 16 | return kilometerPerMinute * 1000 / 60 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /studio/service/src/store/res/xml/searchable.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_track_type_run.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/dagger/VersionInfoModule.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.dagger 2 | 3 | import dagger.Module 4 | import dagger.Provides 5 | import javax.inject.Named 6 | 7 | @Module 8 | class VersionInfoModule(private val version: String, private val commit: String, private val buildNumber: String) { 9 | 10 | @Provides 11 | @Named("version") 12 | fun provideVersion() = version 13 | 14 | @Provides 15 | @Named("commit") 16 | fun provideCommit() = commit 17 | 18 | @Provides 19 | @Named("buildNumber") 20 | fun provideBuildNumber() = buildNumber 21 | } 22 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/graphs/widgets/LineGraphBindings.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.graphs.widgets 2 | 3 | import androidx.databinding.BindingAdapter 4 | import nl.sogeti.android.gpstracker.ng.features.graphs.dataproviders.GraphDataCalculator 5 | 6 | open class LineGraphBindings { 7 | 8 | @BindingAdapter("data", "value_description") 9 | fun setData(view: LineGraph, data: List?, descriptor: GraphDataCalculator?) { 10 | view.data = data ?: emptyList() 11 | view.description = descriptor ?: GraphDataCalculator.DefaultGraphValueDescriptor 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /studio/service/src/mock/res/xml/searchable.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_directions_run_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_lock_outline_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/service/src/develop/res/xml/searchable.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_my_location_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/signing.gradle: -------------------------------------------------------------------------------- 1 | def env = System.getenv() 2 | 3 | android { 4 | signingConfigs { 5 | debug { 6 | storeFile file("../debug.keystore") 7 | } 8 | } 9 | } 10 | 11 | if (System.getenv().containsKey("storeFile")) { 12 | android { 13 | signingConfigs { 14 | release { 15 | storeFile file(env["storeFile"]) 16 | storePassword env["storePassword"] 17 | keyAlias env["keyAlias"] 18 | keyPassword env["keyPassword"] 19 | } 20 | } 21 | buildTypes { 22 | release { 23 | signingConfig signingConfigs.release 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_track_type_train.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/res/values-en/constants.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | %1$.0f %2$s 4 | 5 | 3.6 6 | kph 7 | 8 | 1.0 9 | 1000.0 10 | 11 | %.1f meter 12 | %.0f meter 13 | %.2f kilometer 14 | %.0f kilometer 15 | 16 | 17 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/util/Attempting.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.sharedwear.util 2 | 3 | import kotlin.reflect.KProperty 4 | 5 | class Trying(private val trying: () -> T) { 6 | private var value: T? = null 7 | 8 | operator fun getValue(thisRef: Any?, property: KProperty<*>): T { 9 | val returnValue = value ?: trying() 10 | if (value == null) { 11 | value = returnValue 12 | } 13 | return returnValue 14 | } 15 | 16 | operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) { 17 | this.value = value 18 | } 19 | } 20 | 21 | fun trying(trying: () -> S): Trying = Trying(trying) 22 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/res/values-en-rUS/constants.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | %1$.0f %2$s 4 | 5 | 2.23693629 6 | mph 7 | 8 | 1609.34400061 9 | 1609.34400061 10 | 11 | %.2f mile 12 | %.2f mile 13 | %.2f mile 14 | %.0f mile 15 | 16 | 17 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_track_type_car.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/service/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/android-sdk-mac_86/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -dontobfuscate -------------------------------------------------------------------------------- /studio/wear/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 0dp 8 | 9 | 14 | 5dp 15 | 64dp 16 | 58dp 17 | 18 | -------------------------------------------------------------------------------- /studio/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/android-sdk-mac_86/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -dontobfuscate 19 | 20 | -------------------------------------------------------------------------------- /studio/utils/src/main/java/nl/sogeti/android/gpstracker/utils/PermissionChecker.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.utils 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import androidx.core.app.ActivityCompat 6 | import androidx.core.content.ContextCompat 7 | 8 | /** 9 | * replaces some framework static calls related to permission with injectable instance object 10 | */ 11 | open class PermissionChecker { 12 | 13 | open fun checkSelfPermission(context: Context, permission: String) = 14 | ContextCompat.checkSelfPermission(context, permission) 15 | 16 | open fun shouldShowRequestPermissionRationale(activity: Activity, permission: String) = 17 | ActivityCompat.shouldShowRequestPermissionRationale(activity, permission) 18 | } 19 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_share_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/drawable/ic_cross.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/values/palette.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #c29c00 4 | #FFF2BD 5 | #ffd100 6 | #ffa800 7 | 8 | #212121 9 | #727272 10 | #212121 11 | #B6B6B6 12 | 13 | #38300a 14 | 15 | 16 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_track_type_boat.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/drawable/ic_sync_disabled_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/base/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -dontobfuscate 23 | -------------------------------------------------------------------------------- /studio/utils/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -dontobfuscate -------------------------------------------------------------------------------- /studio/features/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -dontobfuscate 23 | -------------------------------------------------------------------------------- /studio/test-utils/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -dontobfuscate -------------------------------------------------------------------------------- /studio/wear/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -dontobfuscate 24 | 25 | -------------------------------------------------------------------------------- /studio/wear-shared/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -dontobfuscate 24 | 25 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/common/controllers/gpsstatus/BaseGpsStatusControllerImpl.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.common.controllers.gpsstatus 2 | 3 | import android.content.Context 4 | import android.location.LocationManager 5 | 6 | abstract class BaseGpsStatusControllerImpl(val context: Context, val listener: GpsStatusController.Listener) : GpsStatusController { 7 | protected val locationManager: LocationManager 8 | get() = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager 9 | 10 | fun started() { 11 | listener.onStartListening() 12 | } 13 | 14 | fun stopped() { 15 | listener.onStopListening() 16 | } 17 | 18 | fun firstFix() { 19 | listener.onFirstFix() 20 | } 21 | 22 | fun satellites(used: Int, max: Int) { 23 | listener.onChange(used, max) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /studio/features/src/main/res/menu/map.xml: -------------------------------------------------------------------------------- 1 | 5 | 12 | 19 | 20 | -------------------------------------------------------------------------------- /studio/utils/src/main/java/nl/sogeti/android/gpstracker/utils/test/WithResources.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.utils.test 2 | 3 | import java.io.Closeable 4 | 5 | /** 6 | * Based on the description by Vladimir Bezhenar 7 | * https://discuss.kotlinlang.org/t/is-there-standard-way-to-use-multiple-resources/2613 8 | */ 9 | class Resources : Closeable { 10 | private val resources = mutableListOf() 11 | 12 | fun T.use(): T { 13 | resources += this 14 | return this 15 | } 16 | 17 | override fun close() { 18 | resources.reversed().forEach { resource -> 19 | try { 20 | resource.close() 21 | } catch (closeException: Exception) { 22 | //ignore 23 | } 24 | } 25 | } 26 | } 27 | 28 | inline fun withResources(block: Resources.() -> T): T = Resources().use(block) 29 | -------------------------------------------------------------------------------- /studio/service/src/main/java/nl/sogeti/android/gpstracker/service/dagger/ServiceComponent.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.dagger 2 | 3 | import dagger.Component 4 | import nl.sogeti.android.gpstracker.service.integration.ServiceCommanderInterface 5 | import nl.sogeti.android.gpstracker.service.integration.ServiceManagerInterface 6 | import nl.sogeti.android.gpstracker.service.util.PermissionRequester 7 | import javax.inject.Named 8 | 9 | @Component(modules = [(ServiceModule::class)]) 10 | interface ServiceComponent { 11 | 12 | @Named("providerAuthority") 13 | fun providerAuthority(): String 14 | 15 | @Named("stateBroadcastAction") 16 | fun stateBroadcastAction(): String 17 | 18 | fun serviceManagerInterface(): ServiceManagerInterface 19 | 20 | fun serviceCommanderInterface(): ServiceCommanderInterface 21 | 22 | fun inject(injectable: PermissionRequester) 23 | 24 | } 25 | -------------------------------------------------------------------------------- /studio/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_track_type_bike.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout/activity_graph.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /studio/base/src/main/res/values/palette.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #33402900 4 | #33c29c00 5 | #c29c00 6 | #FFF2BD 7 | #ffd100 8 | #ffa800 9 | 10 | #212121 11 | #727272 12 | #212121 13 | #B6B6B6 14 | 15 | #38300a 16 | 17 | 18 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout/row_track_type.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 16 | 17 | 25 | 26 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/res/values/constants.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0.06 5 | %1$d:%2$02d %3$s 6 | min 7 | 8 | 3.6 9 | %1$.0f %2$s 10 | kph 11 | 12 | 13 | 1.0 14 | 1000.0 15 | 16 | %.1f meter 17 | %.0f meter 18 | %.2f kilometer 19 | %.0f kilometer 20 | 21 | 22 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d second 6 | %d seconds 7 | 8 | 9 | %d minute 10 | %d minutes 11 | 12 | 13 | %d hour 14 | %d hours 15 | 16 | 17 | %d day 18 | %d days 19 | 20 | 21 | %1$d d %2$d h 22 | %1$d h %2$d m 23 | %1$d m %2$d s 24 | 25 | 26 | -------------------------------------------------------------------------------- /studio/wear/src/main/java/nl/sogeti/android/gpstracker/v2/wear/common/WearApplication.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.wear.common 2 | 3 | import android.app.Application 4 | import android.os.StrictMode 5 | import nl.sogeti.android.gpstracker.v2.wear.BuildConfig 6 | import timber.log.Timber 7 | 8 | class WearApplication : Application() { 9 | 10 | var debug = BuildConfig.DEBUG 11 | 12 | override fun onCreate() { 13 | super.onCreate() 14 | setupDebugTree() 15 | } 16 | 17 | private fun setupDebugTree() { 18 | if (debug) { 19 | Timber.plant(Timber.DebugTree()) 20 | if (StrictMode.ThreadPolicy.Builder().build() != null) { 21 | StrictMode.setThreadPolicy( 22 | StrictMode.ThreadPolicy.Builder() 23 | .detectAll() 24 | .penaltyLog() 25 | .build()) 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/util/AbstractTrackPresenter.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.util 2 | 3 | import android.net.Uri 4 | import androidx.annotation.CallSuper 5 | import nl.sogeti.android.gpstracker.ng.base.common.controllers.content.ContentController 6 | import javax.inject.Inject 7 | 8 | abstract class AbstractTrackPresenter : AbstractPresenter(), ContentController.Listener { 9 | 10 | @Inject 11 | lateinit var contentController: ContentController 12 | 13 | var trackUri: Uri? = null 14 | set(value) { 15 | field = value 16 | contentController.registerObserver(this, trackUri) 17 | markDirty() 18 | } 19 | 20 | @CallSuper 21 | override fun onCleared() { 22 | contentController.unregisterObserver() 23 | super.onCleared() 24 | } 25 | 26 | final override fun onChangeUriContent(contentUri: Uri, changesUri: Uri) { 27 | markDirty() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout/activity_tracklist.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 16 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /studio/wear/src/main/java/nl/sogeti/android/gpstracker/v2/wear/communication/WearMessageListenerService.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.wear.communication 2 | 3 | import android.content.Intent.FLAG_ACTIVITY_NEW_TASK 4 | import nl.sogeti.android.gpstracker.v2.sharedwear.messaging.MessageListenerService 5 | import nl.sogeti.android.gpstracker.v2.sharedwear.model.StatisticsMessage 6 | import nl.sogeti.android.gpstracker.v2.sharedwear.model.StatusMessage 7 | import nl.sogeti.android.gpstracker.v2.wear.ControlActivity 8 | 9 | class WearMessageListenerService : MessageListenerService() { 10 | 11 | override fun updateStatus(status: StatusMessage) { 12 | val intent = ControlActivity.createIntent(this, status) 13 | intent.addFlags(FLAG_ACTIVITY_NEW_TASK) 14 | startActivity(intent) 15 | } 16 | 17 | override fun updateStatistics(statistics: StatisticsMessage) { 18 | val intent = ControlActivity.createIntent(this, statistics) 19 | intent.addFlags(FLAG_ACTIVITY_NEW_TASK) 20 | startActivity(intent) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_graphs.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /studio/service/src/main/java/nl/sogeti/android/gpstracker/service/dagger/ServiceModule.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.dagger 2 | 3 | import android.content.Context 4 | import dagger.Module 5 | import dagger.Provides 6 | import nl.sogeti.android.gpstracker.service.integration.* 7 | import nl.sogeti.android.gpstracker.utils.PermissionChecker 8 | import javax.inject.Named 9 | 10 | @Module 11 | class ServiceModule(val context: Context) { 12 | 13 | @Provides 14 | fun serviceManagerInterface(): ServiceManagerInterface = ServiceManager(context) 15 | 16 | @Provides 17 | fun serviceCommanderInterface(): ServiceCommanderInterface = ServiceCommander(context) 18 | 19 | @Provides 20 | @Named("providerAuthority") 21 | fun providerAuthority() = 22 | ContentConstants.GPS_TRACKS_AUTHORITY 23 | 24 | @Provides 25 | @Named("stateBroadcastAction") 26 | fun stateBroadcastAction() = 27 | ServiceConstants.ACTION_BROADCAST_LOGGING_STATE 28 | 29 | @Provides 30 | fun permissionChecker() = PermissionChecker() 31 | 32 | } 33 | -------------------------------------------------------------------------------- /studio/gradle.properties: -------------------------------------------------------------------------------- 1 | # suppress inspection "UnusedProperty" for whole file 2 | # Project-wide Gradle settings. 3 | 4 | # IDE (e.g. Android Studio) users: 5 | # Gradle settings configured through the IDE *will override* 6 | # any settings specified in this file. 7 | 8 | # For more details on how to configure your build environment visit 9 | # http://www.gradle.org/docs/current/userguide/build_environment.html 10 | 11 | # Specifies the JVM arguments used for the daemon process. 12 | # The setting is particularly useful for tweaking memory settings. 13 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 14 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | 21 | org.gradle.daemon=true 22 | android.databinding.enableV2=true 23 | android.useAndroidX=true 24 | android.enableJetifier=true 25 | -------------------------------------------------------------------------------- /studio/app/src/mock/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 19 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout-sw600dp/fragment_tracklist.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 14 | 15 | 16 | 27 | 28 | -------------------------------------------------------------------------------- /studio/test-utils/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-kapt' 4 | 5 | android { 6 | compileSdkVersion rootProject.targetSdk 7 | buildToolsVersion rootProject.buildTools 8 | 9 | defaultConfig { 10 | minSdkVersion rootProject.minSdk 11 | targetSdkVersion rootProject.targetSdk 12 | versionCode 1 13 | versionName "1.0" 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | lintOptions { 25 | abortOnError false 26 | } 27 | 28 | apply from: '../flavors.gradle' 29 | 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(dir: 'libs', include: ['*.jar']) 34 | 35 | implementation libraries.kotlin.stdlib 36 | implementation libraries.test.junit 37 | implementation libraries.test.mockito_core 38 | implementation libraries.test.hamcrest_library 39 | } 40 | -------------------------------------------------------------------------------- /studio/utils/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion rootProject.targetSdk 6 | buildToolsVersion rootProject.buildTools 7 | 8 | defaultConfig { 9 | minSdkVersion rootProject.minSdk 10 | targetSdkVersion rootProject.targetSdk 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | } 15 | 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | 23 | lintOptions { 24 | abortOnError false 25 | } 26 | 27 | apply from: '../flavors.gradle' 28 | 29 | } 30 | 31 | dependencies { 32 | implementation fileTree(dir: 'libs', include: ['*.jar']) 33 | 34 | implementation libraries.kotlin.stdlib 35 | implementation libraries.android.appcompat 36 | implementation libraries.square.timber 37 | 38 | testImplementation libraries.test.junit 39 | testImplementation libraries.test.mockito_core 40 | } 41 | -------------------------------------------------------------------------------- /studio/wear/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | OGT - Control 3 | 4 | Recording 5 | Paused 6 | Stopped 7 | Syncing 8 | Disconnected 9 | 10 | Start 11 | Pause 12 | Stop 13 | Resume 14 | Sync 15 | 16 | Starting 17 | Pausing 18 | Stopping 19 | Resuming 20 | Syncing 21 | Disconnecting 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/common/controllers/gpsstatus/GpsStatusControllerFactory.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.common.controllers.gpsstatus 2 | 3 | import android.annotation.SuppressLint 4 | import android.content.Context 5 | import android.os.Build 6 | import nl.sogeti.android.gpstracker.ng.base.common.controllers.gpsstatus.GnnsStatusControllerImpl 7 | import nl.sogeti.android.gpstracker.ng.base.common.controllers.gpsstatus.GpsStatusController 8 | 9 | open class GpsStatusControllerFactory(val context: Context) { 10 | 11 | open fun createGpsStatusController(listener: GpsStatusController.Listener): GpsStatusController { 12 | return createGpsStatusController(context, listener, Build.VERSION.SDK_INT) 13 | } 14 | 15 | @SuppressLint("NewApi") 16 | @Suppress("DEPRECATION") 17 | fun createGpsStatusController(context: Context, listener: GpsStatusController.Listener, sdkVersion: Int): GpsStatusController = 18 | if (sdkVersion >= Build.VERSION_CODES.N) { 19 | GnnsStatusControllerImpl(context, listener) 20 | } else { 21 | GpsStatusControllerImpl(context, listener) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/activityrecognition/ActivityRecognizerLoggingBroadcastReceiver.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.activityrecognition 2 | 3 | import android.content.Context 4 | import android.net.Uri 5 | import nl.sogeti.android.gpstracker.ng.features.FeatureConfiguration 6 | import nl.sogeti.android.gpstracker.ng.features.util.LoggingStateBroadcastReceiver 7 | import javax.inject.Inject 8 | 9 | class ActivityRecognizerLoggingBroadcastReceiver : LoggingStateBroadcastReceiver() { 10 | 11 | @Inject 12 | lateinit var activityRecognition: ActivityRecognition 13 | 14 | init { 15 | FeatureConfiguration.featureComponent.inject(this) 16 | } 17 | 18 | override fun didStopLogging(context: Context) { 19 | activityRecognition.stop() 20 | } 21 | 22 | override fun didPauseLogging(context: Context, trackUri: Uri) { 23 | activityRecognition.stop() 24 | } 25 | 26 | override fun didStartLogging(context: Context, trackUri: Uri) { 27 | activityRecognition.start(trackUri) 28 | } 29 | 30 | override fun onError(context: Context) { 31 | activityRecognition.stop() 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/graphs/GraphsActivity.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.graphs 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import android.os.Bundle 6 | import androidx.appcompat.app.AppCompatActivity 7 | import androidx.appcompat.widget.Toolbar 8 | import nl.sogeti.android.opengpstrack.ng.features.R 9 | 10 | class GraphsActivity : AppCompatActivity() { 11 | 12 | companion object { 13 | fun start(context: Context) { 14 | val intent = Intent(context, GraphsActivity::class.java) 15 | context.startActivity(intent) 16 | } 17 | } 18 | 19 | override fun onCreate(savedInstanceState: Bundle?) { 20 | super.onCreate(savedInstanceState) 21 | setContentView(R.layout.activity_graph) 22 | val toolbar = findViewById(R.id.toolbar) 23 | setSupportActionBar(toolbar) 24 | supportActionBar?.setDisplayHomeAsUpEnabled(true) 25 | 26 | if (savedInstanceState == null) { 27 | val fragment = GraphsFragment() 28 | supportFragmentManager.beginTransaction().replace(R.id.fragment_graphs_container, fragment).commit() 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /studio/features/src/main/res/menu/track.xml: -------------------------------------------------------------------------------- 1 | 5 | 11 | 17 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /studio/service/src/mock/java/nl/sogeti/android/gpstracker/service/dagger/MockServiceModule.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.dagger 2 | 3 | import android.content.Context 4 | import dagger.Module 5 | import dagger.Provides 6 | import nl.sogeti.android.gpstracker.ng.mock.MockPermissionChecker 7 | import nl.sogeti.android.gpstracker.service.integration.* 8 | import nl.sogeti.android.gpstracker.service.mock.MockServiceManager 9 | import nl.sogeti.android.gpstracker.utils.PermissionChecker 10 | import javax.inject.Named 11 | 12 | @Module 13 | class MockServiceModule(val context: Context) { 14 | 15 | @Provides 16 | fun serviceManagerInterface(): ServiceManagerInterface = MockServiceManager(context) 17 | 18 | 19 | @Provides 20 | fun serviceCommanderInterface(): ServiceCommanderInterface = MockServiceManager(context) 21 | 22 | @Provides 23 | @Named("providerAuthority") 24 | fun providerAuthority() = 25 | ContentConstants.GPS_TRACKS_AUTHORITY 26 | 27 | @Provides 28 | @Named("stateBroadcastAction") 29 | fun stateBroadcastAction() = 30 | ServiceConstants.ACTION_BROADCAST_LOGGING_STATE 31 | 32 | @Provides 33 | fun permissionChecker(): PermissionChecker = MockPermissionChecker() 34 | } 35 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/util/AbstractSelectedTrackPresenter.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.util 2 | 3 | import androidx.lifecycle.Observer 4 | import android.net.Uri 5 | import nl.sogeti.android.gpstracker.ng.features.FeatureConfiguration 6 | import nl.sogeti.android.gpstracker.service.util.readName 7 | 8 | abstract class AbstractSelectedTrackPresenter : AbstractTrackPresenter() { 9 | 10 | protected val trackSelection = FeatureConfiguration.featureComponent.trackSelection() 11 | private val selectionObserver = Observer { trackUri -> onTrackSelected(trackUri) } 12 | 13 | override fun onStart() { 14 | super.onStart() 15 | trackSelection.selection.observeForever(selectionObserver) 16 | } 17 | 18 | override fun onStop() { 19 | trackSelection.selection.removeObserver(selectionObserver) 20 | super.onStop() 21 | } 22 | 23 | private fun onTrackSelected(trackUri: Uri?) { 24 | super.trackUri = trackUri 25 | } 26 | 27 | final override fun onChange() { 28 | val trackName = trackUri?.readName() ?: "" 29 | onTrackUpdate(trackUri, trackName) 30 | } 31 | 32 | abstract fun onTrackUpdate(trackUri: Uri?, name: String) 33 | } 34 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout/fragment_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 17 | 18 | 25 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /studio/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | apply from: 'versions.gradle' 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | maven { 9 | url "http://dl.bintray.com/kotlin/kotlin-eap" 10 | } 11 | maven { 12 | url 'https://maven.fabric.io/public' 13 | } 14 | } 15 | dependencies { 16 | classpath "com.android.tools.build:gradle:$rootProject.gradlePluginVersion" 17 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$rootProject.kotlinVersion" 18 | classpath "com.google.gms:google-services:$rootProject.googleServicesVersion" 19 | classpath "io.fabric.tools:gradle:$rootProject.fabricVerion" 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | google() 26 | jcenter() 27 | mavenCentral() 28 | maven { 29 | url "http://dl.bintray.com/kotlin/kotlin-eap" 30 | } 31 | } 32 | } 33 | 34 | tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { 35 | kotlinOptions { 36 | freeCompilerArgs = ["-progressive"] 37 | } 38 | } 39 | 40 | task clean(type: Delete) { 41 | delete rootProject.buildDir 42 | } 43 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_satellite_none.xml: -------------------------------------------------------------------------------- 1 | 6 | 15 | 24 | 25 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/trackedit/TrackTypesBindingAdapters.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.trackedit 2 | 3 | import androidx.databinding.BindingAdapter 4 | import androidx.appcompat.widget.AppCompatSpinner 5 | import nl.sogeti.android.gpstracker.ng.features.databinding.CommonBindingAdapters 6 | 7 | class TrackTypesBindingAdapters : CommonBindingAdapters() { 8 | 9 | @BindingAdapter("trackTypes", "selection", requireAll = false) 10 | fun setTrackTypes(spinner: AppCompatSpinner, 11 | trackTypes: List?, 12 | selection: Int?) { 13 | val viewAdapter: TrackTypeSpinnerAdapter 14 | if (spinner.adapter is TrackTypeSpinnerAdapter) { 15 | viewAdapter = spinner.adapter as TrackTypeSpinnerAdapter 16 | viewAdapter.trackTypes = trackTypes ?: listOf() 17 | } else { 18 | viewAdapter = TrackTypeSpinnerAdapter(spinner.context, trackTypes ?: listOf()) 19 | spinner.adapter = viewAdapter 20 | } 21 | 22 | if (selection != null) { 23 | spinner.setSelection(selection) 24 | } else { 25 | spinner.setSelection(AppCompatSpinner.INVALID_POSITION) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /studio/app/src/androidTestMock/java/nl/sogeti/android/gpstracker/ng/ui/fragments/TrackListFragmentEspressoTest.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.ui.fragments; 2 | 3 | import android.Manifest; 4 | import androidx.test.rule.GrantPermissionRule; 5 | 6 | import org.junit.Before; 7 | import org.junit.Rule; 8 | import org.junit.Test; 9 | 10 | import nl.sogeti.android.gpstracker.ng.features.tracklist.TrackListFragment; 11 | import nl.sogeti.android.gpstracker.ng.robots.TrackListRobot; 12 | import nl.sogeti.android.gpstracker.ng.util.FragmentTestRule; 13 | 14 | public class TrackListFragmentEspressoTest { 15 | 16 | @Rule 17 | public GrantPermissionRule mRuntimePermissionRule = GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE); 18 | @Rule 19 | public FragmentTestRule wrapperFragment = new FragmentTestRule<>(TrackListFragment.class, false, false); 20 | private TrackListFragment sut = null; 21 | 22 | @Before 23 | public void setup() { 24 | sut = wrapperFragment.getFragment(); 25 | } 26 | 27 | @Test 28 | public void testResumeStartsPresenter() { 29 | // Execute 30 | wrapperFragment.launchFragment(null); 31 | 32 | // Verify 33 | new TrackListRobot() 34 | .isTrackListDisplayed(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /studio/service/src/main/java/nl/sogeti/android/gpstracker/service/logger/LoggingConstants.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.logger; 2 | 3 | /** 4 | * Created by grootren on 13-11-15. 5 | */ 6 | public class LoggingConstants { 7 | public static final long GLOBAL_INTERVAL = 300000l; 8 | public static final float FINE_DISTANCE = 5F; 9 | public static final long FINE_INTERVAL = 1000l; 10 | public static final float FINE_ACCURACY = 20f; 11 | public static final float NORMAL_DISTANCE = 10F; 12 | public static final long NORMAL_INTERVAL = 15000l; 13 | public static final float NORMAL_ACCURACY = 30f; 14 | public static final float COARSE_DISTANCE = 25F; 15 | public static final long COARSE_INTERVAL = 30000l; 16 | public static final float COARSE_ACCURACY = 75f; 17 | public static final float GLOBAL_DISTANCE = 500F; 18 | public static final float GLOBAL_ACCURACY = 1000f; 19 | public static final String SERVICESTATE_DISTANCE = "SERVICESTATE_DISTANCE"; 20 | public static final String SERVICESTATE_STATE = "SERVICESTATE_STATE"; 21 | public static final String SERVICESTATE_PRECISION = "SERVICESTATE_PRECISION"; 22 | public static final String SERVICESTATE_SEGMENTID = "SERVICESTATE_SEGMENTID"; 23 | public static final String SERVICESTATE_TRACKID = "SERVICESTATE_TRACKID"; 24 | } 25 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/model/StatisticsMessage.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.sharedwear.model 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Parcelable 5 | import com.google.android.gms.wearable.DataMap 6 | import kotlinx.android.parcel.Parcelize 7 | 8 | @SuppressLint("ParcelCreator") 9 | @Parcelize 10 | data class StatisticsMessage(val speed: Float, val inverse: Boolean, val distance: Float, val duration: Long) : WearMessage(PATH_STATISTICS), Parcelable { 11 | 12 | constructor(dataMap: DataMap) : 13 | this(dataMap.getFloat(SPEED), dataMap.getBoolean(INVERSE), dataMap.getFloat(DISTANCE), dataMap.getLong(DURATION)) 14 | 15 | override fun toDataMap(): DataMap { 16 | val dataMap = DataMap() 17 | dataMap.putFloat(SPEED, speed) 18 | dataMap.putBoolean(INVERSE, inverse) 19 | dataMap.putFloat(DISTANCE, distance) 20 | dataMap.putLong(DURATION, duration) 21 | return dataMap 22 | } 23 | 24 | companion object { 25 | const val PATH_STATISTICS = "/ogt-recordings-statistics" 26 | 27 | private const val SPEED = "SPEED" 28 | private const val INVERSE = "INVERSE" 29 | private const val DISTANCE = "DISTANCE" 30 | private const val DURATION = "DURATION" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /studio/features/src/test/java/nl/sogeti/android/gpstracker/ng/features/trackedit/TrackTypeDescriptionsTest.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.trackedit 2 | 3 | import nl.sogeti.android.opengpstrack.ng.features.R 4 | import org.hamcrest.Matchers.`is` 5 | import org.junit.Assert.* 6 | import org.junit.Before 7 | import org.junit.Test 8 | 9 | class TrackTypeDescriptionsTest { 10 | 11 | lateinit var sut: TrackTypeDescriptions.Companion 12 | 13 | @Before 14 | fun setUp() { 15 | sut = TrackTypeDescriptions 16 | } 17 | 18 | @Test 19 | fun testSearchingBoatType() { 20 | // Act 21 | val trackType = sut.trackTypeForContentType("TYPE_BOAT") 22 | // Assert 23 | assertThat(trackType.drawableId, `is`(R.drawable.ic_track_type_boat)) 24 | assertThat(trackType.stringId, `is`(R.string.track_type_boat)) 25 | assertThat(trackType.contentValue, `is`("TYPE_BOAT")) 26 | } 27 | 28 | @Test 29 | fun testSearchingNullType() { 30 | // Act 31 | val trackType = sut.trackTypeForContentType(null) 32 | // Assert 33 | assertThat(trackType.drawableId, `is`(R.drawable.ic_track_type_default)) 34 | assertThat(trackType.stringId, `is`(R.string.track_type_default)) 35 | assertThat(trackType.contentValue, `is`("TYPE_DEFAULT")) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /studio/wear-shared/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-kapt' 4 | apply plugin: 'kotlin-android-extensions' 5 | 6 | androidExtensions { 7 | experimental = true 8 | } 9 | 10 | android { 11 | compileSdkVersion rootProject.targetSdk 12 | buildToolsVersion rootProject.buildTools 13 | 14 | defaultConfig { 15 | minSdkVersion rootProject.minSdk 16 | targetSdkVersion rootProject.targetSdk 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | 26 | lintOptions { 27 | abortOnError false 28 | } 29 | 30 | apply from: '../flavors.gradle' 31 | 32 | dataBinding { 33 | enabled = true 34 | } 35 | } 36 | 37 | dependencies { 38 | implementation fileTree(dir: 'libs', include: ['*.jar']) 39 | 40 | api libraries.google.play_services_wearable 41 | implementation libraries.kotlin.stdlib 42 | implementation libraries.square.timber 43 | 44 | testImplementation project(':test-utils') 45 | 46 | testImplementation libraries.test.junit 47 | testImplementation libraries.test.mockito_core 48 | 49 | kapt libraries.android.databindingcompiler 50 | } 51 | -------------------------------------------------------------------------------- /studio/app/src/androidTestMock/java/nl/sogeti/android/gpstracker/ng/util/WebViewIdlingResource.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.util 2 | 3 | import android.os.Handler 4 | import android.os.Looper 5 | import android.webkit.WebChromeClient 6 | import android.webkit.WebView 7 | import androidx.test.espresso.IdlingResource 8 | 9 | class WebViewIdlingResource(private val webView: WebView) : WebChromeClient(), IdlingResource { 10 | 11 | private var callback: IdlingResource.ResourceCallback? = null 12 | 13 | init { 14 | Handler(Looper.getMainLooper()).post { 15 | webView.webChromeClient = this@WebViewIdlingResource 16 | } 17 | } 18 | 19 | override fun isIdleNow(): Boolean { 20 | val isIdle = webView.progress == 100 21 | if (isIdle) { 22 | callback?.onTransitionToIdle() 23 | } 24 | return isIdle 25 | } 26 | 27 | override fun getName() = "WebViewResource_${webView.id}" 28 | 29 | override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) { 30 | this.callback = callback 31 | } 32 | 33 | override fun onProgressChanged(view: WebView?, newProgress: Int) { 34 | super.onProgressChanged(view, newProgress) 35 | if (webView.progress == 100) { 36 | callback?.onTransitionToIdle() 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /studio/flavors.gradle: -------------------------------------------------------------------------------- 1 | android { 2 | flavorDimensions "service" 3 | 4 | productFlavors { 5 | store { 6 | dimension "service" 7 | manifestPlaceholders = [ 8 | providerAuthority: "nl.sogeti.android.gpstracker", 9 | controlPermission: "nl.sogeti.android.gpstracker.permission.TRACKING_CONTROL", 10 | tracksPermission : "nl.sogeti.android.gpstracker.permission.TRACKING_HISTORY" 11 | ] 12 | } 13 | develop { 14 | dimension "service" 15 | manifestPlaceholders = [ 16 | providerAuthority: "nl.sogeti.android.gpstracker.develop", 17 | controlPermission: "nl.sogeti.android.gpstracker.develop.permission.TRACKING_CONTROL", 18 | tracksPermission : "nl.sogeti.android.gpstracker.develop.permission.TRACKING_HISTORY" 19 | ] 20 | } 21 | mock { 22 | dimension "service" 23 | manifestPlaceholders = [ 24 | providerAuthority: "nl.sogeti.android.gpstracker.mock", 25 | controlPermission: "nl.sogeti.android.gpstracker.mock.permission.TRACKING_CONTROL", 26 | tracksPermission : "nl.sogeti.android.gpstracker.mock.permission.TRACKING_HISTORY" 27 | ] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/graphs/dataproviders/GraphDataProvider.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.graphs.dataproviders 2 | 3 | import android.content.Context 4 | import androidx.annotation.WorkerThread 5 | import nl.sogeti.android.gpstracker.ng.features.graphs.widgets.GraphPoint 6 | import nl.sogeti.android.gpstracker.ng.features.summary.Summary 7 | 8 | interface GraphDataCalculator { 9 | 10 | @WorkerThread 11 | fun calculateGraphPoints(summary: Summary): List 12 | 13 | val xLabel: Int 14 | val yLabel: Int 15 | 16 | fun describeXvalue(context: Context, xValue: Float): String { 17 | return "" 18 | } 19 | 20 | fun describeYvalue(context: Context, yValue: Float): String { 21 | return "" 22 | } 23 | 24 | fun prettyMinYValue(context: Context, yValue: Float): Float 25 | 26 | fun prettyMaxYValue(context: Context, yValue: Float): Float 27 | 28 | object DefaultGraphValueDescriptor : GraphDataCalculator { 29 | override fun calculateGraphPoints(summary: Summary) = emptyList() 30 | 31 | override fun prettyMinYValue(context: Context, yValue: Float) = yValue 32 | 33 | override fun prettyMaxYValue(context: Context, yValue: Float) = yValue 34 | 35 | override val xLabel: Int 36 | get() = 0 37 | override val yLabel: Int 38 | get() = 1 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /studio/features/src/test/java/nl/sogeti/android/gpstracker/ng/features/graphs/GraphDataHelpersTest.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.graphs 2 | 3 | import nl.sogeti.android.gpstracker.ng.features.graphs.dataproviders.condense 4 | import org.hamcrest.CoreMatchers.`is` 5 | import org.hamcrest.MatcherAssert.assertThat 6 | import org.junit.Test 7 | 8 | class GraphDataHelpersTest { 9 | 10 | @Test 11 | fun `condens empty list`() { 12 | val list = emptyList() 13 | 14 | val result = list.condense({ x, y -> x == y }, { it.sum() }) 15 | 16 | assertThat(result, `is`(emptyList())) 17 | } 18 | 19 | @Test 20 | fun `condens unique list`() { 21 | val list = listOf(1, 2, 3, 4, 5, 6) 22 | 23 | val result = list.condense({ x, y -> x == y }, { it.sum() }) 24 | 25 | assertThat(result, `is`(list)) 26 | } 27 | 28 | @Test 29 | fun `condens basic list`() { 30 | val list = listOf(1, 1, 2, 2, 3, 4, 5, 5, 5, 6) 31 | 32 | val result = list.condense({ x, y -> x == y }, { it.sum() }) 33 | 34 | assertThat(result, `is`(listOf(2, 4, 3, 4, 15, 6))) 35 | } 36 | 37 | @Test 38 | fun `condens repeating list`() { 39 | val list = listOf(1, 1, 2, 2, 3, 4, 5, 2, 2, 2, 5, 5, 6) 40 | 41 | val result = list.condense({ x, y -> x == y }, { it.sum() }) 42 | 43 | assertThat(result, `is`(listOf(2, 4, 3, 4, 5, 6, 10, 6))) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /studio/utils/src/main/java/nl/sogeti/android/gpstracker/utils/ActivityResultLambdaFragment.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.utils 2 | 3 | import android.app.Activity 4 | import android.content.Intent 5 | import androidx.fragment.app.Fragment 6 | import android.util.SparseArray 7 | import timber.log.Timber 8 | 9 | /** 10 | * Default implementation for ActivityResultLambda on a V4 Fragment super class 11 | */ 12 | abstract class ActivityResultLambdaFragment : Fragment(), ActivityResultLambda { 13 | 14 | //region Activity results 15 | 16 | private var requests = 1 17 | private val resultHandlers = SparseArray<(Intent?) -> Unit>() 18 | 19 | override fun startActivityForResult(intent: Intent, resultHandler: (Intent?) -> Unit) { 20 | val requestCode = ++requests 21 | resultHandlers.put(requestCode, resultHandler) 22 | startActivityForResult(intent, requestCode) 23 | } 24 | 25 | override fun onActivityResult(requestCode: Int, resultCode: Int, result: Intent?) { 26 | val resultHandler = resultHandlers.get(requestCode) 27 | resultHandlers.remove(requestCode) 28 | if (resultCode == Activity.RESULT_OK && resultHandler != null) { 29 | resultHandler(result) 30 | } else { 31 | Timber.e("Received $result without an way to handle") 32 | super.onActivityResult(requestCode, resultCode, result) 33 | } 34 | } 35 | 36 | //endregion 37 | } 38 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/model/StatusMessage.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.sharedwear.model 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Parcelable 5 | import com.google.android.gms.wearable.DataMap 6 | import kotlinx.android.parcel.Parcelize 7 | 8 | @SuppressLint("ParcelCreator") 9 | @Parcelize 10 | data class StatusMessage(val status: Status) : WearMessage(PATH_STATUS), Parcelable { 11 | constructor(dataMap: DataMap) : this(Status.valueOf(dataMap.getInt(STATUS))) 12 | 13 | override fun toDataMap(): DataMap { 14 | val dataMap = DataMap() 15 | dataMap.putInt(STATUS, status.code) 16 | return dataMap 17 | } 18 | 19 | enum class Status(val code: Int) { 20 | UNKNOWN(-1), 21 | START(1), 22 | PAUSE(2), 23 | RESUME(3), 24 | STOP(4); 25 | 26 | companion object { 27 | @JvmStatic 28 | fun valueOf(code: Int): Status = 29 | when (code) { 30 | 1 -> START 31 | 2 -> PAUSE 32 | 3 -> RESUME 33 | 4 -> STOP 34 | else -> UNKNOWN 35 | } 36 | } 37 | } 38 | 39 | companion object { 40 | const val PATH_STATUS = "/ogt-recordings-status" 41 | 42 | private const val STATUS = "STATUS" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_overflow.xml: -------------------------------------------------------------------------------- 1 | 6 | 15 | 24 | 33 | 34 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/common/controllers/gpsstatus/GnnsStatusControllerImpl.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.common.controllers.gpsstatus 2 | 3 | import android.annotation.TargetApi 4 | import android.content.Context 5 | import android.location.GnssStatus 6 | import android.os.Build.VERSION_CODES.N 7 | import nl.sogeti.android.gpstracker.ng.base.common.onMainThread 8 | 9 | @TargetApi(N) 10 | class GnnsStatusControllerImpl(context: Context, listener: GpsStatusController.Listener) : BaseGpsStatusControllerImpl(context, listener) { 11 | private val callback = object : GnssStatus.Callback() { 12 | override fun onStarted() { 13 | started() 14 | } 15 | 16 | override fun onStopped() { 17 | stopped() 18 | } 19 | 20 | override fun onFirstFix(ttffMillis: Int) { 21 | firstFix() 22 | } 23 | 24 | override fun onSatelliteStatusChanged(status: GnssStatus) { 25 | val used = (0 until status.satelliteCount).count { status.usedInFix(it) } 26 | satellites(used, status.satelliteCount) 27 | } 28 | } 29 | 30 | override fun startUpdates() { 31 | onMainThread { 32 | locationManager.registerGnssStatusCallback(callback) 33 | } 34 | } 35 | 36 | override fun stopUpdates() { 37 | listener.onStopListening() 38 | locationManager.unregisterGnssStatusCallback(callback) 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /studio/features/src/test/java/nl/sogeti/android/gpstracker/ng/features/databinding/CommonBindingAdaptersTest.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.databinding 2 | 3 | import android.graphics.Bitmap 4 | import androidx.appcompat.widget.AppCompatSpinner 5 | import android.webkit.WebView 6 | import android.widget.ImageView 7 | import org.junit.Before 8 | import org.junit.Test 9 | import org.mockito.Mockito.mock 10 | import org.mockito.Mockito.verify 11 | 12 | class CommonBindingAdaptersTest { 13 | 14 | lateinit var sut: CommonBindingAdapters 15 | 16 | @Before 17 | fun setUp() { 18 | sut = CommonBindingAdapters() 19 | } 20 | 21 | @Test 22 | fun setBitmap() { 23 | // Arrange 24 | val bitmap = mock(Bitmap::class.java) 25 | val view = mock(ImageView::class.java) 26 | // Act 27 | sut.setBitmap(view, bitmap) 28 | // 29 | verify(view).setImageBitmap(bitmap) 30 | } 31 | 32 | @Test 33 | fun setSrcCompat() { 34 | // Arrange 35 | val view = mock(ImageView::class.java) 36 | // Act 37 | sut.setImageSource(view, 5) 38 | // Assert 39 | verify(view).setImageResource(5) 40 | } 41 | 42 | @Test 43 | fun setUrl() { 44 | // Arrange 45 | val webView = mock(WebView::class.java) 46 | val url = "someurl" 47 | // Act 48 | sut.setUrl(webView, url) 49 | // Assert 50 | verify(webView).loadUrl(url) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout/fragment_graphs.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | 24 | 28 | 29 | 32 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout/include_graphs.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 16 | 17 | 22 | 23 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/common/controllers/gpsstatus/GpsStatusControllerImpl.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("DEPRECATION") 2 | 3 | package nl.sogeti.android.gpstracker.ng.common.controllers.gpsstatus 4 | 5 | import android.content.Context 6 | import android.location.GpsStatus.* 7 | import nl.sogeti.android.gpstracker.ng.base.common.controllers.gpsstatus.BaseGpsStatusControllerImpl 8 | import nl.sogeti.android.gpstracker.ng.base.common.controllers.gpsstatus.GpsStatusController 9 | import nl.sogeti.android.gpstracker.ng.base.common.onMainThread 10 | 11 | class GpsStatusControllerImpl(context: Context, listener: GpsStatusController.Listener) : BaseGpsStatusControllerImpl(context, listener) { 12 | private val callback = object : Listener { 13 | override fun onGpsStatusChanged(event: Int) { 14 | when (event) { 15 | GPS_EVENT_STARTED -> started() 16 | GPS_EVENT_STOPPED -> stopped() 17 | GPS_EVENT_FIRST_FIX -> firstFix() 18 | GPS_EVENT_SATELLITE_STATUS -> { 19 | val status = locationManager.getGpsStatus(null) 20 | satellites(status.satellites.count(), status.maxSatellites) 21 | } 22 | } 23 | } 24 | } 25 | 26 | override fun startUpdates() { 27 | onMainThread { 28 | locationManager.addGpsStatusListener(callback) 29 | } 30 | } 31 | 32 | override fun stopUpdates() { 33 | listener.onStopListening() 34 | locationManager.removeGpsStatusListener(callback) 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout-sw600dp/fragment_graphs.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 14 | 15 | 16 | 17 | 21 | 22 | 25 | 26 | 30 | 31 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /studio/base/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 17 | 18 | 24 | 25 | 31 | 32 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_satellite_low.xml: -------------------------------------------------------------------------------- 1 | 6 | 15 | 24 | 33 | 34 | -------------------------------------------------------------------------------- /studio/service/src/main/java/nl/sogeti/android/gpstracker/service/logger/PowerManager.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.service.logger; 2 | 3 | import android.content.Context; 4 | 5 | import nl.sogeti.android.gpstracker.service.integration.ServiceConstants; 6 | 7 | class PowerManager { 8 | 9 | private static final String TAG = "WakeLockTag"; 10 | private final Context mContext; 11 | private android.os.PowerManager.WakeLock mWakeLock; 12 | 13 | PowerManager(Context context) { 14 | this.mContext = context; 15 | } 16 | 17 | public void updateWakeLock(int loggingState) { 18 | if (loggingState == ServiceConstants.STATE_LOGGING) { 19 | android.os.PowerManager pm = (android.os.PowerManager) mContext.getSystemService(Context.POWER_SERVICE); 20 | if (this.mWakeLock != null) { 21 | this.mWakeLock.release(); 22 | this.mWakeLock = null; 23 | } 24 | this.mWakeLock = pm.newWakeLock(android.os.PowerManager.PARTIAL_WAKE_LOCK, TAG); 25 | this.mWakeLock.acquire(); 26 | } else { 27 | if (this.mWakeLock != null) { 28 | this.mWakeLock.release(); 29 | this.mWakeLock = null; 30 | } 31 | } 32 | } 33 | 34 | public void release() { 35 | if (this.mWakeLock != null) { 36 | this.mWakeLock.release(); 37 | this.mWakeLock = null; 38 | } 39 | } 40 | 41 | @Override 42 | protected void finalize() throws Throwable { 43 | super.finalize(); 44 | if (mWakeLock != null) { 45 | mWakeLock.release(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /studio/features/src/test/java/nl/sogeti/android/gpstracker/ng/features/databinding/FeaturesBindingComponentTest.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.databinding 2 | 3 | import org.hamcrest.CoreMatchers.`is` 4 | import org.hamcrest.CoreMatchers.notNullValue 5 | import org.hamcrest.MatcherAssert.assertThat 6 | import org.junit.Before 7 | import org.junit.Test 8 | 9 | class FeaturesBindingComponentTest { 10 | 11 | lateinit var sut: FeaturesBindingComponent 12 | 13 | @Before 14 | fun setUp() { 15 | sut = FeaturesBindingComponent() 16 | } 17 | 18 | @Test 19 | fun getCommonBindingAdapters() { 20 | // Act 21 | val adapter = sut.commonBindingAdapters 22 | // Assert 23 | assertThat(adapter, `is`(notNullValue())) 24 | } 25 | 26 | @Test 27 | fun getRecordingBindingAdapters() { 28 | // Act 29 | val adapter = sut.recordingBindingAdapters 30 | // Assert 31 | assertThat(adapter, `is`(notNullValue())) 32 | } 33 | 34 | @Test 35 | fun getControlBindingAdapters() { 36 | // Act 37 | val adapter = sut.controlBindingAdapters 38 | // Assert 39 | assertThat(adapter, `is`(notNullValue())) 40 | } 41 | 42 | @Test 43 | fun getTracksBindingAdapters() { 44 | // Act 45 | val adapter = sut.trackTypesBindingAdapters 46 | // Assert 47 | assertThat(adapter, `is`(notNullValue())) 48 | } 49 | 50 | @Test 51 | fun getTrackTypesBindingAdapters() { 52 | // Act 53 | val adapter = sut.trackTypesBindingAdapters 54 | // Assert 55 | assertThat(adapter, `is`(notNullValue())) 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /studio/wear/src/main/java/nl/sogeti/android/gpstracker/v2/wear/HolderFragment.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.v2.wear 2 | 3 | import android.app.Activity 4 | import android.app.Fragment 5 | import android.content.Context 6 | import android.os.Bundle 7 | import androidx.annotation.CallSuper 8 | 9 | /** 10 | * A stripped replacement for HolderFragment found in ArchComponents 11 | */ 12 | class HolderFragment : Fragment() { 13 | 14 | var holding: Holdable? = null 15 | 16 | override fun onCreate(savedInstanceState: Bundle?) { 17 | super.onCreate(savedInstanceState) 18 | retainInstance = true 19 | } 20 | 21 | override fun onDestroy() { 22 | holding?.onCleared() 23 | super.onDestroy() 24 | } 25 | 26 | companion object { 27 | 28 | const val TAG = "HolderFragment" 29 | 30 | fun of(activity: Activity, type: Class): T { 31 | val holdable: T 32 | var holderFragment = activity.fragmentManager.findFragmentByTag(HolderFragment.TAG) 33 | if (holderFragment == null) { 34 | holderFragment = HolderFragment() 35 | holdable = type.getConstructor(Context::class.java).newInstance(activity.applicationContext) 36 | holderFragment.holding = holdable 37 | activity.fragmentManager.beginTransaction() 38 | .add(holderFragment, HolderFragment.TAG) 39 | .commit() 40 | } else { 41 | holdable = (holderFragment as HolderFragment).holding as T 42 | } 43 | 44 | return holdable 45 | } 46 | } 47 | 48 | interface Holdable { 49 | @CallSuper 50 | fun onCleared() { 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout/fragment_map.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 15 | 16 | 17 | 18 | 21 | 22 | 29 | 30 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /studio/features/src/test/java/nl/sogeti/android/gpstracker/ng/features/summary/SummaryCalculatorTest.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.summary 30 | 31 | class SummaryCalculatorTest { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /studio/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 32 | 33 | OGT NG 34 | 35 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/graphs/widgets/GraphPoint.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: René de Groot 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.graphs.widgets 30 | 31 | data class GraphPoint(val x: Float, val y: Float) 32 | -------------------------------------------------------------------------------- /studio/app/src/develop/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 32 | 33 | OGT - DEV 34 | 35 | -------------------------------------------------------------------------------- /studio/app/src/mock/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 32 | 33 | OGT - MOCK 34 | 35 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/trackedit/TrackTypeSpinnerAdapter.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.trackedit 2 | 3 | import android.content.Context 4 | import androidx.appcompat.content.res.AppCompatResources 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import android.widget.BaseAdapter 9 | import nl.sogeti.android.opengpstrack.ng.features.R 10 | 11 | class TrackTypeSpinnerAdapter(val context: Context, var trackTypes: List) : BaseAdapter() { 12 | override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { 13 | val viewHolder: TrackEditPresenter.ViewHolder 14 | val itemView: View 15 | if (convertView == null) { 16 | itemView = LayoutInflater.from(context).inflate(R.layout.row_track_type, parent, false) 17 | viewHolder = TrackEditPresenter.ViewHolder( 18 | itemView.findViewById(R.id.row_track_type_image), 19 | itemView.findViewById(R.id.row_track_type_text)) 20 | itemView.tag = viewHolder 21 | } else { 22 | itemView = convertView 23 | viewHolder = convertView.tag as TrackEditPresenter.ViewHolder 24 | } 25 | val trackType = trackTypes[position] 26 | viewHolder.textView.text = context.getString(trackType.stringId) 27 | context.let { viewHolder.imageView.setImageDrawable(AppCompatResources.getDrawable(it, trackType.drawableId)) } 28 | 29 | return itemView 30 | } 31 | 32 | override fun getItem(position: Int): TrackTypeDescriptions.TrackType = trackTypes[position] 33 | 34 | override fun getItemId(position: Int): Long = trackTypes[position].drawableId.toLong() 35 | 36 | override fun getCount() = trackTypes.size 37 | } 38 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/util/LoggingStateBroadcastReceiver.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.util 2 | 3 | import android.content.BroadcastReceiver 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.net.Uri 7 | import nl.sogeti.android.gpstracker.service.integration.ServiceConstants 8 | import timber.log.Timber 9 | import javax.inject.Inject 10 | import javax.inject.Named 11 | 12 | abstract class LoggingStateBroadcastReceiver : BroadcastReceiver() { 13 | 14 | @Inject 15 | @field:Named("stateBroadcastAction") 16 | lateinit var stateAction: String 17 | 18 | override fun onReceive(context: Context, intent: Intent) { 19 | if (intent.action == stateAction) { 20 | onStateReceive(context, intent) 21 | } 22 | } 23 | 24 | private fun onStateReceive(context: Context, intent: Intent) { 25 | val state = intent.getIntExtra(ServiceConstants.EXTRA_LOGGING_STATE, ServiceConstants.STATE_UNKNOWN) 26 | if (intent.hasExtra(ServiceConstants.EXTRA_TRACK)) { 27 | val trackUri: Uri = intent.getParcelableExtra(ServiceConstants.EXTRA_TRACK) 28 | when (state) { 29 | ServiceConstants.STATE_LOGGING -> didStartLogging(context, trackUri) 30 | ServiceConstants.STATE_PAUSED -> didPauseLogging(context, trackUri) 31 | ServiceConstants.STATE_STOPPED -> didStopLogging(context) 32 | } 33 | } else { 34 | Timber.e("Failed to handle state change $intent") 35 | onError(context) 36 | } 37 | } 38 | 39 | abstract fun didStopLogging(context: Context) 40 | 41 | abstract fun didPauseLogging(context: Context, trackUri: Uri) 42 | 43 | abstract fun didStartLogging(context: Context, trackUri: Uri) 44 | 45 | abstract fun onError(context: Context) 46 | } 47 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/model/WearMessage.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: René de Groot 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.v2.sharedwear.model 30 | 31 | import com.google.android.gms.wearable.DataMap 32 | 33 | abstract class WearMessage(val path: String) { 34 | abstract fun toDataMap(): DataMap 35 | } 36 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/dagger/SystemModule.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.dagger 2 | 3 | import android.content.ContentResolver 4 | import android.content.Context 5 | import android.content.pm.PackageManager 6 | import android.net.Uri 7 | import android.os.AsyncTask 8 | import dagger.Module 9 | import dagger.Provides 10 | import nl.sogeti.android.gpstracker.ng.base.location.GpsLocationFactory 11 | import nl.sogeti.android.gpstracker.ng.base.location.LocationFactory 12 | import nl.sogeti.android.gpstracker.ng.common.controllers.gpsstatus.GpsStatusControllerFactory 13 | import java.util.concurrent.Executor 14 | import java.util.concurrent.LinkedBlockingQueue 15 | import java.util.concurrent.ThreadPoolExecutor 16 | import java.util.concurrent.TimeUnit 17 | import javax.inject.Singleton 18 | 19 | @Module 20 | class SystemModule { 21 | 22 | @Provides 23 | fun gpsStatusControllerFactory(application: Context): GpsStatusControllerFactory { 24 | return GpsStatusControllerFactory(application) 25 | } 26 | 27 | @Provides 28 | fun uriBuilder() = Uri.Builder() 29 | 30 | @Provides 31 | @Singleton 32 | @Computation 33 | fun computationExecutor(): Executor = AsyncTask.THREAD_POOL_EXECUTOR 34 | 35 | @Provides 36 | @Singleton 37 | @DiskIO 38 | fun diskExecutor(): Executor = ThreadPoolExecutor(1, 2, 10L, TimeUnit.SECONDS, LinkedBlockingQueue()) 39 | 40 | @Provides 41 | @Singleton 42 | @NetworkIO 43 | fun networkExecutor(): Executor = ThreadPoolExecutor(1, 16, 30L, TimeUnit.SECONDS, LinkedBlockingQueue()) 44 | 45 | @Provides 46 | fun packageManager(application: Context): PackageManager = application.packageManager 47 | 48 | @Provides 49 | fun locationFactory(application: Context): LocationFactory = GpsLocationFactory(application) 50 | 51 | @Provides 52 | fun contentResolver(application: Context): ContentResolver = application.contentResolver 53 | } 54 | -------------------------------------------------------------------------------- /studio/app/src/androidTestMock/java/nl/sogeti/android/gpstracker/ng/util/EspressoTestMatchers.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: René de Groot 4 | ** Copyright: (c) 2016 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.util; 30 | 31 | import android.view.View; 32 | import org.hamcrest.Matcher; 33 | 34 | public class EspressoTestMatchers { 35 | 36 | public static Matcher withDrawable(final int resourceId) { 37 | return new DrawableMatcher(resourceId); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /studio/base/src/test/java/nl/sogeti/android/gpstracker/ng/base/common/controllers/gpsstatus/GpsStatusControllerFactoryTest.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.common.controllers.gpsstatus 2 | 3 | import android.content.Context 4 | import android.os.Build 5 | import nl.sogeti.android.gpstracker.ng.common.controllers.gpsstatus.GpsStatusControllerFactory 6 | import nl.sogeti.android.gpstracker.ng.common.controllers.gpsstatus.GpsStatusControllerImpl 7 | import org.hamcrest.Matchers.`is` 8 | import org.hamcrest.Matchers.instanceOf 9 | import org.junit.Assert.assertThat 10 | import org.junit.Before 11 | import org.junit.Rule 12 | import org.junit.Test 13 | import org.mockito.Mock 14 | import org.mockito.junit.MockitoJUnit 15 | 16 | class GpsStatusControllerFactoryTest { 17 | 18 | lateinit var sut: GpsStatusControllerFactory 19 | @get:Rule 20 | var mockitoRule = MockitoJUnit.rule() 21 | @Mock 22 | lateinit var context: Context 23 | @Mock 24 | lateinit var listener: GpsStatusController.Listener 25 | 26 | @Before 27 | fun setUp() { 28 | sut = GpsStatusControllerFactory(context) 29 | } 30 | 31 | @Test 32 | fun createNougatController() { 33 | // Act 34 | val controller = sut.createGpsStatusController(context, listener, Build.VERSION_CODES.N) 35 | // Assert 36 | assertThat(controller, `is`(instanceOf(GnnsStatusControllerImpl::class.java))) 37 | } 38 | 39 | @Test 40 | fun createPreNougatController() { 41 | // Act 42 | val controller = sut.createGpsStatusController(context, listener, Build.VERSION_CODES.M) 43 | // Assert 44 | assertThat(controller, `is`(instanceOf(GpsStatusControllerImpl::class.java))) 45 | } 46 | 47 | @Test 48 | fun createDefaultController() { 49 | // Act 50 | val controller = sut.createGpsStatusController(listener) 51 | // Assert 52 | assertThat(controller, `is`(instanceOf(GpsStatusControllerImpl::class.java))) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /studio/features/src/main/res/layout/fragment_tracklist.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 30 | 31 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /studio/base/src/mock/java/nl/sogeti/android/gpstracker/ng/dagger/MockAppComponent.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.dagger 30 | 31 | import dagger.Component 32 | import nl.sogeti.android.gpstracker.ng.base.dagger.AppComponent 33 | import nl.sogeti.android.gpstracker.ng.base.dagger.AppModule 34 | import javax.inject.Singleton 35 | 36 | @Singleton 37 | @Component(modules = [AppModule::class, MockSystemModule::class]) 38 | interface MockAppComponent : AppComponent 39 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/trackdelete/TrackDeleteModel.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2016 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.trackdelete 30 | 31 | import androidx.databinding.ObservableBoolean 32 | import androidx.databinding.ObservableField 33 | import android.net.Uri 34 | 35 | class TrackDeleteModel { 36 | val trackUri = ObservableField() 37 | val name = ObservableField("") 38 | val dismiss = ObservableBoolean(false) 39 | } 40 | -------------------------------------------------------------------------------- /studio/utils/src/main/java/nl/sogeti/android/gpstracker/utils/FragmentResultLambda.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.utils 30 | 31 | import android.os.Bundle 32 | import androidx.fragment.app.Fragment 33 | 34 | 35 | class FragmentResultLambda : Fragment() { 36 | 37 | var resultLambda: (T) -> Unit = {} 38 | 39 | override fun onCreate(savedInstanceState: Bundle?) { 40 | super.onCreate(savedInstanceState) 41 | retainInstance = true 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /studio/service/src/mock/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 25 | 26 | 27 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/tracklist/TrackListViewModel.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2016 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.tracklist 30 | 31 | import androidx.databinding.ObservableField 32 | import androidx.databinding.ObservableInt 33 | import android.net.Uri 34 | 35 | class TrackListViewModel { 36 | val tracks = ObservableField>(emptyList()) 37 | val selectedTrack = ObservableField() 38 | val focusPosition = ObservableInt(-1) 39 | } 40 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/model/TrackSelection.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: René de Groot 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.model 30 | 31 | import androidx.lifecycle.MutableLiveData 32 | import android.net.Uri 33 | import nl.sogeti.android.gpstracker.ng.features.dagger.FeatureScope 34 | import javax.inject.Inject 35 | 36 | @FeatureScope 37 | class TrackSelection @Inject constructor() { 38 | 39 | val selection: MutableLiveData = MutableLiveData() 40 | 41 | } 42 | -------------------------------------------------------------------------------- /studio/base/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-kapt' 4 | 5 | android { 6 | compileSdkVersion rootProject.targetSdk 7 | buildToolsVersion rootProject.buildTools 8 | 9 | defaultConfig { 10 | minSdkVersion rootProject.minSdk 11 | targetSdkVersion rootProject.targetSdk 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 16 | } 17 | 18 | dataBinding { 19 | enabled = true 20 | } 21 | 22 | lintOptions { 23 | abortOnError false 24 | } 25 | 26 | testOptions { 27 | unitTests.returnDefaultValues = true 28 | } 29 | 30 | apply from: '../flavors.gradle' 31 | 32 | buildTypes { 33 | release { 34 | minifyEnabled false 35 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 36 | } 37 | } 38 | 39 | } 40 | 41 | configurations.all { 42 | resolutionStrategy { 43 | } 44 | } 45 | 46 | dependencies { 47 | implementation fileTree(dir: 'libs', include: ['*.jar']) 48 | 49 | implementation libraries.kotlin.stdlib 50 | implementation libraries.android.lifecycle 51 | implementation libraries.square.timber 52 | implementation libraries.android.appcompat 53 | implementation libraries.google.firebasecore 54 | implementation(libraries.google.crashlytics) { 55 | transitive = true 56 | } 57 | implementation libraries.google.dagger 58 | implementation libraries.square.leakcanary 59 | // implementation libraries.square.leakcanarynoop 60 | 61 | testImplementation libraries.test.junit 62 | testImplementation libraries.test.mockito_core 63 | testImplementation libraries.test.hamcrest_library 64 | 65 | androidTestImplementation libraries.androidtest.runner 66 | androidTestImplementation libraries.androidtest.espresso_core 67 | 68 | kapt libraries.google.daggercompiler 69 | kapt libraries.android.databindingcompiler 70 | } 71 | -------------------------------------------------------------------------------- /studio/features/src/main/res/drawable/ic_satellite_medium.xml: -------------------------------------------------------------------------------- 1 | 7 | 16 | 25 | 34 | 43 | 44 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/map/rendering/TrackTileProviderFactory.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: René de Groot 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.map.rendering 30 | 31 | import android.content.Context 32 | import androidx.databinding.ObservableField 33 | import nl.sogeti.android.gpstracker.ng.base.location.LatLng 34 | 35 | class TrackTileProviderFactory { 36 | 37 | fun createTrackTileProvider(context: Context, waypoints: ObservableField>?>) = TrackTileProvider(context, waypoints) 38 | } 39 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/map/TrackReaderFactory.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: René de Groot 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.map 30 | 31 | import android.net.Uri 32 | import com.google.android.gms.maps.model.LatLngBounds 33 | import nl.sogeti.android.gpstracker.ng.base.location.LatLng 34 | 35 | class TrackReaderFactory { 36 | 37 | fun createTrackReader(trackUri: Uri, action: (String, LatLngBounds, List>) -> Unit): TrackReader { 38 | return TrackReader(trackUri, action) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /studio/wear-shared/src/main/java/nl/sogeti/android/gpstracker/v2/sharedwear/util/TimeSpanCalculator.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.v2.sharedwear.util 30 | 31 | import android.text.format.DateUtils 32 | import java.util.* 33 | 34 | class TimeSpanCalculator { 35 | 36 | private var referenceTime = Calendar.getInstance() 37 | 38 | fun getRelativeTimeSpanString(timestamp: Long): CharSequence { 39 | return DateUtils.getRelativeTimeSpanString(timestamp, referenceTime.timeInMillis, DateUtils.MINUTE_IN_MILLIS) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /studio/app/src/androidTestMock/java/nl/sogeti/android/gpstracker/ng/util/IdlingMapResource.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.util 2 | 3 | import androidx.test.espresso.IdlingResource 4 | import com.google.android.gms.maps.GoogleMap 5 | import com.google.android.gms.maps.MapView 6 | import nl.sogeti.android.gpstracker.ng.base.common.onMainThread 7 | import timber.log.Timber 8 | 9 | class IdlingMapResource(map: MapView) : IdlingResource, GoogleMap.OnCameraIdleListener, GoogleMap.OnCameraMoveListener, GoogleMap.OnMapLoadedCallback { 10 | 11 | private var isMapLoaded = true 12 | private var isCameraIdle = true 13 | private var googleMap: GoogleMap? = null 14 | private var callback: IdlingResource.ResourceCallback? = null 15 | 16 | init { 17 | onMainThread { 18 | map.getMapAsync { 19 | googleMap = it 20 | it.setOnCameraIdleListener(this) 21 | it.setOnCameraMoveListener(this) 22 | it.setOnMapLoadedCallback(this) 23 | } 24 | Timber.d("IdlingMapResource started") 25 | } 26 | } 27 | 28 | override fun getName(): String = "MapResource" 29 | 30 | override fun isIdleNow(): Boolean { 31 | Timber.d("Is idle camera $isCameraIdle && loaded $isMapLoaded") 32 | return googleMap != null && isCameraIdle && isMapLoaded 33 | } 34 | 35 | override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) { 36 | this.callback = callback 37 | } 38 | 39 | override fun onCameraIdle() { 40 | Timber.d("onCameraIdle()") 41 | isCameraIdle = true 42 | if (isIdleNow) { 43 | Timber.d("Became idle") 44 | callback?.onTransitionToIdle() 45 | } 46 | } 47 | 48 | override fun onCameraMove() { 49 | isCameraIdle = false 50 | } 51 | 52 | override fun onMapLoaded() { 53 | Timber.d("onMapLoaded()") 54 | isMapLoaded = true 55 | if (isIdleNow) { 56 | Timber.d("Became idle") 57 | callback?.onTransitionToIdle() 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/control/ControlViewModel.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2016 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.control 30 | 31 | import androidx.databinding.BaseObservable 32 | import androidx.databinding.ObservableBoolean 33 | import androidx.databinding.ObservableInt 34 | import nl.sogeti.android.gpstracker.service.integration.ServiceConstants.STATE_UNKNOWN 35 | 36 | class ControlViewModel : BaseObservable() { 37 | 38 | val enabled = ObservableBoolean(true) 39 | val state = ObservableInt(STATE_UNKNOWN) 40 | } 41 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/graphs/dataproviders/SpeedRangePicker.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.features.graphs.dataproviders 2 | 3 | import android.content.Context 4 | import nl.sogeti.android.gpstracker.ng.features.FeatureConfiguration 5 | import nl.sogeti.android.gpstracker.ng.features.graphs.GraphSpeedConverter 6 | import nl.sogeti.android.gpstracker.v2.sharedwear.R 7 | import nl.sogeti.android.gpstracker.v2.sharedwear.util.getFloat 8 | import javax.inject.Inject 9 | 10 | class SpeedRangePicker(private val inverseSpeed: Boolean) { 11 | 12 | @Inject 13 | lateinit var graphSpeedConverter: GraphSpeedConverter 14 | 15 | init { 16 | FeatureConfiguration.featureComponent.inject(this) 17 | } 18 | 19 | fun prettyMinYValue(context: Context, yValue: Float): Float = 20 | if (inverseSpeed) { 21 | lowerBoundForInverseValue(yValue) 22 | } else { 23 | lowerBoundForValue(context, yValue) 24 | } 25 | 26 | fun prettyMaxYValue(context: Context, yValue: Float) = 27 | if (inverseSpeed) { 28 | upperBoundForInverseValue(yValue) 29 | } else { 30 | upperBoundForValue(context, yValue) 31 | } 32 | 33 | private fun lowerBoundForValue(context: Context, yValue: Float): Float { 34 | val conversion = context.resources.getFloat(nl.sogeti.android.gpstracker.v2.sharedwear.R.string.mps_to_speed) 35 | val speed = yValue * conversion 36 | return (10 * (speed.toInt() / 10)) / conversion 37 | } 38 | 39 | private fun upperBoundForValue(context: Context, yValue: Float): Float { 40 | val conversion = context.resources.getFloat(R.string.mps_to_speed) 41 | val speed = yValue * conversion 42 | return (10 * (1 + speed.toInt() / 10)) / conversion 43 | } 44 | 45 | private fun lowerBoundForInverseValue(yValue: Float): Float { 46 | return yValue.toInt().toFloat() 47 | } 48 | 49 | private fun upperBoundForInverseValue(yValue: Float) = 50 | (1 + yValue.toInt()).toFloat() 51 | 52 | } 53 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/map/rendering/Point.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2016 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.map.rendering; 30 | 31 | class Point { 32 | double x, y; 33 | 34 | Point() { 35 | } 36 | 37 | Point(double x, double y) { 38 | this.x = x; 39 | this.y = y; 40 | } 41 | 42 | Point(Point previous) { 43 | this(previous.x, previous.y); 44 | } 45 | 46 | double squaredDistanceTo(Point other) { 47 | return Math.abs(x - other.x) + Math.abs(y - other.y); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /studio/base/src/mock/java/nl/sogeti/android/gpstracker/ng/mock/MockLocationFactory.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: René de Groot 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.mock 30 | 31 | import nl.sogeti.android.gpstracker.ng.base.location.LatLng 32 | import nl.sogeti.android.gpstracker.ng.base.location.LocationFactory 33 | 34 | class MockLocationFactory : LocationFactory { 35 | 36 | override fun getLocationCoordinates(): LatLng? = lastWaypoint 37 | 38 | override fun getLocationName(): String? = "Gotham" 39 | 40 | companion object { 41 | var lastWaypoint = LatLng(52.3664734, 4.9212022) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/common/controllers/content/ContentController.kt: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.ng.base.common.controllers.content 2 | 3 | import android.content.Context 4 | import android.net.Uri 5 | import android.os.Handler 6 | import android.os.Looper 7 | import javax.inject.Inject 8 | 9 | /** 10 | * Control the observing and monitoring for a observable uri content. 11 | */ 12 | class ContentController @Inject constructor(private val context: Context) { 13 | 14 | private var listener: Listener? = null 15 | 16 | private val contentObserver = ContentObserver() 17 | 18 | fun registerObserver(listener: Listener, toUri: Uri?) { 19 | contentObserver.unregister() 20 | this.listener = listener 21 | contentObserver.register(toUri) 22 | } 23 | 24 | fun unregisterObserver() { 25 | contentObserver.unregister() 26 | this.listener = null 27 | } 28 | 29 | private inner class ContentObserver : android.database.ContentObserver(Handler(Looper.getMainLooper())) { 30 | 31 | private var registeredUri: Uri? = null 32 | 33 | fun register(uri: Uri?) { 34 | unregister() 35 | registeredUri = uri 36 | if (uri != null && uri.lastPathSegment != NO_CONTENT_ID.toString()) { 37 | context.contentResolver.registerContentObserver(uri, true, this) 38 | } 39 | } 40 | 41 | fun unregister() { 42 | val uri = registeredUri 43 | if (uri != null && uri.lastPathSegment != NO_CONTENT_ID.toString()) { 44 | context.contentResolver.unregisterContentObserver(contentObserver) 45 | registeredUri = null 46 | } 47 | } 48 | 49 | override fun onChange(selfChange: Boolean, changedUri: Uri) { 50 | registeredUri?.let { 51 | listener?.onChangeUriContent(it, changedUri) 52 | } 53 | 54 | } 55 | } 56 | 57 | interface Listener { 58 | fun onChangeUriContent(contentUri: Uri, changesUri: Uri) 59 | } 60 | 61 | companion object { 62 | const val NO_CONTENT_ID = -1L 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/gpximport/ImportTrackTypeModel.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.gpximport 30 | 31 | import androidx.databinding.ObservableBoolean 32 | import androidx.databinding.ObservableInt 33 | import android.widget.AdapterView 34 | import nl.sogeti.android.gpstracker.ng.features.trackedit.TrackTypeDescriptions 35 | 36 | class ImportTrackTypeModel { 37 | val selectedPosition = ObservableInt(AdapterView.INVALID_POSITION) 38 | val trackTypes = TrackTypeDescriptions.allTrackTypes 39 | val dismiss = ObservableBoolean(false) 40 | } 41 | -------------------------------------------------------------------------------- /studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/track/TrackViewModel.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.features.track 30 | 31 | import androidx.databinding.ObservableField 32 | import androidx.databinding.ObservableInt 33 | import android.net.Uri 34 | import nl.sogeti.android.opengpstrack.ng.features.R 35 | 36 | class TrackViewModel { 37 | 38 | val trackUri: ObservableField = ObservableField() 39 | val name = ObservableField("") 40 | val trackIcon = ObservableInt(R.drawable.ic_track_type_default) 41 | val isEditable: Boolean 42 | get() = trackUri.get() != null 43 | } 44 | -------------------------------------------------------------------------------- /studio/base/src/main/java/nl/sogeti/android/gpstracker/ng/base/dagger/AppModule.kt: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.ng.base.dagger 30 | 31 | import android.app.Application 32 | import android.content.Context 33 | import dagger.Module 34 | import dagger.Provides 35 | import java.text.SimpleDateFormat 36 | import java.util.* 37 | import javax.inject.Named 38 | 39 | @Module 40 | class AppModule(val application: Application) { 41 | 42 | @Provides 43 | @Named("dayFormatter") 44 | fun dayFormatter() = SimpleDateFormat("EEEE", Locale.getDefault()) 45 | 46 | @Provides 47 | fun applicationContext(): Context = application 48 | 49 | } 50 | --------------------------------------------------------------------------------