From 54df02bfcd0d4008177dfc65116b82095a8146be Mon Sep 17 00:00:00 2001 From: Camille019 Date: Mon, 22 Apr 2019 11:11:14 +0200 Subject: [PATCH 01/22] Fix Timer countdown rounding issue --- .../mytargets/shared/base/fragment/TimerFragmentBase.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/src/main/java/de/dreier/mytargets/shared/base/fragment/TimerFragmentBase.kt b/shared/src/main/java/de/dreier/mytargets/shared/base/fragment/TimerFragmentBase.kt index a3c4f38b1..830e1c61f 100644 --- a/shared/src/main/java/de/dreier/mytargets/shared/base/fragment/TimerFragmentBase.kt +++ b/shared/src/main/java/de/dreier/mytargets/shared/base/fragment/TimerFragmentBase.kt @@ -107,10 +107,10 @@ abstract class TimerFragmentBase : Fragment(), View.OnClickListener { applyTime("") } else { val offset = getOffset(status) - countdown = object : CountDownTimer((getDuration(status) * 1000).toLong(), 100) { + countdown = object : CountDownTimer((getDuration(status) * 1000).toLong(), 1000) { override fun onTick(millisUntilFinished: Long) { - val text = (millisUntilFinished / 1000 + offset).toString() - applyTime(text) + val countdown = offset + Math.ceil(millisUntilFinished / 1000.0).toInt() + applyTime(countdown.toString()) } override fun onFinish() { From 7c4c35dcddf8ed66559d69dba839d782b800b79d Mon Sep 17 00:00:00 2001 From: Camille019 Date: Mon, 22 Apr 2019 11:17:25 +0200 Subject: [PATCH 02/22] Add a missing import in ApplicationInstance.kt --- app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt b/app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt index d36031d48..657e9965e 100644 --- a/app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt +++ b/app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt @@ -16,6 +16,7 @@ package de.dreier.mytargets.app import android.arch.persistence.room.Room +import android.arch.persistence.room.RoomDatabase import android.content.Context import android.content.SharedPreferences import android.content.res.Configuration From a387f51efdf760af15dda1c864e0be1e61902ccf Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 1 Aug 2018 22:17:55 +0200 Subject: [PATCH 03/22] AndroidX Refactoring --- .idea/kotlinc.xml | 4 +- app/build.gradle | 43 ++-- app/src/androidTest/AndroidManifest.xml | 2 +- .../de/dreier/mytargets/app/MigrationTest.kt | 18 +- .../de/dreier/mytargets/dao/ArrowDAOTest.kt | 2 +- .../de/dreier/mytargets/dao/DAOTestBase.kt | 4 +- .../de/dreier/mytargets/dao/EndDAOTest.kt | 2 +- .../features/arrow/ArrowSelectorTest.kt | 16 +- .../mytargets/features/arrow/EditArrowTest.kt | 12 +- .../mytargets/features/bow/BowSelectorTest.kt | 16 +- .../features/bow/EditSightMarksTest.kt | 14 +- .../features/main/IntroActivityTest.kt | 10 +- .../features/main/MainActivityTest.kt | 24 +- .../features/settings/SettingsActivityTest.kt | 22 +- .../features/settings/SettingsManagerTest.kt | 6 +- .../features/statistics/ExportTest.kt | 4 +- .../statistics/StatisticsActivityTest.kt | 14 +- .../mytargets/features/training/DeleteTest.kt | 22 +- .../training/EditTrainingActivityTest.kt | 20 +- .../training/ScoreboardActivityTest.kt | 20 +- .../features/training/TrainingActivityTest.kt | 12 +- .../training/input/InputActivityTest.kt | 12 +- .../EditStandardRoundActivityTest.kt | 20 +- .../StandardRoundActivityTest.kt | 18 +- .../dreier/mytargets/test/base/UITestBase.kt | 35 +-- .../mytargets/test/utils/PermissionGranter.kt | 10 +- .../test/utils/actions/LowLevelActions.kt | 12 +- .../utils/actions/NestedScrollToAction.kt | 14 +- .../test/utils/actions/TargetViewActions.kt | 10 +- .../assertions/RecyclerViewAssertions.kt | 8 +- .../utils/assertions/TargetViewAssertions.kt | 2 +- .../test/utils/matchers/IntentMatcher.kt | 6 +- .../test/utils/matchers/MatcherUtils.kt | 12 +- .../test/utils/matchers/ParentViewMatcher.kt | 2 +- .../utils/matchers/RecyclerViewMatcher.kt | 4 +- .../test/utils/matchers/ViewMatcher.kt | 16 +- .../test/utils/rules/DbTestRuleBase.kt | 2 +- .../test/utils/rules/SimpleDbTestRule.kt | 2 +- .../mytargets/screengrab/ScreenshotTest.kt | 12 +- app/src/main/AndroidManifest.xml | 2 +- .../widget/RebindReportingHolder.kt | 14 +- .../mytargets/app/ApplicationInstance.kt | 6 +- .../base/activities/ChildActivityBase.kt | 4 +- .../activities/SimpleFragmentActivityBase.kt | 6 +- .../base/adapters/ListAdapterBase.kt | 2 +- .../dynamicitem/DynamicItemAdapter.kt | 8 +- .../adapters/dynamicitem/DynamicItemHolder.kt | 4 +- .../dreier/mytargets/base/db/AppDatabase.kt | 2 +- .../mytargets/base/db/RoundRepository.kt | 1 + .../mytargets/base/db/TrainingRepository.kt | 2 +- .../dreier/mytargets/base/db/dao/ArrowDAO.kt | 4 +- .../de/dreier/mytargets/base/db/dao/BowDAO.kt | 2 +- .../mytargets/base/db/dao/DimensionDAO.kt | 6 +- .../de/dreier/mytargets/base/db/dao/EndDAO.kt | 2 +- .../dreier/mytargets/base/db/dao/ImageDAO.kt | 4 +- .../dreier/mytargets/base/db/dao/RoundDAO.kt | 4 +- .../mytargets/base/db/dao/SignatureDAO.kt | 2 +- .../mytargets/base/db/dao/StandardRoundDAO.kt | 2 +- .../mytargets/base/db/dao/TrainingDAO.kt | 4 +- .../base/db/migrations/Migration10.kt | 4 +- .../base/db/migrations/Migration11.kt | 4 +- .../base/db/migrations/Migration12.kt | 4 +- .../base/db/migrations/Migration13.kt | 4 +- .../base/db/migrations/Migration14.kt | 4 +- .../base/db/migrations/Migration15.kt | 4 +- .../base/db/migrations/Migration16.kt | 4 +- .../base/db/migrations/Migration17.kt | 4 +- .../base/db/migrations/Migration18.kt | 4 +- .../base/db/migrations/Migration19.kt | 4 +- .../base/db/migrations/Migration2.kt | 4 +- .../base/db/migrations/Migration20.kt | 4 +- .../base/db/migrations/Migration21.kt | 4 +- .../base/db/migrations/Migration22.kt | 4 +- .../base/db/migrations/Migration23.kt | 4 +- .../base/db/migrations/Migration24.kt | 4 +- .../base/db/migrations/Migration25.kt | 4 +- .../base/db/migrations/Migration26.kt | 4 +- .../base/db/migrations/Migration3.kt | 4 +- .../base/db/migrations/Migration4.kt | 4 +- .../base/db/migrations/Migration5.kt | 4 +- .../base/db/migrations/Migration6.kt | 4 +- .../base/db/migrations/Migration7.kt | 4 +- .../base/db/migrations/Migration8.kt | 4 +- .../base/db/migrations/Migration9.kt | 4 +- .../db/migrations/RoomCreationCallback.kt | 4 +- .../db/typeconverters/BitmapConverters.kt | 2 +- .../db/typeconverters/DimensionConverter.kt | 2 +- .../db/typeconverters/EBowTypeConverters.kt | 2 +- .../db/typeconverters/EWeatherConverters.kt | 2 +- .../db/typeconverters/LocalDateConverters.kt | 2 +- .../db/typeconverters/LocalTimeConverters.kt | 2 +- .../db/typeconverters/ThumbnailConverters.kt | 2 +- .../fragments/EditWithImageFragmentBase.kt | 14 +- .../fragments/EditableListFragmentBase.kt | 4 +- .../mytargets/base/fragments/FragmentBase.kt | 12 +- .../base/fragments/ItemActionModeCallback.kt | 6 +- .../base/fragments/SelectItemFragmentBase.kt | 4 +- .../SelectPureListItemFragmentBase.kt | 2 +- .../mytargets/base/gallery/CustomViewPager.kt | 2 +- .../mytargets/base/gallery/GalleryActivity.kt | 10 +- .../base/gallery/HorizontalImageViewHolder.kt | 2 +- .../adapters/HorizontalListAdapters.kt | 2 +- .../base/gallery/adapters/ViewPagerAdapter.kt | 6 +- .../base/navigation/NavigationController.kt | 8 +- .../base/viewmodel/ViewModelFactory.kt | 4 +- .../features/arrows/ArrowListActivity.kt | 2 +- .../features/arrows/ArrowListFragment.kt | 4 +- .../features/arrows/ArrowListViewModel.kt | 2 +- .../features/arrows/EditArrowActivity.kt | 2 +- .../features/arrows/EditArrowFragment.kt | 4 +- .../features/arrows/EditArrowListFragment.kt | 8 +- .../features/arrows/EditArrowViewModel.kt | 16 +- .../features/bows/BowListActivity.kt | 2 +- .../features/bows/EditBowActivity.kt | 2 +- .../features/bows/EditBowFragment.kt | 2 +- .../features/bows/EditBowListFragment.kt | 4 +- .../features/distance/DistanceActivity.kt | 2 +- .../features/distance/DistanceFragment.kt | 4 +- .../features/distance/DistanceGridFragment.kt | 10 +- .../features/distance/DistanceInputDialog.kt | 2 +- .../distance/DistanceItemDecorator.kt | 5 +- .../DistanceTabsFragmentPagerAdapter.kt | 6 +- .../features/distance/DistancesViewModel.kt | 8 +- .../mytargets/features/help/HelpActivity.kt | 2 +- .../mytargets/features/help/HelpFragment.kt | 6 +- .../help/licences/LicencesActivity.kt | 2 +- .../help/licences/LicencesFragment.kt | 4 +- .../mytargets/features/main/IntroActivity.kt | 4 +- .../mytargets/features/main/MainActivity.kt | 12 +- .../features/rounds/EditRoundFragment.kt | 2 +- .../features/scoreboard/ScoreboardActivity.kt | 2 +- .../features/scoreboard/ScoreboardFragment.kt | 18 +- .../features/scoreboard/ScoreboardUtils.kt | 2 +- .../scoreboard/SignatureDialogFragment.kt | 2 +- .../scoreboard/layout/InfoTableBuilder.kt | 2 +- .../features/settings/DatePreference.kt | 2 +- .../DatePreferenceDialogFragmentCompat.kt | 8 +- .../features/settings/LanguagePreference.kt | 2 +- .../settings/ProfileSettingsFragment.kt | 4 +- .../features/settings/SettingsActivity.kt | 19 +- .../features/settings/SettingsFragmentBase.kt | 6 +- .../features/settings/SettingsManager.kt | 10 +- .../settings/TimerSettingsFragment.kt | 2 +- .../features/settings/about/AboutActivity.kt | 2 +- .../features/settings/about/AboutFragment.kt | 4 +- .../features/settings/about/DonateActivity.kt | 8 +- .../settings/about/DonationAdapter.kt | 2 +- .../features/settings/backup/BackupAdapter.kt | 2 +- .../settings/backup/BackupSettingsFragment.kt | 12 +- .../settings/backup/EBackupInterval.kt | 2 +- .../backup/provider/EBackupLocation.kt | 4 +- .../backup/provider/GoogleDriveBackup.kt | 16 +- .../backup/synchronization/SyncService.java | 78 ------ .../backup/synchronization/SyncService.kt | 82 ++++++ .../backup/synchronization/SyncUtils.kt | 4 +- .../statistics/DispersionPatternActivity.kt | 10 +- .../statistics/DispersionPatternUtils.kt | 2 +- .../features/statistics/StatisticsActivity.kt | 14 +- .../features/statistics/StatisticsFragment.kt | 8 +- .../mytargets/features/statistics/Tag.kt | 2 +- .../mytargets/features/timer/TimerActivity.kt | 8 +- .../mytargets/features/timer/TimerFragment.kt | 10 +- .../features/training/EditRoundActivity.kt | 2 +- .../features/training/RoundActivity.kt | 2 +- .../features/training/RoundFragment.kt | 6 +- .../features/training/TrainingActivity.kt | 2 +- .../training/details/TrainingFragment.kt | 8 +- .../training/details/TrainingViewModel.kt | 8 +- .../training/edit/DatePickerFragment.kt | 2 +- .../training/edit/EditTrainingActivity.kt | 2 +- .../training/edit/EditTrainingFragment.kt | 2 +- .../training/environment/Connectivity.kt | 5 +- .../environment/EnvironmentActivity.kt | 2 +- .../environment/EnvironmentFragment.kt | 4 +- .../features/training/environment/Locator.kt | 10 +- .../environment/WindDirectionActivity.kt | 2 +- .../environment/WindDirectionListFragment.kt | 2 +- .../training/environment/WindSpeedActivity.kt | 2 +- .../environment/WindSpeedListFragment.kt | 2 +- .../features/training/input/InputActivity.kt | 14 +- .../training/overview/TrainingsFragment.kt | 6 +- .../training/overview/TrainingsViewModel.kt | 4 +- .../EditStandardRoundActivity.kt | 2 +- .../EditStandardRoundFragment.kt | 4 +- .../standardround/StandardRoundActivity.kt | 2 +- .../StandardRoundListFragment.kt | 6 +- .../training/target/TargetActivity.kt | 2 +- .../training/target/TargetListFragment.kt | 6 +- .../mytargets/utils/DividerItemDecoration.kt | 6 +- .../de/dreier/mytargets/utils/FileUtils.kt | 2 +- .../dreier/mytargets/utils/IntentWrapper.kt | 4 +- .../dreier/mytargets/utils/LiveDataUtil2.kt | 8 +- .../mytargets/utils/LongSparseArrayUtils.kt | 4 +- .../mytargets/utils/MobileWearableClient.kt | 2 +- .../de/dreier/mytargets/utils/ScoreUtils.kt | 2 +- .../mytargets/utils/SlideInItemAnimator.kt | 6 +- .../de/dreier/mytargets/utils/ToolbarUtils.kt | 23 +- .../java/de/dreier/mytargets/utils/Utils.kt | 7 +- .../utils/databinding/DataBindingAdapters.kt | 4 +- .../databinding/SpinnerBindingAdapters.kt | 8 +- .../ExpandableHeaderBindingHolder.kt | 2 +- .../utils/multiselector/ItemBindingHolder.kt | 2 +- .../utils/multiselector/SelectorBase.kt | 2 +- .../utils/print/CustomPrintDocumentAdapter.kt | 2 +- .../utils/print/DrawableToPdfWriter.kt | 2 +- .../mytargets/utils/print/ViewToPdfWriter.kt | 2 +- .../utils/transitions/FabTransform.kt | 16 +- .../utils/transitions/GravityArcMotion.kt | 2 +- .../utils/transitions/NoPauseAnimator.kt | 4 +- .../utils/transitions/TransitionAdapter.kt | 2 +- .../de/dreier/mytargets/views/NumberPicker.kt | 4 +- .../mytargets/views/TextInputEditText.kt | 5 +- .../views/selector/EnvironmentSelector.kt | 6 +- .../mytargets/views/selector/SelectorBase.kt | 6 +- .../mytargets/views/speeddial/FabSpeedDial.kt | 26 +- .../views/speeddial/FabSpeedDialBehaviour.kt | 6 +- app/src/main/res/layout/activity_gallery.xml | 4 +- app/src/main/res/layout/activity_input.xml | 6 +- app/src/main/res/layout/activity_main.xml | 10 +- .../main/res/layout/activity_statistics.xml | 18 +- app/src/main/res/layout/fab_menu_item_end.xml | 6 +- .../main/res/layout/fab_speed_dial_bottom.xml | 2 +- app/src/main/res/layout/fragment_arrows.xml | 8 +- app/src/main/res/layout/fragment_backup.xml | 6 +- app/src/main/res/layout/fragment_bows.xml | 6 +- app/src/main/res/layout/fragment_distance.xml | 8 +- .../main/res/layout/fragment_edit_arrow.xml | 44 ++-- app/src/main/res/layout/fragment_edit_bow.xml | 90 +++---- .../main/res/layout/fragment_edit_image.xml | 20 +- .../main/res/layout/fragment_edit_round.xml | 2 +- .../layout/fragment_edit_standard_round.xml | 12 +- .../res/layout/fragment_edit_training.xml | 10 +- .../main/res/layout/fragment_environment.xml | 14 +- app/src/main/res/layout/fragment_list.xml | 8 +- .../main/res/layout/fragment_statistics.xml | 6 +- .../res/layout/fragment_target_select.xml | 8 +- app/src/main/res/layout/fragment_timer.xml | 4 +- app/src/main/res/layout/fragment_training.xml | 18 +- .../main/res/layout/fragment_trainings.xml | 6 +- .../main/res/layout/layout_switch_label.xml | 2 +- app/src/main/res/menu/search.xml | 2 +- build.gradle | 16 +- dependencies.gradle | 154 ++++++------ gradle/wrapper/gradle-wrapper.jar | Bin 49896 -> 56177 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 78 +++--- gradlew.bat | 174 +++++++------ shared/build.gradle | 25 +- .../shared/targets/models/DAIR3DTest.kt | 4 +- .../targets/models/TargetModelBaseTest.kt | 4 +- .../shared/targets/models/WAFullTest.kt | 4 +- .../targets/models/WAVertical3SpotTest.kt | 4 +- .../java/androidx/core/animation/Animator.kt | 48 ---- .../java/androidx/core/content/Context.kt | 236 ------------------ .../main/java/androidx/core/graphics/Rect.kt | 29 --- shared/src/main/java/androidx/core/net/Uri.kt | 10 - .../shared/SharedApplicationInstance.kt | 2 +- .../aggregation/IAggregationResultRenderer.kt | 2 +- .../aggregation/IAggregationStrategy.kt | 2 +- .../analysis/aggregation/NOPResultRenderer.kt | 2 +- .../cluster/AggregationStrategyBase.kt | 4 +- .../shared/base/fragment/ETimerState.kt | 2 +- .../shared/base/fragment/TimerFragmentBase.kt | 12 +- .../mytargets/shared/models/EBowType.kt | 4 +- .../mytargets/shared/models/ETargetType.kt | 2 +- .../mytargets/shared/models/EWeather.kt | 4 +- .../dreier/mytargets/shared/models/Target.kt | 4 +- .../mytargets/shared/models/Thumbnail.kt | 2 +- .../mytargets/shared/models/db/Arrow.kt | 6 +- .../mytargets/shared/models/db/ArrowImage.kt | 10 +- .../dreier/mytargets/shared/models/db/Bow.kt | 6 +- .../mytargets/shared/models/db/BowImage.kt | 10 +- .../dreier/mytargets/shared/models/db/End.kt | 4 +- .../mytargets/shared/models/db/EndImage.kt | 10 +- .../mytargets/shared/models/db/Round.kt | 4 +- .../shared/models/db/RoundTemplate.kt | 4 +- .../dreier/mytargets/shared/models/db/Shot.kt | 10 +- .../mytargets/shared/models/db/SightMark.kt | 10 +- .../mytargets/shared/models/db/Signature.kt | 6 +- .../shared/models/db/StandardRound.kt | 4 +- .../mytargets/shared/models/db/Training.kt | 4 +- .../mytargets/shared/targets/Target3DBase.kt | 2 +- .../TargetImpactAggregationDrawable.kt | 2 +- .../shared/targets/models/TargetModelBase.kt | 2 +- .../targets/scoringstyle/ColorScoringStyle.kt | 2 +- .../targets/scoringstyle/ScoringStyle.kt | 2 +- .../de/dreier/mytargets/shared/utils/Color.kt | 2 +- .../mytargets/shared/views/TargetViewBase.kt | 10 +- .../shared/wearable/WearableClientBase.kt | 2 +- wearable/build.gradle | 17 +- .../java/de/dreier/mytargets/InputActivity.kt | 2 +- .../java/de/dreier/mytargets/MainActivity.kt | 6 +- .../java/de/dreier/mytargets/RoundActivity.kt | 8 +- .../de/dreier/mytargets/TargetSelectView.kt | 2 +- .../java/de/dreier/mytargets/TimerActivity.kt | 2 +- .../dreier/mytargets/WearWearableListener.kt | 2 +- .../mytargets/utils/WearWearableClient.kt | 2 +- .../src/main/res/layout/activity_input.xml | 4 +- .../src/main/res/layout/activity_main.xml | 8 +- .../src/main/res/layout/activity_round.xml | 10 +- .../src/main/res/layout/activity_timer.xml | 10 +- 301 files changed, 1257 insertions(+), 1578 deletions(-) rename app/src/main/java/{android/support/v7 => androidx/recyclerview}/widget/RebindReportingHolder.kt (85%) delete mode 100644 app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncService.java create mode 100644 app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncService.kt delete mode 100644 shared/src/main/java/androidx/core/animation/Animator.kt delete mode 100644 shared/src/main/java/androidx/core/content/Context.kt delete mode 100644 shared/src/main/java/androidx/core/graphics/Rect.kt delete mode 100644 shared/src/main/java/androidx/core/net/Uri.kt diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index 1c24f9a8d..3097f3190 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,7 +1,7 @@ - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index a41f25255..6e55c5c0e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,6 +20,7 @@ apply plugin: 'kotlin-android-extensions' apply plugin: 'com.github.triplet.play' apply plugin: 'com.getkeepsafe.dexcount' apply plugin: 'io.fabric' +apply plugin: 'androidx.navigation.safeargs' android { compileOptions { @@ -122,19 +123,23 @@ dependencies { implementation dependencies.kotlinStdlibJdk7 - implementation dependencies.supportCompat - implementation dependencies.supportCoreUtils - implementation dependencies.supportCoreUi - implementation dependencies.supportFragment - implementation dependencies.supportV13 + implementation dependencies.androidxCore + implementation dependencies.androidxCoreUtils + implementation dependencies.androidxCoreUi + implementation dependencies.androidxFragment + implementation dependencies.androidxV13 implementation dependencies.appCompat - implementation dependencies.supportDesign - implementation dependencies.supportAnnotations - implementation dependencies.supportPreference - implementation dependencies.supportExifInterface + implementation dependencies.androidxDesign + implementation dependencies.androidxAnnotations + implementation dependencies.androidxPreference + implementation dependencies.androidxExifInterface implementation dependencies.recyclerView implementation dependencies.cardView -// implementation dependencies.androidxCoreKtx + + implementation dependencies.androidxCoreKtx + implementation dependencies.androidFragmentKtx + + implementation dependencies.timber implementation dependencies.playServicesDrive implementation dependencies.firebaseCore @@ -189,6 +194,8 @@ dependencies { kapt dependencies.archLifecycleCompiler implementation dependencies.archRoomRuntime kapt dependencies.archRoomCompiler + implementation dependencies.archNavigationFragment + implementation dependencies.archNavigationUi implementation project(':shared') wearApp project(':wearable') @@ -198,25 +205,17 @@ dependencies { testImplementation dependencies.kotlinTestJunit androidTestImplementation dependencies.truth - androidTestImplementation dependencies.jsr305 androidTestImplementation dependencies.runner androidTestImplementation dependencies.rules androidTestImplementation dependencies.uiAutomator - androidTestImplementation(dependencies.espressoCore, { - exclude group: 'com.android.support' - }) - androidTestImplementation(dependencies.espressoContrib, { - exclude group: 'com.android.support' - }) - androidTestImplementation(dependencies.espressoIntents, { - exclude group: 'com.android.support', module: 'appcompat' - exclude group: 'com.android.support', module: 'support-v4' - exclude module: 'recyclerview-v7' - }) + androidTestImplementation dependencies.espressoCore + androidTestImplementation dependencies.espressoContrib + androidTestImplementation dependencies.espressoIntents implementation dependencies.espressoIdlingResource androidTestScreengrabImplementation dependencies.screengrab androidTestImplementation dependencies.archRoomTesting + androidTestImplementation dependencies.androidxTestExt implementation dependencies.multiDex } diff --git a/app/src/androidTest/AndroidManifest.xml b/app/src/androidTest/AndroidManifest.xml index feb331083..da1f7b2ee 100644 --- a/app/src/androidTest/AndroidManifest.xml +++ b/app/src/androidTest/AndroidManifest.xml @@ -21,7 +21,7 @@ + tools:overrideLibrary="androidx.test.uiautomator.v18"/> diff --git a/app/src/androidTest/java/de/dreier/mytargets/app/MigrationTest.kt b/app/src/androidTest/java/de/dreier/mytargets/app/MigrationTest.kt index 92c6f997f..a83e6a299 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/app/MigrationTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/app/MigrationTest.kt @@ -15,14 +15,14 @@ package de.dreier.mytargets.app -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.Room -import android.arch.persistence.room.testing.MigrationTestHelper import android.content.Context -import android.support.test.InstrumentationRegistry -import android.support.test.InstrumentationRegistry.getTargetContext -import android.support.test.filters.SmallTest -import android.support.test.runner.AndroidJUnit4 +import androidx.room.Room +import androidx.room.testing.MigrationTestHelper +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.SmallTest +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation import com.google.common.truth.Truth.assertThat import de.dreier.mytargets.base.db.AppDatabase import de.dreier.mytargets.base.db.migrations.* @@ -58,7 +58,7 @@ class MigrationTest : InstrumentedTestBase() { @Throws(IOException::class) fun setUp() { // Create artificial image file to ensure the according database entry is not deleted (Migration23) - getTargetContext() + getInstrumentation().targetContext .openFileOutput( "img175420839671886584-0f61-43a6-bc1e-dbcd8526056c794370927.jpg", Context.MODE_PRIVATE @@ -217,7 +217,7 @@ class MigrationTest : InstrumentedTestBase() { private fun getMigratedRoomDatabase(): AppDatabase { val database = Room.databaseBuilder( - InstrumentationRegistry.getTargetContext(), + getInstrumentation().targetContext, AppDatabase::class.java, TEST_DB_NAME ).addMigrations( Migration17, Migration18, Migration19, diff --git a/app/src/androidTest/java/de/dreier/mytargets/dao/ArrowDAOTest.kt b/app/src/androidTest/java/de/dreier/mytargets/dao/ArrowDAOTest.kt index 0f99ead8f..8d201c4df 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/dao/ArrowDAOTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/dao/ArrowDAOTest.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.dao -import android.support.test.runner.AndroidJUnit4 +import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat import de.dreier.mytargets.shared.models.db.Arrow import de.dreier.mytargets.shared.models.db.ArrowImage diff --git a/app/src/androidTest/java/de/dreier/mytargets/dao/DAOTestBase.kt b/app/src/androidTest/java/de/dreier/mytargets/dao/DAOTestBase.kt index a1967674a..f8efc35c8 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/dao/DAOTestBase.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/dao/DAOTestBase.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.dao -import android.arch.persistence.room.Room -import android.support.test.InstrumentationRegistry +import androidx.room.Room +import androidx.test.platform.app.InstrumentationRegistry import de.dreier.mytargets.base.db.AppDatabase import org.junit.After import org.junit.Before diff --git a/app/src/androidTest/java/de/dreier/mytargets/dao/EndDAOTest.kt b/app/src/androidTest/java/de/dreier/mytargets/dao/EndDAOTest.kt index 5aa2427fb..f32d8c1b8 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/dao/EndDAOTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/dao/EndDAOTest.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.dao -import android.support.test.runner.AndroidJUnit4 +import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat import de.dreier.mytargets.shared.models.augmented.AugmentedEnd import de.dreier.mytargets.shared.models.db.End diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/arrow/ArrowSelectorTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/arrow/ArrowSelectorTest.kt index 6b613acc1..8357d9edf 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/arrow/ArrowSelectorTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/arrow/ArrowSelectorTest.kt @@ -17,14 +17,14 @@ package de.dreier.mytargets.features.arrow import android.content.Intent -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.intent.Intents.intended -import android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.* -import android.support.test.runner.AndroidJUnit4 +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.intent.Intents.intended +import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.ext.junit.runners.AndroidJUnit4 import de.dreier.mytargets.R import de.dreier.mytargets.features.arrows.ArrowListActivity import de.dreier.mytargets.features.arrows.EditArrowActivity diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/arrow/EditArrowTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/arrow/EditArrowTest.kt index d0cec621b..f06b49ee9 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/arrow/EditArrowTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/arrow/EditArrowTest.kt @@ -16,13 +16,13 @@ package de.dreier.mytargets.features.arrow -import android.support.test.espresso.Espresso.onData -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.* -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.matcher.ViewMatchers.* +import androidx.test.espresso.Espresso.onData +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.* +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.* import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 +import androidx.test.ext.junit.runners.AndroidJUnit4 import de.dreier.mytargets.R import de.dreier.mytargets.features.main.MainActivity import de.dreier.mytargets.test.base.UITestBase diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/bow/BowSelectorTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/bow/BowSelectorTest.kt index 06a8f67c1..5591fbac9 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/bow/BowSelectorTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/bow/BowSelectorTest.kt @@ -17,14 +17,14 @@ package de.dreier.mytargets.features.bow import android.content.Intent -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.intent.Intents.intended -import android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.* -import android.support.test.runner.AndroidJUnit4 +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.intent.Intents.intended +import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.ext.junit.runners.AndroidJUnit4 import de.dreier.mytargets.R import de.dreier.mytargets.features.bows.BowListActivity import de.dreier.mytargets.features.bows.EditBowActivity diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/bow/EditSightMarksTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/bow/EditSightMarksTest.kt index bf47f35dc..c6abb517f 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/bow/EditSightMarksTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/bow/EditSightMarksTest.kt @@ -16,14 +16,14 @@ package de.dreier.mytargets.features.bow -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.* -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.contrib.RecyclerViewActions.actionOnItem -import android.support.test.espresso.matcher.ViewMatchers.* +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.* +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem +import androidx.test.espresso.matcher.ViewMatchers.* import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import android.support.v7.widget.RecyclerView +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.recyclerview.widget.RecyclerView import de.dreier.mytargets.R import de.dreier.mytargets.features.main.MainActivity import de.dreier.mytargets.test.base.UITestBase diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/main/IntroActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/main/IntroActivityTest.kt index 99eb1849a..0345b96cb 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/main/IntroActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/main/IntroActivityTest.kt @@ -15,12 +15,12 @@ package de.dreier.mytargets.features.main -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.matcher.ViewMatchers.* +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.* import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 +import androidx.test.ext.junit.runners.AndroidJUnit4 import de.dreier.mytargets.R import de.dreier.mytargets.features.settings.SettingsManager import de.dreier.mytargets.test.base.UITestBase diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/main/MainActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/main/MainActivityTest.kt index 4166bf1af..4a5a7c8fd 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/main/MainActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/main/MainActivityTest.kt @@ -17,18 +17,18 @@ package de.dreier.mytargets.features.main import android.app.Activity import android.app.Instrumentation -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.IdlingRegistry -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.action.ViewActions.longClick -import android.support.test.espresso.contrib.DrawerActions -import android.support.test.espresso.contrib.NavigationViewActions -import android.support.test.espresso.intent.Intents.intended -import android.support.test.espresso.intent.Intents.intending -import android.support.test.espresso.intent.matcher.IntentMatchers.* -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.withId -import android.support.test.runner.AndroidJUnit4 +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.IdlingRegistry +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.longClick +import androidx.test.espresso.contrib.DrawerActions +import androidx.test.espresso.contrib.NavigationViewActions +import androidx.test.espresso.intent.Intents.intended +import androidx.test.espresso.intent.Intents.intending +import androidx.test.espresso.intent.matcher.IntentMatchers.* +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.ext.junit.runners.AndroidJUnit4 import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.base.fragments.EditableListFragmentBase.Companion.ITEM_ID diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/settings/SettingsActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/settings/SettingsActivityTest.kt index 4b1ea177d..093eabda4 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/settings/SettingsActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/settings/SettingsActivityTest.kt @@ -16,18 +16,18 @@ package de.dreier.mytargets.features.settings -import android.support.annotation.StringRes -import android.support.test.espresso.Espresso.onData -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.Espresso.pressBack -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.action.ViewActions.closeSoftKeyboard -import android.support.test.espresso.action.ViewActions.replaceText -import android.support.test.espresso.contrib.RecyclerViewActions.scrollTo -import android.support.test.espresso.matcher.ViewMatchers.* +import androidx.annotation.StringRes +import androidx.test.espresso.Espresso.onData +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.Espresso.pressBack +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.closeSoftKeyboard +import androidx.test.espresso.action.ViewActions.replaceText +import androidx.test.espresso.contrib.RecyclerViewActions.scrollTo +import androidx.test.espresso.matcher.ViewMatchers.* import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import android.support.v7.widget.RecyclerView +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.recyclerview.widget.RecyclerView import de.dreier.mytargets.R import de.dreier.mytargets.features.settings.backup.provider.EBackupLocation import de.dreier.mytargets.shared.SharedApplicationInstance diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/settings/SettingsManagerTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/settings/SettingsManagerTest.kt index df9f09f59..d09fde0a4 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/settings/SettingsManagerTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/settings/SettingsManagerTest.kt @@ -15,9 +15,9 @@ package de.dreier.mytargets.features.settings -import android.support.test.filters.SmallTest -import android.support.test.runner.AndroidJUnit4 -import android.support.v4.util.LongSparseArray +import androidx.collection.LongSparseArray +import androidx.test.filters.SmallTest +import androidx.test.runner.AndroidJUnit4 import com.google.common.truth.Truth.assertThat import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.features.settings.backup.EBackupInterval diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/statistics/ExportTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/statistics/ExportTest.kt index a005487be..cdce6d811 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/statistics/ExportTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/statistics/ExportTest.kt @@ -15,9 +15,9 @@ package de.dreier.mytargets.features.statistics -import android.support.test.InstrumentationRegistry.getInstrumentation +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation import android.support.test.filters.SmallTest -import android.support.test.runner.AndroidJUnit4 +import androidx.test.ext.junit.runners.AndroidJUnit4 import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.test.base.InstrumentedTestBase import de.dreier.mytargets.test.utils.rules.MiniDbTestRule diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/statistics/StatisticsActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/statistics/StatisticsActivityTest.kt index 437e3ad65..cb962b3a7 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/statistics/StatisticsActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/statistics/StatisticsActivityTest.kt @@ -16,13 +16,13 @@ package de.dreier.mytargets.features.statistics import android.content.Intent -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.Espresso.pressBack -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.withId -import android.support.test.espresso.matcher.ViewMatchers.withParent -import android.support.test.runner.AndroidJUnit4 +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.Espresso.pressBack +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.matcher.ViewMatchers.withParent +import androidx.test.ext.junit.runners.AndroidJUnit4 import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.test.base.UITestBase diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/training/DeleteTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/training/DeleteTest.kt index 52ed1f7e3..ee1cd16b7 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/training/DeleteTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/training/DeleteTest.kt @@ -15,19 +15,19 @@ package de.dreier.mytargets.features.training -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.Espresso.pressBack -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.action.ViewActions.longClick -import android.support.test.espresso.assertion.ViewAssertions -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition -import android.support.test.espresso.matcher.ViewMatchers.* +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.Espresso.pressBack +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.longClick +import androidx.test.espresso.assertion.ViewAssertions +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition +import androidx.test.espresso.matcher.ViewMatchers.* import android.support.test.filters.LargeTest import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import android.support.v7.widget.RecyclerView -import android.support.v7.widget.Toolbar +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.recyclerview.widget.RecyclerView +import androidx.appcompat.widget.Toolbar import de.dreier.mytargets.R import de.dreier.mytargets.features.main.MainActivity import de.dreier.mytargets.test.base.UITestBase diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/training/EditTrainingActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/training/EditTrainingActivityTest.kt index 3185baf0d..5270d954c 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/training/EditTrainingActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/training/EditTrainingActivityTest.kt @@ -17,16 +17,16 @@ package de.dreier.mytargets.features.training import android.content.Intent -import android.support.test.espresso.Espresso.* -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.action.ViewActions.replaceText -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.contrib.RecyclerViewActions.actionOnItem -import android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.* -import android.support.test.runner.AndroidJUnit4 -import android.support.v7.widget.RecyclerView +import androidx.test.espresso.Espresso.* +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.replaceText +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem +import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.recyclerview.widget.RecyclerView import de.dreier.mytargets.R import de.dreier.mytargets.features.settings.SettingsManager import de.dreier.mytargets.features.training.edit.EditTrainingActivity diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/training/ScoreboardActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/training/ScoreboardActivityTest.kt index fee4505e6..3f1ec806e 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/training/ScoreboardActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/training/ScoreboardActivityTest.kt @@ -18,16 +18,16 @@ package de.dreier.mytargets.features.training import android.app.Activity import android.app.Instrumentation import android.content.Intent -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.intent.Intents.intended -import android.support.test.espresso.intent.Intents.intending -import android.support.test.espresso.intent.matcher.IntentMatchers.* -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.isDisplayed -import android.support.test.espresso.matcher.ViewMatchers.withText -import android.support.test.runner.AndroidJUnit4 -import android.support.v7.preference.PreferenceFragmentCompat +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.intent.Intents.intended +import androidx.test.espresso.intent.Intents.intending +import androidx.test.espresso.intent.matcher.IntentMatchers.* +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.isDisplayed +import androidx.test.espresso.matcher.ViewMatchers.withText +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.preference.PreferenceFragmentCompat import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.features.scoreboard.ScoreboardActivity diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/training/TrainingActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/training/TrainingActivityTest.kt index 2dd9c9683..8a8c7d55c 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/training/TrainingActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/training/TrainingActivityTest.kt @@ -16,12 +16,12 @@ package de.dreier.mytargets.features.training import android.content.Intent -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.hasDescendant -import android.support.test.espresso.matcher.ViewMatchers.withText -import android.support.test.runner.AndroidJUnit4 +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.hasDescendant +import androidx.test.espresso.matcher.ViewMatchers.withText +import androidx.test.ext.junit.runners.AndroidJUnit4 import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.base.fragments.EditableListFragmentBase diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/training/input/InputActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/training/input/InputActivityTest.kt index f545e9f59..4ef449567 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/training/input/InputActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/training/input/InputActivityTest.kt @@ -15,13 +15,13 @@ package de.dreier.mytargets.features.training.input import android.content.Intent -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.Espresso.pressBack -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.Espresso.pressBack +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.matcher.ViewMatchers.withId import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import android.support.test.uiautomator.UiObjectNotFoundException +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.uiautomator.UiObjectNotFoundException import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.features.settings.SettingsManager diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundActivityTest.kt index 6c876a73c..f8ccfdf4e 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundActivityTest.kt @@ -17,16 +17,16 @@ package de.dreier.mytargets.features.training.standardround import android.content.Intent -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.action.ViewActions.scrollTo -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.contrib.RecyclerViewActions.actionOnItem -import android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.* -import android.support.test.runner.AndroidJUnit4 -import android.support.v7.widget.RecyclerView +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.scrollTo +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem +import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.recyclerview.widget.RecyclerView import de.dreier.mytargets.R import de.dreier.mytargets.features.settings.SettingsManager import de.dreier.mytargets.features.training.edit.EditTrainingActivity diff --git a/app/src/androidTest/java/de/dreier/mytargets/features/training/standardround/StandardRoundActivityTest.kt b/app/src/androidTest/java/de/dreier/mytargets/features/training/standardround/StandardRoundActivityTest.kt index 1f0c90b75..118ced11a 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/features/training/standardround/StandardRoundActivityTest.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/features/training/standardround/StandardRoundActivityTest.kt @@ -16,15 +16,15 @@ package de.dreier.mytargets.features.training.standardround import android.content.Intent -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.* -import android.support.test.espresso.assertion.ViewAssertions.matches -import android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition -import android.support.test.espresso.intent.rule.IntentsTestRule -import android.support.test.espresso.matcher.ViewMatchers.* -import android.support.test.runner.AndroidJUnit4 -import android.support.v4.util.LongSparseArray -import android.support.v7.widget.RecyclerView +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.* +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.collection.LongSparseArray +import androidx.recyclerview.widget.RecyclerView import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.base.navigation.NavigationController diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/base/UITestBase.kt b/app/src/androidTest/java/de/dreier/mytargets/test/base/UITestBase.kt index 16984005d..0801cdad8 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/base/UITestBase.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/base/UITestBase.kt @@ -16,19 +16,20 @@ package de.dreier.mytargets.test.base import android.os.Environment -import android.support.annotation.IdRes -import android.support.annotation.StringRes -import android.support.test.InstrumentationRegistry -import android.support.test.InstrumentationRegistry.getInstrumentation -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu -import android.support.test.espresso.ViewAction -import android.support.test.espresso.action.ViewActions -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.action.ViewActions.pressBack -import android.support.test.espresso.contrib.PickerActions -import android.support.test.espresso.matcher.ViewMatchers.* -import android.support.test.uiautomator.UiDevice +import androidx.annotation.IdRes +import androidx.annotation.StringRes +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation +import androidx.test.espresso.Espresso +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu +import androidx.test.espresso.ViewAction +import androidx.test.espresso.action.ViewActions +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.action.ViewActions.pressBack +import androidx.test.espresso.contrib.PickerActions +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.uiautomator.UiDevice import android.widget.DatePicker import de.dreier.mytargets.R import de.dreier.mytargets.features.settings.SettingsManager @@ -62,10 +63,10 @@ abstract class UITestBase : InstrumentedTestBase() { val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) val filename = (description!!.className.replace(".*\\.([^.]+)".toRegex(), "$1") + "-" + description.methodName) - device.takeScreenshot(File(path, filename + ".png")) + device.takeScreenshot(File(path, "$filename.png")) try { - device.dumpWindowHierarchy(File(path, filename + ".txt")) + device.dumpWindowHierarchy(File(path, "$filename.txt")) } catch (e1: IOException) { e1.printStackTrace() } @@ -74,7 +75,7 @@ abstract class UITestBase : InstrumentedTestBase() { } protected fun clickActionBarItem(@IdRes menuItem: Int, @StringRes title: Int) { - onView(withId(menuItem)).withFailureHandler { _, _ -> + Espresso.onView(withId(menuItem)).withFailureHandler { _, _ -> openActionBarOverflowOrOptionsMenu(getInstrumentation().targetContext) onView(withText(title)).perform(click()) }.perform(click()) @@ -101,7 +102,7 @@ abstract class UITestBase : InstrumentedTestBase() { protected fun getString(@StringRes resString: Int): String { - return InstrumentationRegistry.getTargetContext().getString(resString) + return InstrumentationRegistry.getInstrumentation().targetContext.getString(resString) } protected fun navigateUp() { diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/PermissionGranter.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/PermissionGranter.kt index b15e55905..eba4428fa 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/PermissionGranter.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/PermissionGranter.kt @@ -18,11 +18,11 @@ package de.dreier.mytargets.test.utils import android.app.Activity import android.content.pm.PackageManager import android.os.Build -import android.support.test.InstrumentationRegistry.getInstrumentation -import android.support.test.uiautomator.UiDevice -import android.support.test.uiautomator.UiObjectNotFoundException -import android.support.test.uiautomator.UiSelector -import android.support.v4.content.ContextCompat +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiObjectNotFoundException +import androidx.test.uiautomator.UiSelector +import androidx.core.content.ContextCompat object PermissionGranter { diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/LowLevelActions.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/LowLevelActions.kt index a70b53287..17365ce8e 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/LowLevelActions.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/LowLevelActions.kt @@ -17,12 +17,12 @@ package de.dreier.mytargets.test.utils.actions import android.graphics.Matrix import android.graphics.RectF -import android.support.test.InstrumentationRegistry -import android.support.test.espresso.UiController -import android.support.test.espresso.ViewAction -import android.support.test.espresso.action.MotionEvents -import android.support.test.espresso.action.Press -import android.support.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.espresso.UiController +import androidx.test.espresso.ViewAction +import androidx.test.espresso.action.MotionEvents +import androidx.test.espresso.action.Press +import androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast import android.view.MotionEvent import android.view.View import de.dreier.mytargets.shared.targets.drawable.TargetDrawable diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/NestedScrollToAction.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/NestedScrollToAction.kt index cb1a3fe0e..8ff0db1af 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/NestedScrollToAction.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/NestedScrollToAction.kt @@ -16,13 +16,13 @@ package de.dreier.mytargets.test.utils.actions import android.graphics.Rect -import android.support.test.espresso.PerformException -import android.support.test.espresso.UiController -import android.support.test.espresso.ViewAction -import android.support.test.espresso.matcher.ViewMatchers -import android.support.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast -import android.support.test.espresso.util.HumanReadables -import android.support.v4.widget.NestedScrollView +import androidx.test.espresso.PerformException +import androidx.test.espresso.UiController +import androidx.test.espresso.ViewAction +import androidx.test.espresso.matcher.ViewMatchers +import androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast +import androidx.test.espresso.util.HumanReadables +import androidx.core.widget.NestedScrollView import android.view.View import android.widget.HorizontalScrollView import android.widget.ScrollView diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/TargetViewActions.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/TargetViewActions.kt index b4775d479..2d60831af 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/TargetViewActions.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/actions/TargetViewActions.kt @@ -15,11 +15,11 @@ package de.dreier.mytargets.test.utils.actions -import android.support.test.espresso.ViewAction -import android.support.test.espresso.action.CoordinatesProvider -import android.support.test.espresso.action.GeneralClickAction -import android.support.test.espresso.action.Press -import android.support.test.espresso.action.Tap +import androidx.test.espresso.ViewAction +import androidx.test.espresso.action.CoordinatesProvider +import androidx.test.espresso.action.GeneralClickAction +import androidx.test.espresso.action.Press +import androidx.test.espresso.action.Tap import de.dreier.mytargets.features.training.input.TargetView import org.junit.Assert.assertNotNull diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/assertions/RecyclerViewAssertions.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/assertions/RecyclerViewAssertions.kt index 63f8f2454..776ec25de 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/assertions/RecyclerViewAssertions.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/assertions/RecyclerViewAssertions.kt @@ -15,10 +15,10 @@ package de.dreier.mytargets.test.utils.assertions -import android.support.annotation.StringRes -import android.support.test.espresso.ViewAssertion -import android.support.test.espresso.matcher.ViewMatchers.assertThat -import android.support.v7.widget.RecyclerView +import androidx.annotation.StringRes +import androidx.test.espresso.ViewAssertion +import androidx.test.espresso.matcher.ViewMatchers.assertThat +import androidx.recyclerview.widget.RecyclerView import android.view.View import android.view.View.FIND_VIEWS_WITH_TEXT import android.widget.TextView diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/assertions/TargetViewAssertions.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/assertions/TargetViewAssertions.kt index e63cfdcb4..b7146b2ec 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/assertions/TargetViewAssertions.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/assertions/TargetViewAssertions.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.test.utils.assertions -import android.support.test.espresso.ViewAssertion +import androidx.test.espresso.ViewAssertion import de.dreier.mytargets.features.training.input.TargetView import org.junit.Assert.assertNotNull import org.junit.Assert.assertNull diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/IntentMatcher.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/IntentMatcher.kt index 35677e2f9..04d1bacba 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/IntentMatcher.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/IntentMatcher.kt @@ -16,9 +16,9 @@ package de.dreier.mytargets.test.utils.matchers import android.content.Intent -import android.support.test.espresso.intent.matcher.ComponentNameMatchers.hasClassName -import android.support.test.espresso.intent.matcher.ComponentNameMatchers.hasMyPackageName -import android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent +import androidx.test.espresso.intent.matcher.ComponentNameMatchers.hasClassName +import androidx.test.espresso.intent.matcher.ComponentNameMatchers.hasMyPackageName +import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent import org.hamcrest.CoreMatchers.allOf import org.hamcrest.Description import org.hamcrest.Matcher diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/MatcherUtils.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/MatcherUtils.kt index 43289c625..0002a57d5 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/MatcherUtils.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/MatcherUtils.kt @@ -16,12 +16,12 @@ package de.dreier.mytargets.test.utils.matchers import android.content.res.Resources -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.ViewInteraction -import android.support.test.espresso.assertion.ViewAssertions -import android.support.test.espresso.matcher.BoundedMatcher -import android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom -import android.support.v7.widget.Toolbar +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.ViewInteraction +import androidx.test.espresso.assertion.ViewAssertions +import androidx.test.espresso.matcher.BoundedMatcher +import androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom +import androidx.appcompat.widget.Toolbar import android.view.View import android.view.ViewGroup import android.widget.TextView diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/ParentViewMatcher.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/ParentViewMatcher.kt index ac369927a..bb842b154 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/ParentViewMatcher.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/ParentViewMatcher.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.test.utils.matchers -import android.support.annotation.IdRes +import androidx.annotation.IdRes import android.view.View import android.view.ViewGroup import de.dreier.mytargets.views.speeddial.FabSpeedDial diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/RecyclerViewMatcher.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/RecyclerViewMatcher.kt index 416d28d73..66d74dc83 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/RecyclerViewMatcher.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/RecyclerViewMatcher.kt @@ -16,8 +16,8 @@ package de.dreier.mytargets.test.utils.matchers import android.content.res.Resources -import android.support.test.espresso.matcher.ViewMatchers.* -import android.support.v7.widget.RecyclerView +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.recyclerview.widget.RecyclerView import android.view.View import org.hamcrest.CoreMatchers.allOf import org.hamcrest.Description diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/ViewMatcher.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/ViewMatcher.kt index 50076108a..456b90e5c 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/ViewMatcher.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/matchers/ViewMatcher.kt @@ -15,15 +15,15 @@ package de.dreier.mytargets.test.utils.matchers -import android.support.annotation.IdRes -import android.support.annotation.StringRes +import androidx.annotation.IdRes +import androidx.annotation.StringRes import android.support.design.widget.FloatingActionButton -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.contrib.RecyclerViewActions.actionOnItem -import android.support.test.espresso.matcher.ViewMatchers.* -import android.support.v7.widget.RecyclerView -import android.support.v7.widget.Toolbar +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.recyclerview.widget.RecyclerView +import androidx.appcompat.widget.Toolbar import android.view.View import de.dreier.mytargets.R import de.dreier.mytargets.test.utils.matchers.ParentViewMatcher.isOnForegroundFragment diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/rules/DbTestRuleBase.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/rules/DbTestRuleBase.kt index e50b839be..8c42f46cd 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/rules/DbTestRuleBase.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/rules/DbTestRuleBase.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.test.utils.rules import android.content.Context -import android.support.test.InstrumentationRegistry +import androidx.test.platform.app.InstrumentationRegistry import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.base.db.AppDatabase diff --git a/app/src/androidTest/java/de/dreier/mytargets/test/utils/rules/SimpleDbTestRule.kt b/app/src/androidTest/java/de/dreier/mytargets/test/utils/rules/SimpleDbTestRule.kt index 9fcf80eb5..7b99301b8 100644 --- a/app/src/androidTest/java/de/dreier/mytargets/test/utils/rules/SimpleDbTestRule.kt +++ b/app/src/androidTest/java/de/dreier/mytargets/test/utils/rules/SimpleDbTestRule.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.test.utils.rules -import android.support.test.InstrumentationRegistry +import androidx.test.platform.app.InstrumentationRegistry import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.features.settings.SettingsManager diff --git a/app/src/androidTestScreengrab/java/de/dreier/mytargets/screengrab/ScreenshotTest.kt b/app/src/androidTestScreengrab/java/de/dreier/mytargets/screengrab/ScreenshotTest.kt index bf61b9bcd..5db836e71 100644 --- a/app/src/androidTestScreengrab/java/de/dreier/mytargets/screengrab/ScreenshotTest.kt +++ b/app/src/androidTestScreengrab/java/de/dreier/mytargets/screengrab/ScreenshotTest.kt @@ -1,15 +1,15 @@ package de.dreier.mytargets.screengrab import android.os.SystemClock -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.Espresso.pressBack -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.contrib.RecyclerViewActions -import android.support.test.espresso.matcher.ViewMatchers.* +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.Espresso.pressBack +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.contrib.RecyclerViewActions +import androidx.test.espresso.matcher.ViewMatchers.* import android.support.test.filters.LargeTest import android.support.test.filters.SdkSuppress import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 +import androidx.test.ext.junit.runners.AndroidJUnit4 import android.support.v7.widget.RecyclerView import android.view.View import de.dreier.mytargets.R diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 75939bec0..45d55e4b4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -299,7 +299,7 @@ android:label="@string/help"/> diff --git a/app/src/main/java/android/support/v7/widget/RebindReportingHolder.kt b/app/src/main/java/androidx/recyclerview/widget/RebindReportingHolder.kt similarity index 85% rename from app/src/main/java/android/support/v7/widget/RebindReportingHolder.kt rename to app/src/main/java/androidx/recyclerview/widget/RebindReportingHolder.kt index cc94c7fd2..754c37066 100644 --- a/app/src/main/java/android/support/v7/widget/RebindReportingHolder.kt +++ b/app/src/main/java/androidx/recyclerview/widget/RebindReportingHolder.kt @@ -13,7 +13,7 @@ * GNU General Public License for more details. */ -package android.support.v7.widget +package androidx.recyclerview.widget import android.view.View @@ -58,11 +58,13 @@ abstract class RebindReportingHolder(itemView: View) : RecyclerView.ViewHolder(i * @return */ private fun isRelevantFlagSet(flag: Int): Boolean { - return intArrayOf(RecyclerView.ViewHolder.FLAG_BOUND, - RecyclerView.ViewHolder.FLAG_INVALID, - RecyclerView.ViewHolder.FLAG_UPDATE, - RecyclerView.ViewHolder.FLAG_RETURNED_FROM_SCRAP) - .any { (flag and it) == it } + return intArrayOf( + RecyclerView.ViewHolder.FLAG_BOUND, + RecyclerView.ViewHolder.FLAG_INVALID, + RecyclerView.ViewHolder.FLAG_UPDATE, + RecyclerView.ViewHolder.FLAG_RETURNED_FROM_SCRAP + ) + .any { (flag and it) == it } } internal override fun offsetPosition(offset: Int, applyToPreLayout: Boolean) { diff --git a/app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt b/app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt index 657e9965e..9cf92dca5 100644 --- a/app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt +++ b/app/src/main/java/de/dreier/mytargets/app/ApplicationInstance.kt @@ -15,13 +15,13 @@ package de.dreier.mytargets.app -import android.arch.persistence.room.Room -import android.arch.persistence.room.RoomDatabase +import androidx.room.Room import android.content.Context import android.content.SharedPreferences import android.content.res.Configuration -import android.support.multidex.MultiDex +import androidx.multidex.MultiDex import android.util.Log +import androidx.room.RoomDatabase import com.crashlytics.android.Crashlytics import com.evernote.android.state.StateSaver import de.dreier.mytargets.BuildConfig diff --git a/app/src/main/java/de/dreier/mytargets/base/activities/ChildActivityBase.kt b/app/src/main/java/de/dreier/mytargets/base/activities/ChildActivityBase.kt index 49fd221a5..cd471bd60 100644 --- a/app/src/main/java/de/dreier/mytargets/base/activities/ChildActivityBase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/activities/ChildActivityBase.kt @@ -16,8 +16,8 @@ package de.dreier.mytargets.base.activities import android.os.Bundle -import android.support.v7.app.AppCompatActivity -import android.support.v7.app.AppCompatDelegate +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.app.AppCompatDelegate import android.view.MenuItem import com.google.firebase.analytics.FirebaseAnalytics import de.dreier.mytargets.base.navigation.NavigationController diff --git a/app/src/main/java/de/dreier/mytargets/base/activities/SimpleFragmentActivityBase.kt b/app/src/main/java/de/dreier/mytargets/base/activities/SimpleFragmentActivityBase.kt index cc71c2441..7ef078dc2 100644 --- a/app/src/main/java/de/dreier/mytargets/base/activities/SimpleFragmentActivityBase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/activities/SimpleFragmentActivityBase.kt @@ -17,12 +17,12 @@ package de.dreier.mytargets.base.activities import android.content.Intent import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment abstract class SimpleFragmentActivityBase : ChildActivityBase() { val childFragment: Fragment - get() = supportFragmentManager.findFragmentByTag(FRAGMENT_TAG) + get() = supportFragmentManager.findFragmentByTag(FRAGMENT_TAG)!! protected abstract fun instantiateFragment(): Fragment @@ -54,7 +54,7 @@ abstract class SimpleFragmentActivityBase : ChildActivityBase() { } supportFragmentManager.beginTransaction() - .replace(android.R.id.content, childFragment, FRAGMENT_TAG) + .replace(android.R.id.content, childFragment!!, FRAGMENT_TAG) .commit() } diff --git a/app/src/main/java/de/dreier/mytargets/base/adapters/ListAdapterBase.kt b/app/src/main/java/de/dreier/mytargets/base/adapters/ListAdapterBase.kt index 1f868805f..eb0d05788 100644 --- a/app/src/main/java/de/dreier/mytargets/base/adapters/ListAdapterBase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/adapters/ListAdapterBase.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.adapters -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView abstract class ListAdapterBase : RecyclerView.Adapter() { abstract fun removeItem(item: T) diff --git a/app/src/main/java/de/dreier/mytargets/base/adapters/dynamicitem/DynamicItemAdapter.kt b/app/src/main/java/de/dreier/mytargets/base/adapters/dynamicitem/DynamicItemAdapter.kt index 3cbdc91ba..b65d77b54 100644 --- a/app/src/main/java/de/dreier/mytargets/base/adapters/dynamicitem/DynamicItemAdapter.kt +++ b/app/src/main/java/de/dreier/mytargets/base/adapters/dynamicitem/DynamicItemAdapter.kt @@ -15,12 +15,12 @@ package de.dreier.mytargets.base.adapters.dynamicitem -import android.support.annotation.StringRes -import android.support.design.widget.Snackbar -import android.support.v4.app.Fragment -import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View +import androidx.annotation.StringRes +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.RecyclerView +import com.google.android.material.snackbar.Snackbar import de.dreier.mytargets.R diff --git a/app/src/main/java/de/dreier/mytargets/base/adapters/dynamicitem/DynamicItemHolder.kt b/app/src/main/java/de/dreier/mytargets/base/adapters/dynamicitem/DynamicItemHolder.kt index 3691c2b4e..74afb0491 100644 --- a/app/src/main/java/de/dreier/mytargets/base/adapters/dynamicitem/DynamicItemHolder.kt +++ b/app/src/main/java/de/dreier/mytargets/base/adapters/dynamicitem/DynamicItemHolder.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.adapters.dynamicitem -import android.support.v4.app.Fragment -import android.support.v7.widget.RecyclerView +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.RecyclerView import android.view.View abstract class DynamicItemHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/AppDatabase.kt b/app/src/main/java/de/dreier/mytargets/base/db/AppDatabase.kt index 2118cc58c..f5d35075d 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/AppDatabase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/AppDatabase.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db -import android.arch.persistence.room.* +import androidx.room.* import de.dreier.mytargets.base.db.dao.* import de.dreier.mytargets.base.db.typeconverters.* import de.dreier.mytargets.shared.models.db.* diff --git a/app/src/main/java/de/dreier/mytargets/base/db/RoundRepository.kt b/app/src/main/java/de/dreier/mytargets/base/db/RoundRepository.kt index 8a6075b56..a9203151b 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/RoundRepository.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/RoundRepository.kt @@ -15,6 +15,7 @@ package de.dreier.mytargets.base.db +import androidx.room.RoomDatabase import de.dreier.mytargets.base.db.dao.EndDAO import de.dreier.mytargets.base.db.dao.RoundDAO import de.dreier.mytargets.shared.models.augmented.AugmentedRound diff --git a/app/src/main/java/de/dreier/mytargets/base/db/TrainingRepository.kt b/app/src/main/java/de/dreier/mytargets/base/db/TrainingRepository.kt index c551e829c..b1e8ba6a2 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/TrainingRepository.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/TrainingRepository.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db -import android.arch.persistence.room.RoomDatabase +import androidx.room.RoomDatabase import de.dreier.mytargets.base.db.dao.RoundDAO import de.dreier.mytargets.base.db.dao.SignatureDAO import de.dreier.mytargets.base.db.dao.TrainingDAO diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/ArrowDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/ArrowDAO.kt index e8cd9c2db..1c8bfba0e 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/ArrowDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/ArrowDAO.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.dao -import android.arch.lifecycle.LiveData -import android.arch.persistence.room.* +import androidx.lifecycle.LiveData +import androidx.room.* import de.dreier.mytargets.shared.models.db.Arrow import de.dreier.mytargets.shared.models.db.ArrowImage diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/BowDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/BowDAO.kt index bdfa2cfa2..8036de7d0 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/BowDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/BowDAO.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.dao -import android.arch.persistence.room.* +import androidx.room.* import de.dreier.mytargets.shared.models.db.Bow import de.dreier.mytargets.shared.models.db.BowImage import de.dreier.mytargets.shared.models.db.SightMark diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/DimensionDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/DimensionDAO.kt index 918d0104d..c3028efd8 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/DimensionDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/DimensionDAO.kt @@ -15,9 +15,9 @@ package de.dreier.mytargets.base.db.dao -import android.arch.lifecycle.LiveData -import android.arch.persistence.room.Dao -import android.arch.persistence.room.Query +import androidx.room.Dao +import androidx.room.Query +import androidx.lifecycle.LiveData import de.dreier.mytargets.shared.models.Dimension @Dao diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/EndDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/EndDAO.kt index 506c45fe0..cef44ba7c 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/EndDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/EndDAO.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.dao -import android.arch.persistence.room.* +import androidx.room.* import de.dreier.mytargets.shared.models.db.End import de.dreier.mytargets.shared.models.db.EndImage import de.dreier.mytargets.shared.models.db.Shot diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/ImageDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/ImageDAO.kt index ad93834a1..472057ac4 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/ImageDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/ImageDAO.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.dao -import android.arch.persistence.room.Dao -import android.arch.persistence.room.Query +import androidx.room.Dao +import androidx.room.Query @Dao interface ImageDAO { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/RoundDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/RoundDAO.kt index d14b03404..197799033 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/RoundDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/RoundDAO.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.dao -import android.arch.lifecycle.LiveData -import android.arch.persistence.room.* +import androidx.lifecycle.LiveData +import androidx.room.* import de.dreier.mytargets.shared.models.db.End import de.dreier.mytargets.shared.models.db.Round diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/SignatureDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/SignatureDAO.kt index 9a80d55c9..8c4694c1e 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/SignatureDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/SignatureDAO.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.dao -import android.arch.persistence.room.* +import androidx.room.* import de.dreier.mytargets.shared.models.db.Signature @Dao diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/StandardRoundDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/StandardRoundDAO.kt index 0eb36b060..4504444d2 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/StandardRoundDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/StandardRoundDAO.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.dao -import android.arch.persistence.room.* +import androidx.room.* import de.dreier.mytargets.shared.models.augmented.AugmentedStandardRound import de.dreier.mytargets.shared.models.db.RoundTemplate import de.dreier.mytargets.shared.models.db.StandardRound diff --git a/app/src/main/java/de/dreier/mytargets/base/db/dao/TrainingDAO.kt b/app/src/main/java/de/dreier/mytargets/base/db/dao/TrainingDAO.kt index b96727edd..a7eb4f8bc 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/dao/TrainingDAO.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/dao/TrainingDAO.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.dao -import android.arch.lifecycle.LiveData -import android.arch.persistence.room.* +import androidx.lifecycle.LiveData +import androidx.room.* import de.dreier.mytargets.shared.models.db.Round import de.dreier.mytargets.shared.models.db.Training diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration10.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration10.kt index 97730b711..31ae92b4a 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration10.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration10.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration10 : Migration(9, 10) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration11.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration11.kt index 3855b9788..25c100535 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration11.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration11.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration11 : Migration(10, 11) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration12.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration12.kt index 3366a3382..6d7421755 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration12.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration12.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration12 : Migration(11, 12) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration13.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration13.kt index ed4d7138b..d87dd20a1 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration13.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration13.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration13 : Migration(12, 13) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration14.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration14.kt index 6b0aa84f5..93cb6b483 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration14.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration14.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration14 : Migration(13, 14) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration15.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration15.kt index 106a829c5..0e665f32c 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration15.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration15.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration15 : Migration(14, 15) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration16.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration16.kt index 82862d149..8318bd1da 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration16.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration16.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration16 : Migration(15, 16) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration17.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration17.kt index 3059a63ea..128b80a09 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration17.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration17.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration17 : Migration(16, 17) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration18.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration18.kt index 52248a672..fea12287b 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration18.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration18.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration18 : Migration(17, 18) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration19.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration19.kt index a16488b1a..dc8f617e8 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration19.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration19.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration19 : Migration(18, 19) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration2.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration2.kt index 08f72d8fc..9a2afc026 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration2.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration2.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration2 : Migration(1, 2) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration20.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration20.kt index d8396dd51..68ad513a9 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration20.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration20.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration20 : Migration(19, 20) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration21.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration21.kt index e7914d7d6..832a9d66b 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration21.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration21.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration21 : Migration(20, 21) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration22.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration22.kt index 3564f185f..01cfb9727 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration22.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration22.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration22 : Migration(21, 22) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration23.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration23.kt index 536622d47..c0080e15a 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration23.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration23.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration import de.dreier.mytargets.shared.SharedApplicationInstance import de.dreier.mytargets.utils.moveTo import java.io.File diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration24.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration24.kt index 07bafaf91..23994048e 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration24.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration24.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration24 : Migration(23, 24) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration25.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration25.kt index ea41c8a00..f080383dd 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration25.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration25.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration25 : Migration(24, 25) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration26.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration26.kt index d417e4046..96869f7ac 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration26.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration26.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration import android.database.Cursor import de.dreier.mytargets.shared.models.Dimension import de.dreier.mytargets.shared.models.Target diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration3.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration3.kt index a9fa7fdb9..2fd0c0009 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration3.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration3.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration3 : Migration(2, 3) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration4.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration4.kt index 4a0b2a9fc..c6e9ad670 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration4.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration4.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration4 : Migration(3, 4) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration5.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration5.kt index 206ec5bb9..300b61eae 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration5.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration5.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration5 : Migration(4, 5) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration6.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration6.kt index 21217a19e..4f7b469ed 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration6.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration6.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration import de.dreier.mytargets.shared.SharedApplicationInstance import java.io.File import java.io.IOException diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration7.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration7.kt index d67b500eb..5f8cb9a68 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration7.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration7.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration7 : Migration(6, 7) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration8.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration8.kt index bec0bcca8..4a8f905e9 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration8.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration8.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration object Migration8 : Migration(7, 8) { override fun migrate(database: SupportSQLiteDatabase) { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration9.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration9.kt index 081e9e921..b58061613 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration9.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/Migration9.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.migration.Migration +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.migration.Migration import android.content.ContentValues import android.database.Cursor import android.database.sqlite.SQLiteDatabase.* diff --git a/app/src/main/java/de/dreier/mytargets/base/db/migrations/RoomCreationCallback.kt b/app/src/main/java/de/dreier/mytargets/base/db/migrations/RoomCreationCallback.kt index c2c8b298d..5eadeb0bf 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/migrations/RoomCreationCallback.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/migrations/RoomCreationCallback.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.db.migrations -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.room.RoomDatabase +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.room.RoomDatabase import de.dreier.mytargets.base.db.StandardRoundFactory import de.dreier.mytargets.shared.models.db.RoundTemplate import de.dreier.mytargets.shared.models.db.StandardRound diff --git a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/BitmapConverters.kt b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/BitmapConverters.kt index b4432c12c..37e22149a 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/BitmapConverters.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/BitmapConverters.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.typeconverters -import android.arch.persistence.room.TypeConverter +import androidx.room.TypeConverter import android.graphics.Bitmap import android.graphics.BitmapFactory import de.dreier.mytargets.shared.utils.toByteArray diff --git a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/DimensionConverter.kt b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/DimensionConverter.kt index e7ca73eea..304741771 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/DimensionConverter.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/DimensionConverter.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.typeconverters -import android.arch.persistence.room.TypeConverter +import androidx.room.TypeConverter import de.dreier.mytargets.shared.models.Dimension class DimensionConverters { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/EBowTypeConverters.kt b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/EBowTypeConverters.kt index 48ba9cf47..9f2e272b0 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/EBowTypeConverters.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/EBowTypeConverters.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.typeconverters -import android.arch.persistence.room.TypeConverter +import androidx.room.TypeConverter import de.dreier.mytargets.shared.models.EBowType class EBowTypeConverters { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/EWeatherConverters.kt b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/EWeatherConverters.kt index 2f090f5a7..94f3976bb 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/EWeatherConverters.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/EWeatherConverters.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.typeconverters -import android.arch.persistence.room.TypeConverter +import androidx.room.TypeConverter import de.dreier.mytargets.shared.models.EWeather class EWeatherConverters { diff --git a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/LocalDateConverters.kt b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/LocalDateConverters.kt index 199b65922..ea0d4533d 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/LocalDateConverters.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/LocalDateConverters.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.typeconverters -import android.arch.persistence.room.TypeConverter +import androidx.room.TypeConverter import org.threeten.bp.LocalDate import org.threeten.bp.format.DateTimeFormatter diff --git a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/LocalTimeConverters.kt b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/LocalTimeConverters.kt index b196ad572..68b3dac9e 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/LocalTimeConverters.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/LocalTimeConverters.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.typeconverters -import android.arch.persistence.room.TypeConverter +import androidx.room.TypeConverter import org.threeten.bp.LocalTime import org.threeten.bp.format.DateTimeFormatter diff --git a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/ThumbnailConverters.kt b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/ThumbnailConverters.kt index e139719f3..ca373422e 100644 --- a/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/ThumbnailConverters.kt +++ b/app/src/main/java/de/dreier/mytargets/base/db/typeconverters/ThumbnailConverters.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.db.typeconverters -import android.arch.persistence.room.TypeConverter +import androidx.room.TypeConverter import de.dreier.mytargets.shared.models.Thumbnail class ThumbnailConverters { diff --git a/app/src/main/java/de/dreier/mytargets/base/fragments/EditWithImageFragmentBase.kt b/app/src/main/java/de/dreier/mytargets/base/fragments/EditWithImageFragmentBase.kt index c1d72e9b0..01dd6e671 100644 --- a/app/src/main/java/de/dreier/mytargets/base/fragments/EditWithImageFragmentBase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/fragments/EditWithImageFragmentBase.kt @@ -18,17 +18,17 @@ package de.dreier.mytargets.base.fragments import android.Manifest import android.annotation.SuppressLint import android.content.Intent -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.annotation.CallSuper -import android.support.design.widget.AppBarLayout -import android.support.design.widget.CoordinatorLayout -import android.support.v7.widget.PopupMenu +import androidx.annotation.CallSuper +import androidx.coordinatorlayout.widget.CoordinatorLayout +import androidx.appcompat.widget.PopupMenu import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.EditText import com.evernote.android.state.State +import com.google.android.material.appbar.AppBarLayout import com.squareup.picasso.Picasso import de.dreier.mytargets.R import de.dreier.mytargets.databinding.FragmentEditImageBinding @@ -145,7 +145,7 @@ abstract class EditWithImageFragmentBase protected constructor( @NeedsPermission(Manifest.permission.CAMERA) internal fun onTakePicture() { - EasyImage.openCamera(this, 0) + EasyImage.openCameraForImage(this, 0) } @NeedsPermission(Manifest.permission.READ_EXTERNAL_STORAGE) @@ -180,7 +180,7 @@ abstract class EditWithImageFragmentBase protected constructor( override fun onCanceled(source: EasyImage.ImageSource?, type: Int) { //Cancel handling, you might wanna remove taken photo if it was canceled - if (source == EasyImage.ImageSource.CAMERA) { + if (source == EasyImage.ImageSource.CAMERA_IMAGE) { val photoFile = EasyImage.lastlyTakenButCanceledPhoto(context!!) photoFile?.delete() } diff --git a/app/src/main/java/de/dreier/mytargets/base/fragments/EditableListFragmentBase.kt b/app/src/main/java/de/dreier/mytargets/base/fragments/EditableListFragmentBase.kt index d931b76c4..e80598c04 100644 --- a/app/src/main/java/de/dreier/mytargets/base/fragments/EditableListFragmentBase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/fragments/EditableListFragmentBase.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.base.fragments import android.os.Bundle -import android.support.annotation.PluralsRes -import android.support.design.widget.Snackbar +import androidx.annotation.PluralsRes +import com.google.android.material.snackbar.Snackbar import android.view.View import com.google.firebase.analytics.FirebaseAnalytics import de.dreier.mytargets.R diff --git a/app/src/main/java/de/dreier/mytargets/base/fragments/FragmentBase.kt b/app/src/main/java/de/dreier/mytargets/base/fragments/FragmentBase.kt index 5411c49a4..cf2a95545 100644 --- a/app/src/main/java/de/dreier/mytargets/base/fragments/FragmentBase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/fragments/FragmentBase.kt @@ -17,12 +17,12 @@ package de.dreier.mytargets.base.fragments import android.annotation.SuppressLint import android.os.Bundle -import android.support.annotation.UiThread -import android.support.annotation.WorkerThread -import android.support.v4.app.Fragment -import android.support.v4.app.LoaderManager -import android.support.v4.content.AsyncTaskLoader -import android.support.v4.content.Loader +import androidx.annotation.UiThread +import androidx.annotation.WorkerThread +import androidx.fragment.app.Fragment +import androidx.loader.app.LoaderManager +import androidx.loader.content.AsyncTaskLoader +import androidx.loader.content.Loader import de.dreier.mytargets.base.navigation.NavigationController diff --git a/app/src/main/java/de/dreier/mytargets/base/fragments/ItemActionModeCallback.kt b/app/src/main/java/de/dreier/mytargets/base/fragments/ItemActionModeCallback.kt index d15aa5443..7f8b9107d 100644 --- a/app/src/main/java/de/dreier/mytargets/base/fragments/ItemActionModeCallback.kt +++ b/app/src/main/java/de/dreier/mytargets/base/fragments/ItemActionModeCallback.kt @@ -15,9 +15,9 @@ package de.dreier.mytargets.base.fragments -import android.support.annotation.PluralsRes -import android.support.v7.app.AppCompatActivity -import android.support.v7.view.ActionMode +import androidx.annotation.PluralsRes +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.view.ActionMode import android.view.Menu import android.view.MenuItem import de.dreier.mytargets.R diff --git a/app/src/main/java/de/dreier/mytargets/base/fragments/SelectItemFragmentBase.kt b/app/src/main/java/de/dreier/mytargets/base/fragments/SelectItemFragmentBase.kt index 7ba86e9b9..3c10d256f 100644 --- a/app/src/main/java/de/dreier/mytargets/base/fragments/SelectItemFragmentBase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/fragments/SelectItemFragmentBase.kt @@ -17,8 +17,8 @@ package de.dreier.mytargets.base.fragments import android.os.Bundle import android.os.Parcelable -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import com.evernote.android.state.State import de.dreier.mytargets.base.adapters.ListAdapterBase import de.dreier.mytargets.shared.models.IIdProvider diff --git a/app/src/main/java/de/dreier/mytargets/base/fragments/SelectPureListItemFragmentBase.kt b/app/src/main/java/de/dreier/mytargets/base/fragments/SelectPureListItemFragmentBase.kt index f0b2ff220..6d09c28bd 100644 --- a/app/src/main/java/de/dreier/mytargets/base/fragments/SelectPureListItemFragmentBase.kt +++ b/app/src/main/java/de/dreier/mytargets/base/fragments/SelectPureListItemFragmentBase.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.fragments -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.graphics.drawable.Drawable import android.os.Bundle import android.os.Parcelable diff --git a/app/src/main/java/de/dreier/mytargets/base/gallery/CustomViewPager.kt b/app/src/main/java/de/dreier/mytargets/base/gallery/CustomViewPager.kt index cbc237adb..86c267a7b 100755 --- a/app/src/main/java/de/dreier/mytargets/base/gallery/CustomViewPager.kt +++ b/app/src/main/java/de/dreier/mytargets/base/gallery/CustomViewPager.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.base.gallery import android.content.Context -import android.support.v4.view.ViewPager +import androidx.viewpager.widget.ViewPager import android.util.AttributeSet import android.view.MotionEvent diff --git a/app/src/main/java/de/dreier/mytargets/base/gallery/GalleryActivity.kt b/app/src/main/java/de/dreier/mytargets/base/gallery/GalleryActivity.kt index 8aefe81cb..b30932724 100755 --- a/app/src/main/java/de/dreier/mytargets/base/gallery/GalleryActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/base/gallery/GalleryActivity.kt @@ -18,13 +18,13 @@ package de.dreier.mytargets.base.gallery import android.Manifest import android.annotation.SuppressLint import android.content.Intent -import android.databinding.DataBindingUtil import android.os.AsyncTask import android.os.Bundle -import android.support.v4.view.ViewPager -import android.support.v7.widget.LinearLayoutManager import android.view.Menu import android.view.MenuItem +import androidx.databinding.DataBindingUtil +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.viewpager.widget.ViewPager import com.afollestad.materialdialogs.MaterialDialog import com.evernote.android.state.State import de.dreier.mytargets.R @@ -173,7 +173,7 @@ class GalleryActivity : ChildActivityBase() { @NeedsPermission(Manifest.permission.CAMERA) internal fun onTakePicture() { - EasyImage.openCamera(this, 0) + EasyImage.openCameraForImage(this, 0) } @NeedsPermission(Manifest.permission.READ_EXTERNAL_STORAGE) @@ -206,7 +206,7 @@ class GalleryActivity : ChildActivityBase() { override fun onCanceled(source: EasyImage.ImageSource?, type: Int) { //Cancel handling, you might wanna remove taken photo if it was canceled - if (source == EasyImage.ImageSource.CAMERA) { + if (source == EasyImage.ImageSource.CAMERA_IMAGE) { val photoFile = EasyImage .lastlyTakenButCanceledPhoto(applicationContext) photoFile?.delete() diff --git a/app/src/main/java/de/dreier/mytargets/base/gallery/HorizontalImageViewHolder.kt b/app/src/main/java/de/dreier/mytargets/base/gallery/HorizontalImageViewHolder.kt index 7a2ed033f..890245e8e 100755 --- a/app/src/main/java/de/dreier/mytargets/base/gallery/HorizontalImageViewHolder.kt +++ b/app/src/main/java/de/dreier/mytargets/base/gallery/HorizontalImageViewHolder.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.base.gallery -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import android.widget.ImageView diff --git a/app/src/main/java/de/dreier/mytargets/base/gallery/adapters/HorizontalListAdapters.kt b/app/src/main/java/de/dreier/mytargets/base/gallery/adapters/HorizontalListAdapters.kt index 98972be2b..ca747e234 100755 --- a/app/src/main/java/de/dreier/mytargets/base/gallery/adapters/HorizontalListAdapters.kt +++ b/app/src/main/java/de/dreier/mytargets/base/gallery/adapters/HorizontalListAdapters.kt @@ -18,7 +18,7 @@ package de.dreier.mytargets.base.gallery.adapters import android.app.Activity import android.graphics.ColorMatrix import android.graphics.ColorMatrixColorFilter -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/base/gallery/adapters/ViewPagerAdapter.kt b/app/src/main/java/de/dreier/mytargets/base/gallery/adapters/ViewPagerAdapter.kt index 23c06e950..1c82d45bb 100755 --- a/app/src/main/java/de/dreier/mytargets/base/gallery/adapters/ViewPagerAdapter.kt +++ b/app/src/main/java/de/dreier/mytargets/base/gallery/adapters/ViewPagerAdapter.kt @@ -16,9 +16,9 @@ package de.dreier.mytargets.base.gallery.adapters import android.app.Activity -import android.support.v4.view.PagerAdapter -import android.support.v7.widget.RecyclerView -import android.support.v7.widget.Toolbar +import androidx.viewpager.widget.PagerAdapter +import androidx.recyclerview.widget.RecyclerView +import androidx.appcompat.widget.Toolbar import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/base/navigation/NavigationController.kt b/app/src/main/java/de/dreier/mytargets/base/navigation/NavigationController.kt index c450fb54c..80153a0e7 100644 --- a/app/src/main/java/de/dreier/mytargets/base/navigation/NavigationController.kt +++ b/app/src/main/java/de/dreier/mytargets/base/navigation/NavigationController.kt @@ -18,10 +18,10 @@ package de.dreier.mytargets.base.navigation import android.app.Activity import android.content.Intent import android.os.Parcelable -import android.support.design.widget.FloatingActionButton -import android.support.v4.app.Fragment -import android.support.v7.app.AppCompatActivity -import android.support.v7.preference.PreferenceFragmentCompat +import androidx.fragment.app.Fragment +import androidx.appcompat.app.AppCompatActivity +import androidx.preference.PreferenceFragmentCompat +import com.google.android.material.floatingactionbutton.FloatingActionButton import de.dreier.mytargets.R import de.dreier.mytargets.base.fragments.EditableListFragmentBase import de.dreier.mytargets.base.gallery.GalleryActivity diff --git a/app/src/main/java/de/dreier/mytargets/base/viewmodel/ViewModelFactory.kt b/app/src/main/java/de/dreier/mytargets/base/viewmodel/ViewModelFactory.kt index c0a37909e..c567280f8 100644 --- a/app/src/main/java/de/dreier/mytargets/base/viewmodel/ViewModelFactory.kt +++ b/app/src/main/java/de/dreier/mytargets/base/viewmodel/ViewModelFactory.kt @@ -16,8 +16,8 @@ package de.dreier.mytargets.base.viewmodel import android.app.Application -import android.arch.lifecycle.ViewModel -import android.arch.lifecycle.ViewModelProvider +import androidx.lifecycle.ViewModel +import androidx.lifecycle.ViewModelProvider import de.dreier.mytargets.features.arrows.ArrowListViewModel import de.dreier.mytargets.features.arrows.EditArrowViewModel import de.dreier.mytargets.features.distance.DistancesViewModel diff --git a/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListActivity.kt b/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListActivity.kt index f7711a1dc..22fb6966c 100644 --- a/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.arrows -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase class ArrowListActivity : SimpleFragmentActivityBase() { diff --git a/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListFragment.kt b/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListFragment.kt index e25ce913d..3c59f11ee 100644 --- a/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListFragment.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.features.arrows -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders import android.os.Bundle import de.dreier.mytargets.base.fragments.SelectPureListItemFragmentBase import de.dreier.mytargets.base.navigation.NavigationController.Companion.ITEM diff --git a/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListViewModel.kt b/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListViewModel.kt index cf854b9b3..5654ffe5b 100644 --- a/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListViewModel.kt +++ b/app/src/main/java/de/dreier/mytargets/features/arrows/ArrowListViewModel.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.features.arrows import android.app.Application -import android.arch.lifecycle.AndroidViewModel +import androidx.lifecycle.AndroidViewModel import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.shared.models.db.Arrow diff --git a/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowActivity.kt b/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowActivity.kt index 69af2ab29..f5e0949ff 100644 --- a/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.arrows -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase diff --git a/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowFragment.kt b/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowFragment.kt index ee1b72ed5..a9b55315b 100644 --- a/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowFragment.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.features.arrows -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders import android.os.Bundle import android.view.LayoutInflater import android.view.View diff --git a/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowListFragment.kt b/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowListFragment.kt index e9a8b1509..8374d5a2c 100644 --- a/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowListFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowListFragment.kt @@ -15,11 +15,11 @@ package de.dreier.mytargets.features.arrows -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders -import android.databinding.DataBindingUtil +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.annotation.CallSuper +import androidx.annotation.CallSuper import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowViewModel.kt b/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowViewModel.kt index 086496224..5bf6bf8ef 100644 --- a/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowViewModel.kt +++ b/app/src/main/java/de/dreier/mytargets/features/arrows/EditArrowViewModel.kt @@ -16,14 +16,14 @@ package de.dreier.mytargets.features.arrows import android.app.Application -import android.arch.lifecycle.AndroidViewModel -import android.arch.lifecycle.LiveData -import android.arch.lifecycle.MutableLiveData -import android.arch.lifecycle.Transformations -import android.databinding.ObservableBoolean -import android.databinding.ObservableField -import android.databinding.ObservableFloat -import android.databinding.ObservableInt +import androidx.lifecycle.AndroidViewModel +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.Transformations +import androidx.databinding.ObservableBoolean +import androidx.databinding.ObservableField +import androidx.databinding.ObservableFloat +import androidx.databinding.ObservableInt import android.text.TextUtils import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance diff --git a/app/src/main/java/de/dreier/mytargets/features/bows/BowListActivity.kt b/app/src/main/java/de/dreier/mytargets/features/bows/BowListActivity.kt index dc94c8019..6c407af00 100644 --- a/app/src/main/java/de/dreier/mytargets/features/bows/BowListActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/bows/BowListActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.bows -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase class BowListActivity : SimpleFragmentActivityBase() { diff --git a/app/src/main/java/de/dreier/mytargets/features/bows/EditBowActivity.kt b/app/src/main/java/de/dreier/mytargets/features/bows/EditBowActivity.kt index a73931fec..27f0c63ae 100644 --- a/app/src/main/java/de/dreier/mytargets/features/bows/EditBowActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/bows/EditBowActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.bows -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase diff --git a/app/src/main/java/de/dreier/mytargets/features/bows/EditBowFragment.kt b/app/src/main/java/de/dreier/mytargets/features/bows/EditBowFragment.kt index b5825bcae..ba7502800 100644 --- a/app/src/main/java/de/dreier/mytargets/features/bows/EditBowFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/bows/EditBowFragment.kt @@ -18,7 +18,7 @@ package de.dreier.mytargets.features.bows import android.app.Activity import android.content.Intent import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.text.Editable import android.text.TextWatcher import android.view.LayoutInflater diff --git a/app/src/main/java/de/dreier/mytargets/features/bows/EditBowListFragment.kt b/app/src/main/java/de/dreier/mytargets/features/bows/EditBowListFragment.kt index 4f09bac04..47505d5c1 100644 --- a/app/src/main/java/de/dreier/mytargets/features/bows/EditBowListFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/bows/EditBowListFragment.kt @@ -15,9 +15,9 @@ package de.dreier.mytargets.features.bows -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.annotation.CallSuper +import androidx.annotation.CallSuper import android.util.SparseArray import android.view.LayoutInflater import android.view.View diff --git a/app/src/main/java/de/dreier/mytargets/features/distance/DistanceActivity.kt b/app/src/main/java/de/dreier/mytargets/features/distance/DistanceActivity.kt index 930f79658..49fad5407 100644 --- a/app/src/main/java/de/dreier/mytargets/features/distance/DistanceActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/distance/DistanceActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.distance -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase class DistanceActivity : SimpleFragmentActivityBase() { diff --git a/app/src/main/java/de/dreier/mytargets/features/distance/DistanceFragment.kt b/app/src/main/java/de/dreier/mytargets/features/distance/DistanceFragment.kt index 1500fdeb2..6e93b3b23 100644 --- a/app/src/main/java/de/dreier/mytargets/features/distance/DistanceFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/distance/DistanceFragment.kt @@ -15,9 +15,9 @@ package de.dreier.mytargets.features.distance -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/distance/DistanceGridFragment.kt b/app/src/main/java/de/dreier/mytargets/features/distance/DistanceGridFragment.kt index 772d65145..6e1e9b600 100644 --- a/app/src/main/java/de/dreier/mytargets/features/distance/DistanceGridFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/distance/DistanceGridFragment.kt @@ -15,14 +15,14 @@ package de.dreier.mytargets.features.distance -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders -import android.databinding.DataBindingUtil +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.v7.widget.GridLayoutManager import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.recyclerview.widget.GridLayoutManager import de.dreier.mytargets.R import de.dreier.mytargets.base.adapters.SimpleListAdapterBase import de.dreier.mytargets.base.fragments.SelectItemFragmentBase @@ -74,7 +74,7 @@ class DistanceGridFragment : SelectItemFragmentBase() + val printManager = context.getSystemService()!! printManager.print(jobName, pda, PrintAttributes.Builder().build()) } diff --git a/app/src/main/java/de/dreier/mytargets/features/scoreboard/ScoreboardUtils.kt b/app/src/main/java/de/dreier/mytargets/features/scoreboard/ScoreboardUtils.kt index 77aa8e105..fccb651a1 100644 --- a/app/src/main/java/de/dreier/mytargets/features/scoreboard/ScoreboardUtils.kt +++ b/app/src/main/java/de/dreier/mytargets/features/scoreboard/ScoreboardUtils.kt @@ -22,7 +22,7 @@ import android.graphics.Color import android.graphics.Paint import android.os.Build import android.print.PageRange -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.widget.LinearLayout import de.dreier.mytargets.base.db.AppDatabase diff --git a/app/src/main/java/de/dreier/mytargets/features/scoreboard/SignatureDialogFragment.kt b/app/src/main/java/de/dreier/mytargets/features/scoreboard/SignatureDialogFragment.kt index dfaf98564..7c445f18f 100644 --- a/app/src/main/java/de/dreier/mytargets/features/scoreboard/SignatureDialogFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/scoreboard/SignatureDialogFragment.kt @@ -18,7 +18,7 @@ package de.dreier.mytargets.features.scoreboard import android.content.res.Configuration import android.graphics.Bitmap import android.os.Bundle -import android.support.v4.app.DialogFragment +import androidx.fragment.app.DialogFragment import android.text.InputType import android.view.LayoutInflater import android.view.View diff --git a/app/src/main/java/de/dreier/mytargets/features/scoreboard/layout/InfoTableBuilder.kt b/app/src/main/java/de/dreier/mytargets/features/scoreboard/layout/InfoTableBuilder.kt index 730a85dbb..200118f9a 100644 --- a/app/src/main/java/de/dreier/mytargets/features/scoreboard/layout/InfoTableBuilder.kt +++ b/app/src/main/java/de/dreier/mytargets/features/scoreboard/layout/InfoTableBuilder.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.scoreboard.layout -import android.support.annotation.StringRes +import androidx.annotation.StringRes import de.dreier.mytargets.features.scoreboard.builder.model.Table import de.dreier.mytargets.shared.SharedApplicationInstance diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/DatePreference.kt b/app/src/main/java/de/dreier/mytargets/features/settings/DatePreference.kt index b850e79fd..a782b95b0 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/DatePreference.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/DatePreference.kt @@ -17,7 +17,7 @@ package de.dreier.mytargets.features.settings import android.content.Context import android.content.res.TypedArray -import android.support.v7.preference.DialogPreference +import androidx.preference.DialogPreference import android.util.AttributeSet import org.threeten.bp.LocalDate diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/DatePreferenceDialogFragmentCompat.kt b/app/src/main/java/de/dreier/mytargets/features/settings/DatePreferenceDialogFragmentCompat.kt index 312fb6d01..fe51e4fb6 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/DatePreferenceDialogFragmentCompat.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/DatePreferenceDialogFragmentCompat.kt @@ -18,10 +18,10 @@ package de.dreier.mytargets.features.settings import android.app.DatePickerDialog import android.app.Dialog import android.os.Bundle -import android.support.v4.app.DialogFragment -import android.support.v7.preference.DialogPreference -import android.support.v7.preference.Preference -import android.support.v7.preference.PreferenceDialogFragmentCompat +import androidx.fragment.app.DialogFragment +import androidx.preference.DialogPreference +import androidx.preference.Preference +import androidx.preference.PreferenceDialogFragmentCompat import android.widget.DatePicker import org.threeten.bp.LocalDate diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/LanguagePreference.kt b/app/src/main/java/de/dreier/mytargets/features/settings/LanguagePreference.kt index 29b1539f5..5d85567c9 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/LanguagePreference.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/LanguagePreference.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.features.settings import android.content.Context -import android.support.v7.preference.ListPreference +import androidx.preference.ListPreference import android.util.AttributeSet import im.delight.android.languages.LanguageList diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/ProfileSettingsFragment.kt b/app/src/main/java/de/dreier/mytargets/features/settings/ProfileSettingsFragment.kt index 91b5b7ed6..071a291f9 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/ProfileSettingsFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/ProfileSettingsFragment.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.settings -import android.support.v7.preference.Preference +import androidx.preference.Preference class ProfileSettingsFragment : SettingsFragmentBase() { @@ -42,6 +42,6 @@ class ProfileSettingsFragment : SettingsFragmentBase() { companion object { private const val DIALOG_FRAGMENT_TAG = - "android.support.v7.preference.PreferenceFragment.DIALOG" + "androidx.preference.PreferenceFragment.DIALOG" } } diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/SettingsActivity.kt b/app/src/main/java/de/dreier/mytargets/features/settings/SettingsActivity.kt index dd7ab4b90..f06efccfb 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/SettingsActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/SettingsActivity.kt @@ -16,11 +16,12 @@ package de.dreier.mytargets.features.settings import android.os.Bundle -import android.support.v4.app.Fragment -import android.support.v7.preference.PreferenceFragmentCompat -import android.support.v7.preference.PreferenceFragmentCompat.ARG_PREFERENCE_ROOT -import android.support.v7.preference.PreferenceScreen +import androidx.fragment.app.Fragment +import androidx.preference.PreferenceFragmentCompat +import androidx.preference.PreferenceFragmentCompat.ARG_PREFERENCE_ROOT +import androidx.preference.PreferenceScreen import android.view.MenuItem +import androidx.fragment.app.transaction import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase import de.dreier.mytargets.features.settings.ESettingsScreens.MAIN @@ -50,15 +51,15 @@ class SettingsActivity : SimpleFragmentActivityBase(), preferenceFragmentCompat: PreferenceFragmentCompat, preferenceScreen: PreferenceScreen ): Boolean { - val ft = supportFragmentManager.beginTransaction() val screen = ESettingsScreens.from(preferenceScreen.key) val fragment = screen.create() val args = Bundle() args.putString(ARG_PREFERENCE_ROOT, preferenceScreen.key) fragment.arguments = args - ft.add(android.R.id.content, fragment, preferenceScreen.key) - ft.addToBackStack(preferenceScreen.key) - ft.commit() + supportFragmentManager.transaction { + add(android.R.id.content, fragment, preferenceScreen.key) + addToBackStack(preferenceScreen.key) + } return true } @@ -77,7 +78,7 @@ class SettingsActivity : SimpleFragmentActivityBase(), ft.replace( android.R.id.content, instantiateFragment(), - SimpleFragmentActivityBase.Companion.FRAGMENT_TAG + SimpleFragmentActivityBase.FRAGMENT_TAG ) ft.commit() } diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/SettingsFragmentBase.kt b/app/src/main/java/de/dreier/mytargets/features/settings/SettingsFragmentBase.kt index f46240c09..68d9e22c7 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/SettingsFragmentBase.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/SettingsFragmentBase.kt @@ -18,9 +18,9 @@ package de.dreier.mytargets.features.settings import android.annotation.SuppressLint import android.content.SharedPreferences import android.os.Bundle -import android.support.v4.content.ContextCompat -import android.support.v7.preference.ListPreference -import android.support.v7.preference.PreferenceFragmentCompat +import androidx.core.content.ContextCompat +import androidx.preference.ListPreference +import androidx.preference.PreferenceFragmentCompat import android.view.View import de.dreier.mytargets.R import de.dreier.mytargets.shared.SharedApplicationInstance diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/SettingsManager.kt b/app/src/main/java/de/dreier/mytargets/features/settings/SettingsManager.kt index 9f0d69819..001afdb1b 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/SettingsManager.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/SettingsManager.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.settings -import android.support.v4.util.LongSparseArray +import androidx.collection.LongSparseArray import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.features.scoreboard.EFileType import de.dreier.mytargets.features.scoreboard.ScoreboardConfiguration @@ -158,7 +158,7 @@ object SettingsManager { var timerSettings: TimerSettings get() { fun getPrefTime(key: String, def: Int): Int { - return preferences.getString(key, def.toString()).toIntOrNull() ?: def + return preferences.getString(key, def.toString())?.toIntOrNull() ?: def } val settings = TimerSettings() @@ -201,14 +201,14 @@ object SettingsManager { var showMode: ETrainingScope get() = ETrainingScope.valueOf( preferences - .getString(KEY_SHOW_MODE, ETrainingScope.END.toString()) + .getString(KEY_SHOW_MODE, ETrainingScope.END.toString())!! ) set(value) = preferences.set(KEY_SHOW_MODE, value.toString()) var aggregationStrategy: EAggregationStrategy get() = EAggregationStrategy.valueOf( preferences - .getString(KEY_AGGREGATION_STRATEGY, EAggregationStrategy.AVERAGE.toString()) + .getString(KEY_AGGREGATION_STRATEGY, EAggregationStrategy.AVERAGE.toString())!! ) set(value) = preferences.set(KEY_AGGREGATION_STRATEGY, value.toString()) @@ -221,7 +221,7 @@ object SettingsManager { set(value) = preferences.set(KEY_PROFILE_LAST_NAME, value) val profileFullName: String - get() = "%s %s".format(profileFirstName, profileLastName).trim() + get() = "$profileFirstName $profileLastName".trim() var profileClub: String get() = preferences[KEY_PROFILE_CLUB, ""] diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/TimerSettingsFragment.kt b/app/src/main/java/de/dreier/mytargets/features/settings/TimerSettingsFragment.kt index f6c8638b7..535373ae7 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/TimerSettingsFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/TimerSettingsFragment.kt @@ -20,7 +20,7 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter import android.os.Bundle -import android.support.v4.content.LocalBroadcastManager +import androidx.localbroadcastmanager.content.LocalBroadcastManager import de.dreier.mytargets.R import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.shared.wearable.WearableClientBase.Companion.BROADCAST_TIMER_SETTINGS_FROM_REMOTE diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/about/AboutActivity.kt b/app/src/main/java/de/dreier/mytargets/features/settings/about/AboutActivity.kt index c48d03b94..1f11d020b 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/about/AboutActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/about/AboutActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.settings.about -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/about/AboutFragment.kt b/app/src/main/java/de/dreier/mytargets/features/settings/about/AboutFragment.kt index f8a3d8621..fda7ac697 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/about/AboutFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/about/AboutFragment.kt @@ -17,8 +17,8 @@ package de.dreier.mytargets.features.settings.about import android.content.Intent import android.os.Bundle -import android.support.annotation.StringRes -import android.support.v4.app.Fragment +import androidx.annotation.StringRes +import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/about/DonateActivity.kt b/app/src/main/java/de/dreier/mytargets/features/settings/about/DonateActivity.kt index 69a727d93..ac0dec5be 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/about/DonateActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/about/DonateActivity.kt @@ -17,10 +17,10 @@ package de.dreier.mytargets.features.settings.about import android.content.Intent import android.os.Bundle -import android.support.v7.app.AlertDialog -import android.support.v7.app.AppCompatActivity -import android.support.v7.app.AppCompatDelegate -import android.support.v7.widget.LinearLayoutManager +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.app.AppCompatDelegate +import androidx.recyclerview.widget.LinearLayoutManager import com.afollestad.materialdialogs.MaterialDialog import com.anjlab.android.iab.v3.BillingProcessor import com.anjlab.android.iab.v3.TransactionDetails diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/about/DonationAdapter.kt b/app/src/main/java/de/dreier/mytargets/features/settings/about/DonationAdapter.kt index cc61e4d6f..6a5aad017 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/about/DonationAdapter.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/about/DonationAdapter.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.features.settings.about import android.content.Context -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/backup/BackupAdapter.kt b/app/src/main/java/de/dreier/mytargets/features/settings/backup/BackupAdapter.kt index 17e74ebeb..c3784b62a 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/backup/BackupAdapter.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/backup/BackupAdapter.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.features.settings.backup import android.content.Context -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/backup/BackupSettingsFragment.kt b/app/src/main/java/de/dreier/mytargets/features/settings/backup/BackupSettingsFragment.kt index 710619cd1..6c0b09145 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/backup/BackupSettingsFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/backup/BackupSettingsFragment.kt @@ -24,15 +24,15 @@ import android.content.ContentResolver.SYNC_OBSERVER_TYPE_PENDING import android.content.Context import android.content.Intent import android.content.SyncStatusObserver -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.net.Uri import android.os.AsyncTask import android.os.Bundle import android.os.Handler -import android.support.annotation.StringRes -import android.support.v7.app.AppCompatActivity -import android.support.v7.widget.DividerItemDecoration -import android.support.v7.widget.DividerItemDecoration.VERTICAL +import androidx.annotation.StringRes +import androidx.appcompat.app.AppCompatActivity +import androidx.recyclerview.widget.DividerItemDecoration +import androidx.recyclerview.widget.DividerItemDecoration.VERTICAL import android.text.format.DateUtils import android.view.* import android.view.View.GONE @@ -131,7 +131,7 @@ class BackupSettingsFragment : SettingsFragmentBase(), IAsyncBackupRestore.OnLoa binding.backupIntervalPreference.root.setOnClickListener { onBackupIntervalClicked() } binding.backupIntervalPreference.image - .setImageResource(R.drawable.ic_query_builder_grey600_24dp) + .setImageResource(R.drawable.ic_query_builder_grey600_24dp) binding.backupIntervalPreference.name.setText(R.string.backup_interval) updateInterval() diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/backup/EBackupInterval.kt b/app/src/main/java/de/dreier/mytargets/features/settings/backup/EBackupInterval.kt index 842d6f36e..1e9334421 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/backup/EBackupInterval.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/backup/EBackupInterval.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.settings.backup -import android.support.annotation.StringRes +import androidx.annotation.StringRes import de.dreier.mytargets.R import de.dreier.mytargets.shared.SharedApplicationInstance diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/backup/provider/EBackupLocation.kt b/app/src/main/java/de/dreier/mytargets/features/settings/backup/provider/EBackupLocation.kt index 256193fe8..c98d77282 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/backup/provider/EBackupLocation.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/backup/provider/EBackupLocation.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.features.settings.backup.provider -import android.support.annotation.DrawableRes -import android.support.annotation.StringRes +import androidx.annotation.DrawableRes +import androidx.annotation.StringRes import de.dreier.mytargets.R import de.dreier.mytargets.shared.SharedApplicationInstance import de.dreier.mytargets.shared.models.IIdProvider diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/backup/provider/GoogleDriveBackup.kt b/app/src/main/java/de/dreier/mytargets/features/settings/backup/provider/GoogleDriveBackup.kt index a68250606..633153eda 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/backup/provider/GoogleDriveBackup.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/backup/provider/GoogleDriveBackup.kt @@ -78,15 +78,13 @@ object GoogleDriveBackup { override fun getBackups(listener: IAsyncBackupRestore.OnLoadFinishedListener) { val query = Query.Builder() - .addFilter(Filters.eq(SearchableField.MIME_TYPE, MYTARGETS_MIME_TYPE)) - .addFilter(Filters.eq(SearchableField.TRASHED, false)) - .setSortOrder( - SortOrder.Builder() - .addSortDescending(SortableField.MODIFIED_DATE).build() - ) - .build() + .addFilter(Filters.eq(SearchableField.MIME_TYPE, MYTARGETS_MIME_TYPE)) + .addFilter(Filters.eq(SearchableField.TRASHED, false)) + .setSortOrder(SortOrder.Builder() + .addSortDescending(SortableField.MODIFIED_DATE).build()) + .build() Drive.DriveApi.getAppFolder(googleApiClient)!!.queryChildren(googleApiClient, query) - .setResultCallback(object : ResultCallback { + .setResultCallback(object : ResultCallback { private val backupsArray = ArrayList() @@ -204,7 +202,7 @@ object GoogleDriveBackup { // create a file in selected folder val result1 = Drive.DriveApi.getAppFolder(googleApiClient)!! - .createFile(googleApiClient, changeSet, driveContents).await() + .createFile(googleApiClient, changeSet, driveContents).await() if (!result1.status.isSuccess) { throw BackupException(result1.status.statusMessage) } diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncService.java b/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncService.java deleted file mode 100644 index 8f8bf7ae5..000000000 --- a/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncService.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2018 Florian Dreier - * - * This file is part of MyTargets. - * - * MyTargets is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * MyTargets is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -package de.dreier.mytargets.features.settings.backup.synchronization; - -import android.app.Service; -import android.content.Intent; -import android.os.IBinder; -import android.support.annotation.Nullable; - -import timber.log.Timber; - -/** - * Service to handle sync requests. - *

- *

This service is invoked in response to Intents with action android.content.SyncAdapter, and - * returns a Binder connection to SyncAdapter. - *

- *

For performance, only one sync adapter will be initialized within this application's context. - *

- *

Note: The SyncService itself is not notified when a new sync occurs. It's role is to - * manage the lifecycle of our {@link SyncAdapter} and provide a handle to said SyncAdapter to the - * OS on request. - */ -public class SyncService extends Service { - - private static final Object sSyncAdapterLock = new Object(); - @Nullable - private static SyncAdapter sSyncAdapter = null; - - /** - * Thread-safe constructor, creates static {@link SyncAdapter} instance. - */ - @Override - public void onCreate() { - super.onCreate(); - Timber.i("Service created"); - synchronized (sSyncAdapterLock) { - if (sSyncAdapter == null) { - sSyncAdapter = new SyncAdapter(getApplicationContext(), true); - } - } - } - - /** - * Logging-only destructor. - */ - @Override - public void onDestroy() { - super.onDestroy(); - Timber.i("Service destroyed"); - } - - /** - * Return Binder handle for IPC communication with {@link SyncAdapter}. - *

- *

New sync requests will be sent directly to the SyncAdapter using this channel. - * - * @param intent Calling intent - * @return Binder handle for {@link SyncAdapter} - */ - @Override - public IBinder onBind(Intent intent) { - return sSyncAdapter.getSyncAdapterBinder(); - } -} diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncService.kt b/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncService.kt new file mode 100644 index 000000000..e2d3246d1 --- /dev/null +++ b/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncService.kt @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2018 Florian Dreier + * + * This file is part of MyTargets. + * + * MyTargets is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * MyTargets is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +package de.dreier.mytargets.features.settings.backup.synchronization + +import android.app.Service +import android.content.Intent +import android.os.IBinder +import timber.log.Timber + +/** + * Service to handle sync requests. + * + * + * + * This service is invoked in response to Intents with action android.content.SyncAdapter, and + * returns a Binder connection to SyncAdapter. + * + * + * + * For performance, only one sync adapter will be initialized within this application's context. + * + * + * + * Note: The SyncService itself is not notified when a new sync occurs. It's role is to + * manage the lifecycle of our [SyncAdapter] and provide a handle to said SyncAdapter to the + * OS on request. + */ +class SyncService : Service() { + + /** + * Thread-safe constructor, creates static [SyncAdapter] instance. + */ + override fun onCreate() { + super.onCreate() + Timber.i("Service created") + synchronized(sSyncAdapterLock) { + if (sSyncAdapter == null) { + sSyncAdapter = SyncAdapter(applicationContext, true) + } + } + } + + /** + * Logging-only destructor. + */ + override fun onDestroy() { + super.onDestroy() + Timber.i("Service destroyed") + } + + /** + * Return Binder handle for IPC communication with [SyncAdapter]. + * + * + * + * New sync requests will be sent directly to the SyncAdapter using this channel. + * + * @param intent Calling intent + * @return Binder handle for [SyncAdapter] + */ + override fun onBind(intent: Intent): IBinder? { + return sSyncAdapter!!.syncAdapterBinder + } + + companion object { + private val sSyncAdapterLock = Any() + private var sSyncAdapter: SyncAdapter? = null + } +} diff --git a/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncUtils.kt b/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncUtils.kt index ccda0c214..f381ec00c 100644 --- a/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncUtils.kt +++ b/app/src/main/java/de/dreier/mytargets/features/settings/backup/synchronization/SyncUtils.kt @@ -19,7 +19,7 @@ import android.accounts.AccountManager import android.content.ContentResolver import android.content.Context import android.os.Bundle -import androidx.core.content.systemService +import androidx.core.content.getSystemService import de.dreier.mytargets.BuildConfig import de.dreier.mytargets.features.settings.SettingsManager @@ -57,7 +57,7 @@ object SyncUtils { fun createSyncAccount(context: Context) { // Create account, if it's missing. (Either first run, or user has deleted account.) val account = GenericAccountService.account - val accountManager = context.systemService() + val accountManager = context.getSystemService()!! if (accountManager.addAccountExplicitly(account, null, null)) { // Inform the system that this account supports sync ContentResolver.setIsSyncable(account, CONTENT_AUTHORITY, 1) diff --git a/app/src/main/java/de/dreier/mytargets/features/statistics/DispersionPatternActivity.kt b/app/src/main/java/de/dreier/mytargets/features/statistics/DispersionPatternActivity.kt index 6f5d87f84..46ce2390b 100644 --- a/app/src/main/java/de/dreier/mytargets/features/statistics/DispersionPatternActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/statistics/DispersionPatternActivity.kt @@ -16,16 +16,16 @@ package de.dreier.mytargets.features.statistics import android.content.Intent -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Build import android.os.Bundle import android.print.PrintAttributes import android.print.PrintManager -import android.support.annotation.RequiresApi -import android.support.design.widget.Snackbar +import androidx.annotation.RequiresApi import android.view.Menu import android.view.MenuItem -import androidx.core.content.systemService +import androidx.core.content.getSystemService +import com.google.android.material.snackbar.Snackbar import de.dreier.mytargets.R import de.dreier.mytargets.base.activities.ChildActivityBase import de.dreier.mytargets.databinding.ActivityArrowRankingDetailsBinding @@ -119,7 +119,7 @@ class DispersionPatternActivity : ChildActivityBase() { val pda = CustomPrintDocumentAdapter(DrawableToPdfWriter(target), fileName) // Create a print job with name and adapter instance - val printManager = systemService() + val printManager = getSystemService()!! val jobName = "Dispersion Pattern" printManager.print(jobName, pda, PrintAttributes.Builder().build()) } diff --git a/app/src/main/java/de/dreier/mytargets/features/statistics/DispersionPatternUtils.kt b/app/src/main/java/de/dreier/mytargets/features/statistics/DispersionPatternUtils.kt index 329eaffb5..85cb20905 100644 --- a/app/src/main/java/de/dreier/mytargets/features/statistics/DispersionPatternUtils.kt +++ b/app/src/main/java/de/dreier/mytargets/features/statistics/DispersionPatternUtils.kt @@ -21,7 +21,7 @@ import android.graphics.Color import android.graphics.Rect import android.os.Build import android.print.PageRange -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import de.dreier.mytargets.features.settings.SettingsManager import de.dreier.mytargets.shared.targets.drawable.TargetImpactAggregationDrawable import de.dreier.mytargets.utils.print.CustomPrintDocumentAdapter diff --git a/app/src/main/java/de/dreier/mytargets/features/statistics/StatisticsActivity.kt b/app/src/main/java/de/dreier/mytargets/features/statistics/StatisticsActivity.kt index 0d74575cd..8fc62f273 100644 --- a/app/src/main/java/de/dreier/mytargets/features/statistics/StatisticsActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/statistics/StatisticsActivity.kt @@ -20,15 +20,15 @@ import android.app.LoaderManager import android.content.AsyncTaskLoader import android.content.Intent import android.content.Loader -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.net.Uri import android.os.AsyncTask import android.os.Bundle -import android.support.design.widget.Snackbar -import android.support.v4.app.Fragment -import android.support.v4.app.FragmentManager -import android.support.v4.app.FragmentStatePagerAdapter -import android.support.v4.view.GravityCompat.END +import com.google.android.material.snackbar.Snackbar +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentStatePagerAdapter +import androidx.core.view.GravityCompat.END import android.view.Menu import android.view.MenuItem import com.afollestad.materialdialogs.MaterialDialog @@ -101,7 +101,7 @@ class StatisticsActivity : ChildActivityBase(), .distinct() .map { id -> Pair(id, trainingDAO.loadTraining(id)) } .toSparseArray() - return rounds.map { round -> Pair(trainingsMap.get(round.trainingId!!), round) } + return rounds.map { round -> Pair(trainingsMap.get(round.trainingId!!)!!, round) } } } } diff --git a/app/src/main/java/de/dreier/mytargets/features/statistics/StatisticsFragment.kt b/app/src/main/java/de/dreier/mytargets/features/statistics/StatisticsFragment.kt index f17ccee3e..c0d9f0051 100644 --- a/app/src/main/java/de/dreier/mytargets/features/statistics/StatisticsFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/statistics/StatisticsFragment.kt @@ -16,13 +16,13 @@ package de.dreier.mytargets.features.statistics import android.content.IntentFilter -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.graphics.Canvas import android.graphics.Paint import android.os.Bundle -import android.support.v4.content.ContextCompat -import android.support.v4.content.LocalBroadcastManager -import android.support.v7.widget.RecyclerView +import androidx.core.content.ContextCompat +import androidx.localbroadcastmanager.content.LocalBroadcastManager +import androidx.recyclerview.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/statistics/Tag.kt b/app/src/main/java/de/dreier/mytargets/features/statistics/Tag.kt index a7d368c36..92430f327 100644 --- a/app/src/main/java/de/dreier/mytargets/features/statistics/Tag.kt +++ b/app/src/main/java/de/dreier/mytargets/features/statistics/Tag.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.features.statistics import android.content.Context -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.graphics.drawable.Drawable import android.os.Parcelable import android.view.LayoutInflater diff --git a/app/src/main/java/de/dreier/mytargets/features/timer/TimerActivity.kt b/app/src/main/java/de/dreier/mytargets/features/timer/TimerActivity.kt index 17b8464bf..9730a0130 100644 --- a/app/src/main/java/de/dreier/mytargets/features/timer/TimerActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/timer/TimerActivity.kt @@ -15,8 +15,8 @@ package de.dreier.mytargets.features.timer -import android.app.Fragment import android.os.Bundle +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.ChildActivityBase import de.dreier.mytargets.features.settings.SettingsManager import de.dreier.mytargets.utils.Utils @@ -30,14 +30,14 @@ class TimerActivity : ChildActivityBase() { if (savedInstanceState == null) { // Create the fragment only when the activity is created for the first time. // ie. not after orientation changes - childFragment = fragmentManager.findFragmentByTag(FRAGMENT_TAG) + childFragment = supportFragmentManager.findFragmentByTag(FRAGMENT_TAG) if (childFragment == null) { childFragment = instantiateFragment() childFragment?.arguments = intent?.extras } - fragmentManager.beginTransaction() - .replace(android.R.id.content, childFragment, FRAGMENT_TAG) + supportFragmentManager.beginTransaction() + .replace(android.R.id.content, childFragment!!, FRAGMENT_TAG) .commit() } } diff --git a/app/src/main/java/de/dreier/mytargets/features/timer/TimerFragment.kt b/app/src/main/java/de/dreier/mytargets/features/timer/TimerFragment.kt index 3af544f6f..763c085f6 100644 --- a/app/src/main/java/de/dreier/mytargets/features/timer/TimerFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/timer/TimerFragment.kt @@ -15,10 +15,10 @@ package de.dreier.mytargets.features.timer -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.v4.content.ContextCompat -import android.support.v7.app.AppCompatActivity +import androidx.core.content.ContextCompat +import androidx.appcompat.app.AppCompatActivity import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -61,9 +61,9 @@ class TimerFragment : TimerFragmentBase() { override fun applyStatus(status: ETimerState) { binding.root.setBackgroundResource(status.color) if (Utils.isLollipop && activity != null) { - val window = activity.window + val window = activity!!.window window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) - window.statusBarColor = ContextCompat.getColor(activity, status.color) + window.statusBarColor = ContextCompat.getColor(activity!!, status.color) } binding.timerStatus.setText(getStatusText(status)) diff --git a/app/src/main/java/de/dreier/mytargets/features/training/EditRoundActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/EditRoundActivity.kt index 23e87da25..731793e5f 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/EditRoundActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/EditRoundActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase import de.dreier.mytargets.features.rounds.EditRoundFragment diff --git a/app/src/main/java/de/dreier/mytargets/features/training/RoundActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/RoundActivity.kt index 87fe7b8a6..34db8c3d3 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/RoundActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/RoundActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase diff --git a/app/src/main/java/de/dreier/mytargets/features/training/RoundFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/RoundFragment.kt index acb9505fd..630f9fe6b 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/RoundFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/RoundFragment.kt @@ -16,9 +16,9 @@ package de.dreier.mytargets.features.training import android.content.IntentFilter -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.v4.content.LocalBroadcastManager +import androidx.localbroadcastmanager.content.LocalBroadcastManager import android.text.InputType import android.view.* import com.afollestad.materialdialogs.MaterialDialog @@ -102,7 +102,7 @@ class RoundFragment : binding.fab.visibility = View.GONE binding.fab.setOnClickListener { navigationController - .navigateToEditEnd(round!!, binding.recyclerView.adapter.itemCount) + .navigateToEditEnd(round!!, binding.recyclerView.adapter!!.itemCount) .fromFab(binding.fab) .start() } diff --git a/app/src/main/java/de/dreier/mytargets/features/training/TrainingActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/TrainingActivity.kt index 508549650..5b3fccccb 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/TrainingActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/TrainingActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase import de.dreier.mytargets.features.training.details.TrainingFragment diff --git a/app/src/main/java/de/dreier/mytargets/features/training/details/TrainingFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/details/TrainingFragment.kt index 6916fb74e..bde9e294f 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/details/TrainingFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/details/TrainingFragment.kt @@ -15,11 +15,11 @@ package de.dreier.mytargets.features.training.details -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders -import android.databinding.DataBindingUtil +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.annotation.CallSuper +import androidx.annotation.CallSuper import android.text.InputType import android.view.* import com.afollestad.materialdialogs.MaterialDialog diff --git a/app/src/main/java/de/dreier/mytargets/features/training/details/TrainingViewModel.kt b/app/src/main/java/de/dreier/mytargets/features/training/details/TrainingViewModel.kt index d1dea56f5..fbb6cc8ca 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/details/TrainingViewModel.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/details/TrainingViewModel.kt @@ -16,10 +16,10 @@ package de.dreier.mytargets.features.training.details import android.app.Application -import android.arch.lifecycle.AndroidViewModel -import android.arch.lifecycle.LiveData -import android.arch.lifecycle.MutableLiveData -import android.arch.lifecycle.Transformations +import androidx.lifecycle.AndroidViewModel +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.Transformations import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.base.db.RoundRepository import de.dreier.mytargets.shared.models.db.Round diff --git a/app/src/main/java/de/dreier/mytargets/features/training/edit/DatePickerFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/edit/DatePickerFragment.kt index cf18a68df..81fd82241 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/edit/DatePickerFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/edit/DatePickerFragment.kt @@ -18,7 +18,7 @@ package de.dreier.mytargets.features.training.edit import android.app.DatePickerDialog import android.app.Dialog import android.os.Bundle -import android.support.v4.app.DialogFragment +import androidx.fragment.app.DialogFragment import org.threeten.bp.LocalDate class DatePickerFragment : DialogFragment() { diff --git a/app/src/main/java/de/dreier/mytargets/features/training/edit/EditTrainingActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/edit/EditTrainingActivity.kt index fee8b95cc..7980b9fd7 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/edit/EditTrainingActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/edit/EditTrainingActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training.edit -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase diff --git a/app/src/main/java/de/dreier/mytargets/features/training/edit/EditTrainingFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/edit/EditTrainingFragment.kt index dcef774cd..52d470fa0 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/edit/EditTrainingFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/edit/EditTrainingFragment.kt @@ -17,7 +17,7 @@ package de.dreier.mytargets.features.training.edit import android.app.Activity import android.app.DatePickerDialog import android.content.Intent -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle import android.view.LayoutInflater import android.view.View diff --git a/app/src/main/java/de/dreier/mytargets/features/training/environment/Connectivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/environment/Connectivity.kt index 6b8988474..53b1d081b 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/environment/Connectivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/environment/Connectivity.kt @@ -17,8 +17,9 @@ package de.dreier.mytargets.features.training.environment import android.content.Context import android.net.ConnectivityManager +import android.net.NetworkCapabilities import android.net.NetworkInfo -import androidx.core.content.systemService +import androidx.core.content.getSystemService internal object Connectivity { @@ -26,7 +27,7 @@ internal object Connectivity { * Get the network info */ private fun getNetworkInfo(context: Context): NetworkInfo? { - return context.systemService().activeNetworkInfo + return context.getSystemService()?.activeNetworkInfo } /** diff --git a/app/src/main/java/de/dreier/mytargets/features/training/environment/EnvironmentActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/environment/EnvironmentActivity.kt index 3e11cc619..3c3c68522 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/environment/EnvironmentActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/environment/EnvironmentActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training.environment -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.view.MenuItem import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase diff --git a/app/src/main/java/de/dreier/mytargets/features/training/environment/EnvironmentFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/environment/EnvironmentFragment.kt index 276f8f3a7..d1f88829d 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/environment/EnvironmentFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/environment/EnvironmentFragment.kt @@ -15,9 +15,9 @@ package de.dreier.mytargets.features.training.environment import android.content.Intent -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.v7.widget.SwitchCompat +import androidx.appcompat.widget.SwitchCompat import android.view.* import android.view.View.GONE import android.view.View.VISIBLE diff --git a/app/src/main/java/de/dreier/mytargets/features/training/environment/Locator.kt b/app/src/main/java/de/dreier/mytargets/features/training/environment/Locator.kt index 6f5d7a25b..1fdad0334 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/environment/Locator.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/environment/Locator.kt @@ -23,8 +23,8 @@ import android.location.Location import android.location.LocationListener import android.location.LocationManager import android.os.Bundle -import android.support.annotation.RequiresPermission -import androidx.core.content.systemService +import androidx.annotation.RequiresPermission +import androidx.core.content.getSystemService import timber.log.Timber /** @@ -33,7 +33,7 @@ import timber.log.Timber * @author emil http://stackoverflow.com/users/220710/emil */ class Locator(private val context: Context) : LocationListener { - private val locationManager = context.systemService() + private val locationManager = context.getSystemService()!! private var method: Locator.Method? = null private var callback: Locator.Listener? = null @@ -50,8 +50,8 @@ class Locator(private val context: Context) : LocationListener { this.callback = callback when (this.method) { Locator.Method.NETWORK, Locator.Method.NETWORK_THEN_GPS -> { - val networkLocation = locationManager - .getLastKnownLocation(LocationManager.NETWORK_PROVIDER) + val networkLocation = + locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER) if (networkLocation != null) { Timber.d( "Last known location found for network provider : %s", networkLocation diff --git a/app/src/main/java/de/dreier/mytargets/features/training/environment/WindDirectionActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/environment/WindDirectionActivity.kt index 822017515..c13415a50 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/environment/WindDirectionActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/environment/WindDirectionActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training.environment -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase class WindDirectionActivity : SimpleFragmentActivityBase() { diff --git a/app/src/main/java/de/dreier/mytargets/features/training/environment/WindDirectionListFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/environment/WindDirectionListFragment.kt index 430f0fc46..60ec5ce67 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/environment/WindDirectionListFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/environment/WindDirectionListFragment.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.features.training.environment import android.os.Bundle -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/training/environment/WindSpeedActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/environment/WindSpeedActivity.kt index af902909f..72e1429e9 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/environment/WindSpeedActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/environment/WindSpeedActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training.environment -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase class WindSpeedActivity : SimpleFragmentActivityBase() { diff --git a/app/src/main/java/de/dreier/mytargets/features/training/environment/WindSpeedListFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/environment/WindSpeedListFragment.kt index 4d1d2bc42..a1a02896c 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/environment/WindSpeedListFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/environment/WindSpeedListFragment.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.features.training.environment import android.os.Bundle -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/training/input/InputActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/input/InputActivity.kt index 0fde49d96..6d3f13421 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/input/InputActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/input/InputActivity.kt @@ -20,16 +20,16 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.graphics.Color import android.os.Build import android.os.Bundle -import android.support.annotation.RequiresApi -import android.support.v4.app.LoaderManager -import android.support.v4.content.AsyncTaskLoader -import android.support.v4.content.ContextCompat -import android.support.v4.content.Loader -import android.support.v4.content.LocalBroadcastManager +import androidx.annotation.RequiresApi +import androidx.loader.app.LoaderManager +import androidx.loader.content.AsyncTaskLoader +import androidx.core.content.ContextCompat +import androidx.loader.content.Loader +import androidx.localbroadcastmanager.content.LocalBroadcastManager import android.text.InputType import android.transition.Transition import android.view.Menu diff --git a/app/src/main/java/de/dreier/mytargets/features/training/overview/TrainingsFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/overview/TrainingsFragment.kt index 20884a5e7..ff1112ae4 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/overview/TrainingsFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/overview/TrainingsFragment.kt @@ -15,10 +15,10 @@ package de.dreier.mytargets.features.training.overview -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders import android.content.Context -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle import android.view.* import de.dreier.mytargets.R diff --git a/app/src/main/java/de/dreier/mytargets/features/training/overview/TrainingsViewModel.kt b/app/src/main/java/de/dreier/mytargets/features/training/overview/TrainingsViewModel.kt index 5421190b3..50d8207a8 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/overview/TrainingsViewModel.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/overview/TrainingsViewModel.kt @@ -16,8 +16,8 @@ package de.dreier.mytargets.features.training.overview import android.app.Application -import android.arch.lifecycle.AndroidViewModel -import android.arch.lifecycle.LiveData +import androidx.lifecycle.AndroidViewModel +import androidx.lifecycle.LiveData import de.dreier.mytargets.app.ApplicationInstance import de.dreier.mytargets.base.db.RoundRepository import de.dreier.mytargets.base.db.TrainingRepository diff --git a/app/src/main/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundActivity.kt index 2e34eecd9..5aad7028d 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training.standardround -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase diff --git a/app/src/main/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundFragment.kt index c284f473c..9395caa04 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/standardround/EditStandardRoundFragment.kt @@ -16,9 +16,9 @@ package de.dreier.mytargets.features.training.standardround import android.app.Activity import android.content.Intent -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/features/training/standardround/StandardRoundActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/standardround/StandardRoundActivity.kt index 7e6f55675..412c77ea9 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/standardround/StandardRoundActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/standardround/StandardRoundActivity.kt @@ -14,7 +14,7 @@ */ package de.dreier.mytargets.features.training.standardround -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase class StandardRoundActivity : SimpleFragmentActivityBase() { diff --git a/app/src/main/java/de/dreier/mytargets/features/training/standardround/StandardRoundListFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/standardround/StandardRoundListFragment.kt index 695c11417..6f2cde522 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/standardround/StandardRoundListFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/standardround/StandardRoundListFragment.kt @@ -18,13 +18,13 @@ package de.dreier.mytargets.features.training.standardround import android.app.Activity.RESULT_OK import android.content.Context import android.content.Intent -import android.databinding.DataBindingUtil import android.os.Bundle -import android.support.v4.util.LongSparseArray -import android.support.v7.widget.SearchView import android.view.* import android.widget.EditText import android.widget.ImageView +import androidx.appcompat.widget.SearchView +import androidx.collection.LongSparseArray +import androidx.databinding.DataBindingUtil import com.afollestad.materialdialogs.MaterialDialog import com.evernote.android.state.State import de.dreier.mytargets.R diff --git a/app/src/main/java/de/dreier/mytargets/features/training/target/TargetActivity.kt b/app/src/main/java/de/dreier/mytargets/features/training/target/TargetActivity.kt index a5cb2ccbd..e35325217 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/target/TargetActivity.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/target/TargetActivity.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.features.training.target -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import de.dreier.mytargets.base.activities.SimpleFragmentActivityBase class TargetActivity : SimpleFragmentActivityBase() { diff --git a/app/src/main/java/de/dreier/mytargets/features/training/target/TargetListFragment.kt b/app/src/main/java/de/dreier/mytargets/features/training/target/TargetListFragment.kt index c5aaaff37..49a51e23d 100644 --- a/app/src/main/java/de/dreier/mytargets/features/training/target/TargetListFragment.kt +++ b/app/src/main/java/de/dreier/mytargets/features/training/target/TargetListFragment.kt @@ -15,10 +15,10 @@ package de.dreier.mytargets.features.training.target -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Bundle -import android.support.v7.app.AppCompatActivity -import android.support.v7.widget.RecyclerView +import androidx.appcompat.app.AppCompatActivity +import androidx.recyclerview.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/de/dreier/mytargets/utils/DividerItemDecoration.kt b/app/src/main/java/de/dreier/mytargets/utils/DividerItemDecoration.kt index fac5373bc..05d5f74e0 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/DividerItemDecoration.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/DividerItemDecoration.kt @@ -19,9 +19,9 @@ import android.content.Context import android.graphics.Canvas import android.graphics.Rect import android.graphics.drawable.Drawable -import android.support.v4.content.ContextCompat -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView +import androidx.core.content.ContextCompat +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import android.util.AttributeSet import android.view.View diff --git a/app/src/main/java/de/dreier/mytargets/utils/FileUtils.kt b/app/src/main/java/de/dreier/mytargets/utils/FileUtils.kt index a1fd81e12..0dd961e79 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/FileUtils.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/FileUtils.kt @@ -17,7 +17,7 @@ package de.dreier.mytargets.utils import android.content.Context import android.net.Uri -import android.support.v4.content.FileProvider +import androidx.core.content.FileProvider import java.io.File import java.io.IOException diff --git a/app/src/main/java/de/dreier/mytargets/utils/IntentWrapper.kt b/app/src/main/java/de/dreier/mytargets/utils/IntentWrapper.kt index d3f9a4bd7..826b3344e 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/IntentWrapper.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/IntentWrapper.kt @@ -22,8 +22,8 @@ import android.content.ContextWrapper import android.content.Intent import android.os.Bundle import android.os.Parcelable -import android.support.annotation.ColorRes -import android.support.v4.app.Fragment +import androidx.annotation.ColorRes +import androidx.fragment.app.Fragment import android.view.View import de.dreier.mytargets.R import de.dreier.mytargets.utils.transitions.FabTransform diff --git a/app/src/main/java/de/dreier/mytargets/utils/LiveDataUtil2.kt b/app/src/main/java/de/dreier/mytargets/utils/LiveDataUtil2.kt index 6251f809f..62666ec17 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/LiveDataUtil2.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/LiveDataUtil2.kt @@ -15,9 +15,9 @@ package de.dreier.mytargets.utils -import android.arch.lifecycle.LiveData -import android.arch.lifecycle.MediatorLiveData -import android.support.annotation.MainThread +import androidx.lifecycle.LiveData +import androidx.lifecycle.MediatorLiveData +import androidx.annotation.MainThread class LiveDataUtil2 { @@ -88,4 +88,4 @@ class LiveDataUtil2 { }) return result } -} \ No newline at end of file +} diff --git a/app/src/main/java/de/dreier/mytargets/utils/LongSparseArrayUtils.kt b/app/src/main/java/de/dreier/mytargets/utils/LongSparseArrayUtils.kt index 162031984..58c6dc173 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/LongSparseArrayUtils.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/LongSparseArrayUtils.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.utils -import android.support.v4.util.LongSparseArray +import androidx.collection.LongSparseArray inline fun List>.toSparseArray(): LongSparseArray { val array = LongSparseArray(size) @@ -29,7 +29,7 @@ inline fun LongSparseArray.map(transform: (Pair) -> R val list = ArrayList(size()) for (i in 0 until size()) { val key = keyAt(i) - val value = get(key) + val value = get(key)!! list.add(transform.invoke(Pair(key, value))) } return list diff --git a/app/src/main/java/de/dreier/mytargets/utils/MobileWearableClient.kt b/app/src/main/java/de/dreier/mytargets/utils/MobileWearableClient.kt index 86e7d2179..5ffc1ab89 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/MobileWearableClient.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/MobileWearableClient.kt @@ -19,7 +19,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter -import android.support.v4.content.LocalBroadcastManager +import androidx.localbroadcastmanager.content.LocalBroadcastManager import de.dreier.mytargets.features.settings.SettingsManager import de.dreier.mytargets.shared.models.TrainingInfo import de.dreier.mytargets.shared.models.augmented.AugmentedEnd diff --git a/app/src/main/java/de/dreier/mytargets/utils/ScoreUtils.kt b/app/src/main/java/de/dreier/mytargets/utils/ScoreUtils.kt index 4e191e797..20041958c 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/ScoreUtils.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/ScoreUtils.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.utils -import android.support.v4.util.Pair +import androidx.core.util.Pair import de.dreier.mytargets.base.db.dao.EndDAO import de.dreier.mytargets.base.db.dao.RoundDAO import de.dreier.mytargets.shared.models.SelectableZone diff --git a/app/src/main/java/de/dreier/mytargets/utils/SlideInItemAnimator.kt b/app/src/main/java/de/dreier/mytargets/utils/SlideInItemAnimator.kt index 8f87a41cc..fbf76f95d 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/SlideInItemAnimator.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/SlideInItemAnimator.kt @@ -18,9 +18,9 @@ package de.dreier.mytargets.utils import android.animation.Animator import android.animation.AnimatorListenerAdapter import android.os.Handler -import android.support.v4.view.animation.LinearOutSlowInInterpolator -import android.support.v7.widget.DefaultItemAnimator -import android.support.v7.widget.RecyclerView +import androidx.interpolator.view.animation.LinearOutSlowInInterpolator +import androidx.recyclerview.widget.DefaultItemAnimator +import androidx.recyclerview.widget.RecyclerView import android.view.Gravity import android.view.View import java.util.* diff --git a/app/src/main/java/de/dreier/mytargets/utils/ToolbarUtils.kt b/app/src/main/java/de/dreier/mytargets/utils/ToolbarUtils.kt index 5e33dcbb7..3a2f8eaf1 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/ToolbarUtils.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/ToolbarUtils.kt @@ -15,15 +15,12 @@ package de.dreier.mytargets.utils -import android.support.annotation.StringRes -import android.support.v4.app.Fragment -import android.support.v4.view.ViewCompat -import android.support.v7.app.AppCompatActivity -import android.support.v7.widget.Toolbar -import android.widget.TextView +import androidx.annotation.StringRes +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.Toolbar +import androidx.fragment.app.Fragment import de.dreier.mytargets.R - object ToolbarUtils { fun showUpAsX(fragment: Fragment) { @@ -50,18 +47,6 @@ object ToolbarUtils { activity!!.setSupportActionBar(toolbar) } - fun setToolbarTransitionName(toolbar: Toolbar) { - var textViewTitle: TextView? = null - for (i in 0 until toolbar.childCount) { - val view = toolbar.getChildAt(i) - if (view is TextView) { - textViewTitle = view - break - } - } - ViewCompat.setTransitionName(textViewTitle, "title") - } - fun setTitle(fragment: Fragment, @StringRes title: Int) { setTitle((fragment.activity as AppCompatActivity?)!!, title) } diff --git a/app/src/main/java/de/dreier/mytargets/utils/Utils.kt b/app/src/main/java/de/dreier/mytargets/utils/Utils.kt index a4a4e7745..44e1bbb35 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/Utils.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/Utils.kt @@ -26,13 +26,12 @@ import android.graphics.Color import android.os.Build.VERSION import android.os.Build.VERSION_CODES import android.os.Process -import android.support.media.ExifInterface +import androidx.exifinterface.media.ExifInterface import android.text.Html import android.text.Spanned import android.view.View import android.view.WindowManager -import androidx.core.content.systemService -import androidx.core.content.systemService +import androidx.core.content.getSystemService import de.dreier.mytargets.features.main.MainActivity import de.dreier.mytargets.features.training.overview.Header import de.dreier.mytargets.utils.transitions.FabTransform @@ -71,7 +70,7 @@ object Utils { val mPendingIntentId = 223344 val mPendingIntent = PendingIntent .getActivity(context, mPendingIntentId, intent, PendingIntent.FLAG_CANCEL_CURRENT) - context.systemService() + context.getSystemService()!! .set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent) // Kill the application diff --git a/app/src/main/java/de/dreier/mytargets/utils/databinding/DataBindingAdapters.kt b/app/src/main/java/de/dreier/mytargets/utils/databinding/DataBindingAdapters.kt index 0cb6a3a83..a4f099863 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/databinding/DataBindingAdapters.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/databinding/DataBindingAdapters.kt @@ -15,10 +15,10 @@ package de.dreier.mytargets.utils.databinding -import android.databinding.BindingAdapter -import android.support.design.widget.TextInputLayout +import androidx.databinding.BindingAdapter import android.view.View import android.widget.ImageView +import com.google.android.material.textfield.TextInputLayout object DataBindingAdapters { diff --git a/app/src/main/java/de/dreier/mytargets/utils/databinding/SpinnerBindingAdapters.kt b/app/src/main/java/de/dreier/mytargets/utils/databinding/SpinnerBindingAdapters.kt index cb957d038..966fad6ca 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/databinding/SpinnerBindingAdapters.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/databinding/SpinnerBindingAdapters.kt @@ -15,10 +15,10 @@ package de.dreier.mytargets.utils.databinding -import android.databinding.BindingAdapter -import android.databinding.InverseBindingAdapter -import android.databinding.InverseBindingListener -import android.support.v7.widget.AppCompatSpinner +import androidx.databinding.BindingAdapter +import androidx.databinding.InverseBindingAdapter +import androidx.databinding.InverseBindingListener +import androidx.appcompat.widget.AppCompatSpinner import android.view.View import android.widget.AdapterView import android.widget.Spinner diff --git a/app/src/main/java/de/dreier/mytargets/utils/multiselector/ExpandableHeaderBindingHolder.kt b/app/src/main/java/de/dreier/mytargets/utils/multiselector/ExpandableHeaderBindingHolder.kt index 0bf2d0295..68173b2ad 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/multiselector/ExpandableHeaderBindingHolder.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/multiselector/ExpandableHeaderBindingHolder.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.utils.multiselector -import android.support.annotation.IdRes +import androidx.annotation.IdRes import android.view.View import android.view.animation.AccelerateDecelerateInterpolator diff --git a/app/src/main/java/de/dreier/mytargets/utils/multiselector/ItemBindingHolder.kt b/app/src/main/java/de/dreier/mytargets/utils/multiselector/ItemBindingHolder.kt index 9ed54e22a..d1f842160 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/multiselector/ItemBindingHolder.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/multiselector/ItemBindingHolder.kt @@ -15,7 +15,7 @@ package de.dreier.mytargets.utils.multiselector -import android.support.v7.widget.RebindReportingHolder +import androidx.recyclerview.widget.RebindReportingHolder import android.view.View abstract class ItemBindingHolder internal constructor(itemView: View) : diff --git a/app/src/main/java/de/dreier/mytargets/utils/multiselector/SelectorBase.kt b/app/src/main/java/de/dreier/mytargets/utils/multiselector/SelectorBase.kt index bee67a17a..62666f4bf 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/multiselector/SelectorBase.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/multiselector/SelectorBase.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.utils.multiselector import android.os.Bundle -import android.support.annotation.CallSuper +import androidx.annotation.CallSuper abstract class SelectorBase { protected var tracker = WeakHolderTracker() diff --git a/app/src/main/java/de/dreier/mytargets/utils/print/CustomPrintDocumentAdapter.kt b/app/src/main/java/de/dreier/mytargets/utils/print/CustomPrintDocumentAdapter.kt index 7943233ab..0717577bb 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/print/CustomPrintDocumentAdapter.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/print/CustomPrintDocumentAdapter.kt @@ -23,7 +23,7 @@ import android.print.PageRange import android.print.PrintAttributes import android.print.PrintDocumentAdapter import android.print.PrintDocumentInfo -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import java.io.FileOutputStream @RequiresApi(api = Build.VERSION_CODES.KITKAT) diff --git a/app/src/main/java/de/dreier/mytargets/utils/print/DrawableToPdfWriter.kt b/app/src/main/java/de/dreier/mytargets/utils/print/DrawableToPdfWriter.kt index de8d5cc9c..8693c89df 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/print/DrawableToPdfWriter.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/print/DrawableToPdfWriter.kt @@ -23,7 +23,7 @@ import android.graphics.pdf.PdfDocument import android.os.Build import android.print.PageRange import android.print.PrintAttributes -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import de.dreier.mytargets.shared.utils.RectUtils import de.dreier.mytargets.shared.utils.toClosestRect import java.io.IOException diff --git a/app/src/main/java/de/dreier/mytargets/utils/print/ViewToPdfWriter.kt b/app/src/main/java/de/dreier/mytargets/utils/print/ViewToPdfWriter.kt index 58836dbbb..ff5a60de2 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/print/ViewToPdfWriter.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/print/ViewToPdfWriter.kt @@ -21,7 +21,7 @@ import android.graphics.pdf.PdfDocument import android.os.Build import android.print.PageRange import android.print.PrintAttributes -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import android.view.View import android.view.View.MeasureSpec.EXACTLY import android.view.View.MeasureSpec.makeMeasureSpec diff --git a/app/src/main/java/de/dreier/mytargets/utils/transitions/FabTransform.kt b/app/src/main/java/de/dreier/mytargets/utils/transitions/FabTransform.kt index 563eb3f3d..32644a6c4 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/transitions/FabTransform.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/transitions/FabTransform.kt @@ -25,14 +25,14 @@ import android.graphics.Outline import android.graphics.Rect import android.graphics.drawable.ColorDrawable import android.os.Build.VERSION_CODES.LOLLIPOP -import android.support.annotation.ColorInt -import android.support.annotation.ColorRes -import android.support.annotation.DrawableRes -import android.support.annotation.RequiresApi -import android.support.v4.content.ContextCompat -import android.support.v4.view.animation.FastOutLinearInInterpolator -import android.support.v4.view.animation.FastOutSlowInInterpolator -import android.support.v4.view.animation.LinearOutSlowInInterpolator +import androidx.annotation.ColorInt +import androidx.annotation.ColorRes +import androidx.annotation.DrawableRes +import androidx.annotation.RequiresApi +import androidx.core.content.ContextCompat +import androidx.interpolator.view.animation.FastOutLinearInInterpolator +import androidx.interpolator.view.animation.FastOutSlowInInterpolator +import androidx.interpolator.view.animation.LinearOutSlowInInterpolator import android.transition.Transition import android.transition.TransitionValues import android.view.View diff --git a/app/src/main/java/de/dreier/mytargets/utils/transitions/GravityArcMotion.kt b/app/src/main/java/de/dreier/mytargets/utils/transitions/GravityArcMotion.kt index c01d865d4..f2a53659e 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/transitions/GravityArcMotion.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/transitions/GravityArcMotion.kt @@ -17,7 +17,7 @@ package de.dreier.mytargets.utils.transitions import android.graphics.Path import android.os.Build -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import android.transition.ArcMotion /** diff --git a/app/src/main/java/de/dreier/mytargets/utils/transitions/NoPauseAnimator.kt b/app/src/main/java/de/dreier/mytargets/utils/transitions/NoPauseAnimator.kt index 09b8b94ce..4aae096cd 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/transitions/NoPauseAnimator.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/transitions/NoPauseAnimator.kt @@ -18,8 +18,8 @@ package de.dreier.mytargets.utils.transitions import android.animation.Animator import android.animation.TimeInterpolator import android.os.Build -import android.support.annotation.RequiresApi -import android.support.v4.util.ArrayMap +import androidx.annotation.RequiresApi +import androidx.collection.ArrayMap import java.util.* /** diff --git a/app/src/main/java/de/dreier/mytargets/utils/transitions/TransitionAdapter.kt b/app/src/main/java/de/dreier/mytargets/utils/transitions/TransitionAdapter.kt index 4acdbe4f9..b2b62390f 100644 --- a/app/src/main/java/de/dreier/mytargets/utils/transitions/TransitionAdapter.kt +++ b/app/src/main/java/de/dreier/mytargets/utils/transitions/TransitionAdapter.kt @@ -16,7 +16,7 @@ package de.dreier.mytargets.utils.transitions import android.os.Build -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import android.transition.Transition @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) diff --git a/app/src/main/java/de/dreier/mytargets/views/NumberPicker.kt b/app/src/main/java/de/dreier/mytargets/views/NumberPicker.kt index fa5c0831a..670c7c1ad 100644 --- a/app/src/main/java/de/dreier/mytargets/views/NumberPicker.kt +++ b/app/src/main/java/de/dreier/mytargets/views/NumberPicker.kt @@ -16,9 +16,9 @@ package de.dreier.mytargets.views import android.content.Context -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.os.Handler -import android.support.annotation.PluralsRes +import androidx.annotation.PluralsRes import android.util.AttributeSet import android.view.LayoutInflater import android.view.MotionEvent diff --git a/app/src/main/java/de/dreier/mytargets/views/TextInputEditText.kt b/app/src/main/java/de/dreier/mytargets/views/TextInputEditText.kt index ec09f6bed..a8670a406 100644 --- a/app/src/main/java/de/dreier/mytargets/views/TextInputEditText.kt +++ b/app/src/main/java/de/dreier/mytargets/views/TextInputEditText.kt @@ -17,12 +17,13 @@ package de.dreier.mytargets.views import android.content.Context import android.os.Build -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import android.util.AttributeSet import android.view.View +import com.google.android.material.textfield.TextInputEditText -class TextInputEditText : android.support.design.widget.TextInputEditText { +class TextInputEditText : TextInputEditText { constructor(context: Context) : super(context) diff --git a/app/src/main/java/de/dreier/mytargets/views/selector/EnvironmentSelector.kt b/app/src/main/java/de/dreier/mytargets/views/selector/EnvironmentSelector.kt index 06a75fa63..889df32b2 100644 --- a/app/src/main/java/de/dreier/mytargets/views/selector/EnvironmentSelector.kt +++ b/app/src/main/java/de/dreier/mytargets/views/selector/EnvironmentSelector.kt @@ -23,9 +23,9 @@ import android.content.Context import android.content.pm.PackageManager import android.location.Geocoder import android.location.Location -import android.support.annotation.RequiresPermission -import android.support.v4.app.Fragment -import android.support.v4.content.ContextCompat +import androidx.annotation.RequiresPermission +import androidx.fragment.app.Fragment +import androidx.core.content.ContextCompat import android.util.AttributeSet import android.view.View import de.dreier.mytargets.R diff --git a/app/src/main/java/de/dreier/mytargets/views/selector/SelectorBase.kt b/app/src/main/java/de/dreier/mytargets/views/selector/SelectorBase.kt index 1bf0c27a3..15b0cfae5 100644 --- a/app/src/main/java/de/dreier/mytargets/views/selector/SelectorBase.kt +++ b/app/src/main/java/de/dreier/mytargets/views/selector/SelectorBase.kt @@ -18,10 +18,10 @@ package de.dreier.mytargets.views.selector import android.app.Activity import android.content.Context import android.content.Intent -import android.databinding.DataBindingUtil -import android.databinding.ViewDataBinding +import androidx.databinding.DataBindingUtil +import androidx.databinding.ViewDataBinding import android.os.Parcelable -import android.support.annotation.LayoutRes +import androidx.annotation.LayoutRes import android.util.AttributeSet import android.view.LayoutInflater import android.view.View diff --git a/app/src/main/java/de/dreier/mytargets/views/speeddial/FabSpeedDial.kt b/app/src/main/java/de/dreier/mytargets/views/speeddial/FabSpeedDial.kt index 5bcc0ee59..fda4ab960 100755 --- a/app/src/main/java/de/dreier/mytargets/views/speeddial/FabSpeedDial.kt +++ b/app/src/main/java/de/dreier/mytargets/views/speeddial/FabSpeedDial.kt @@ -25,18 +25,16 @@ import android.graphics.drawable.Drawable import android.os.Build import android.os.Parcel import android.os.Parcelable -import android.support.annotation.IdRes -import android.support.design.internal.NavigationMenu -import android.support.design.widget.CoordinatorLayout -import android.support.design.widget.FloatingActionButton -import android.support.v4.content.ContextCompat -import android.support.v4.view.ViewCompat -import android.support.v4.view.ViewPropertyAnimatorListenerAdapter -import android.support.v4.view.animation.FastOutLinearInInterpolator -import android.support.v4.view.animation.FastOutSlowInInterpolator -import android.support.v7.view.SupportMenuInflater -import android.support.v7.view.menu.MenuBuilder -import android.support.v7.widget.CardView +import androidx.annotation.IdRes +import androidx.coordinatorlayout.widget.CoordinatorLayout +import androidx.core.content.ContextCompat +import androidx.core.view.ViewCompat +import androidx.core.view.ViewPropertyAnimatorListenerAdapter +import androidx.interpolator.view.animation.FastOutLinearInInterpolator +import androidx.interpolator.view.animation.FastOutSlowInInterpolator +import androidx.appcompat.view.SupportMenuInflater +import androidx.appcompat.view.menu.MenuBuilder +import androidx.cardview.widget.CardView import android.text.TextUtils import android.util.AndroidRuntimeException import android.util.AttributeSet @@ -45,6 +43,8 @@ import android.widget.FrameLayout import android.widget.LinearLayout import android.widget.RelativeLayout import android.widget.TextView +import com.google.android.material.floatingactionbutton.FloatingActionButton +import com.google.android.material.internal.NavigationMenu import de.dreier.mytargets.R import timber.log.Timber import java.util.* @@ -472,7 +472,7 @@ class FabSpeedDial : LinearLayout, View.OnClickListener, CoordinatorLayout.Attac touchGuard!!.visibility = View.GONE } - ViewCompat.animate(menuItemsLayout) + ViewCompat.animate(menuItemsLayout!!) .setDuration(resources.getInteger(android.R.integer.config_shortAnimTime).toLong()) .alpha(0f) .setInterpolator(FastOutLinearInInterpolator()) diff --git a/app/src/main/java/de/dreier/mytargets/views/speeddial/FabSpeedDialBehaviour.kt b/app/src/main/java/de/dreier/mytargets/views/speeddial/FabSpeedDialBehaviour.kt index bd1bf34da..60f849db3 100755 --- a/app/src/main/java/de/dreier/mytargets/views/speeddial/FabSpeedDialBehaviour.kt +++ b/app/src/main/java/de/dreier/mytargets/views/speeddial/FabSpeedDialBehaviour.kt @@ -15,11 +15,11 @@ package de.dreier.mytargets.views.speeddial -import android.support.design.widget.CoordinatorLayout -import android.support.design.widget.Snackbar -import android.support.v4.view.animation.FastOutSlowInInterpolator +import androidx.coordinatorlayout.widget.CoordinatorLayout +import androidx.interpolator.view.animation.FastOutSlowInInterpolator import android.view.View import android.view.ViewPropertyAnimator +import com.google.android.material.snackbar.Snackbar object FabSpeedDialBehaviour : CoordinatorLayout.Behavior() { diff --git a/app/src/main/res/layout/activity_gallery.xml b/app/src/main/res/layout/activity_gallery.xml index 9931596b5..e28c9451d 100755 --- a/app/src/main/res/layout/activity_gallery.xml +++ b/app/src/main/res/layout/activity_gallery.xml @@ -29,7 +29,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"/> - - - - - + - - - - - + diff --git a/app/src/main/res/layout/activity_statistics.xml b/app/src/main/res/layout/activity_statistics.xml index ac192b9e0..beca09b56 100644 --- a/app/src/main/res/layout/activity_statistics.xml +++ b/app/src/main/res/layout/activity_statistics.xml @@ -23,7 +23,7 @@ android:background="?attr/colorPrimary" android:orientation="vertical"> - - - - - + - - - + - + diff --git a/app/src/main/res/layout/fab_menu_item_end.xml b/app/src/main/res/layout/fab_menu_item_end.xml index cc3a4a5cf..d6cc82114 100755 --- a/app/src/main/res/layout/fab_menu_item_end.xml +++ b/app/src/main/res/layout/fab_menu_item_end.xml @@ -23,7 +23,7 @@ android:layout_marginTop="@dimen/fab_menu_item_margin_top" android:orientation="horizontal"> - - + - - - - @@ -35,7 +35,7 @@ app:image="@{de.dreier.mytargets.R.drawable.ic_arrow_24dp}" app:text="@{de.dreier.mytargets.R.string.no_arrows}"/> - - + diff --git a/app/src/main/res/layout/fragment_backup.xml b/app/src/main/res/layout/fragment_backup.xml index 43b1915ad..0c7b6aa24 100644 --- a/app/src/main/res/layout/fragment_backup.xml +++ b/app/src/main/res/layout/fragment_backup.xml @@ -23,7 +23,7 @@ android:background="#ffffff" android:orientation="vertical"> - @@ -145,7 +145,7 @@ android:layout_gravity="center_horizontal" android:padding="16dp"/> - - + diff --git a/app/src/main/res/layout/fragment_bows.xml b/app/src/main/res/layout/fragment_bows.xml index e9c09c091..b85afadc6 100644 --- a/app/src/main/res/layout/fragment_bows.xml +++ b/app/src/main/res/layout/fragment_bows.xml @@ -16,12 +16,12 @@ - - @@ -41,6 +41,6 @@ app:fabMenu="@menu/fab_bows" app:miniFabBackgroundTint="@color/colorPrimary"/> - + diff --git a/app/src/main/res/layout/fragment_distance.xml b/app/src/main/res/layout/fragment_distance.xml index 38a9d267a..06b243a3b 100644 --- a/app/src/main/res/layout/fragment_distance.xml +++ b/app/src/main/res/layout/fragment_distance.xml @@ -15,7 +15,7 @@ - @@ -24,7 +24,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - - - + diff --git a/app/src/main/res/layout/fragment_edit_arrow.xml b/app/src/main/res/layout/fragment_edit_arrow.xml index 734c4ca68..945931804 100644 --- a/app/src/main/res/layout/fragment_edit_arrow.xml +++ b/app/src/main/res/layout/fragment_edit_arrow.xml @@ -42,7 +42,7 @@ android:contentDescription="@string/name" app:srcCompat="@drawable/ic_title_grey600_24dp"/> - + - + @@ -63,7 +63,7 @@ android:contentDescription="@string/max_arrow_number" app:srcCompat="@drawable/ic_arrow_number_grey600_24dp"/> - @@ -75,7 +75,7 @@ android:inputType="number" android:text="@={`` + arrow.maxArrowNumber}"/> - + @@ -90,7 +90,7 @@ android:contentDescription="@string/length" app:srcCompat="@drawable/ic_arrow_length_grey600_24dp"/> - + - + @@ -115,7 +115,7 @@ android:contentDescription="@string/material" app:srcCompat="@drawable/ic_arrow_material_grey600_24dp"/> - + - + @@ -140,7 +140,7 @@ android:contentDescription="@string/spine" app:srcCompat="@drawable/ic_arrow_spine_grey600_24dp"/> - + - + @@ -167,7 +167,7 @@ android:layout_height="wrap_content" android:orientation="horizontal"> - - + - + - + @@ -235,7 +235,7 @@ android:contentDescription="@string/tip_weight" app:srcCompat="@drawable/ic_arrow_tip_weight_grey600_24dp"/> - + - + @@ -260,7 +260,7 @@ android:contentDescription="@string/vanes" app:srcCompat="@drawable/ic_arrow_vanes_grey600_24dp"/> - + - + @@ -285,7 +285,7 @@ android:contentDescription="@string/nock" app:srcCompat="@drawable/ic_arrow_nock_grey600_24dp"/> - + - + @@ -310,7 +310,7 @@ android:contentDescription="@string/comment" app:srcCompat="@drawable/ic_comment_grey600_24dp"/> - + - + diff --git a/app/src/main/res/layout/fragment_edit_bow.xml b/app/src/main/res/layout/fragment_edit_bow.xml index f073974e4..32b9aa333 100644 --- a/app/src/main/res/layout/fragment_edit_bow.xml +++ b/app/src/main/res/layout/fragment_edit_bow.xml @@ -56,7 +56,7 @@ android:tint="@color/md_grey_600" tools:src="@drawable/ic_bow_recurve_white_24dp"/> - + - + @@ -77,7 +77,7 @@ android:contentDescription="@string/name" app:srcCompat="@drawable/ic_title_grey600_24dp"/> - + - + @@ -98,7 +98,7 @@ android:contentDescription="@string/brand" app:srcCompat="@drawable/ic_brand_grey600_24dp"/> - + - + @@ -123,7 +123,7 @@ android:contentDescription="@string/size" app:srcCompat="@drawable/ic_arrow_length_grey600_24dp"/> - + - + @@ -152,7 +152,7 @@ style="@style/propertyTextInputLayout" android:orientation="vertical"> - - + - - + @@ -205,7 +205,7 @@ style="@style/propertyTextInputLayout" android:orientation="vertical"> - - + - - + - - + - - + @@ -288,7 +288,7 @@ android:contentDescription="@string/bow_cam_settings" app:srcCompat="@drawable/ic_bow_cam_grey600_24dp"/> - + - + @@ -313,7 +313,7 @@ android:contentDescription="@string/tiller" app:srcCompat="@drawable/ic_bow_tiller_grey600_24dp"/> - + - + @@ -338,7 +338,7 @@ android:contentDescription="@string/height" app:srcCompat="@drawable/ic_bow_brace_height_grey600_24dp"/> - + - + @@ -363,7 +363,7 @@ android:contentDescription="@string/limbs" app:srcCompat="@drawable/ic_bow_limb_grey600_24dp"/> - + - + @@ -388,7 +388,7 @@ android:contentDescription="@string/sight" app:srcCompat="@drawable/ic_bow_sight_grey600_24dp"/> - + - + @@ -413,7 +413,7 @@ android:contentDescription="@string/bow_scope_magnification" app:srcCompat="@drawable/ic_bow_scope_magnification_grey600_24dp"/> - + - + @@ -438,7 +438,7 @@ android:contentDescription="@string/stabilizer" app:srcCompat="@drawable/ic_bow_stabilizer_grey600_24dp"/> - + - + @@ -463,7 +463,7 @@ android:contentDescription="@string/clicker" app:srcCompat="@drawable/ic_bow_clicker_grey600_24dp"/> - + - + @@ -488,7 +488,7 @@ android:contentDescription="@string/bow_nocking_point" app:srcCompat="@drawable/ic_bow_nocking_point_grey600_24dp"/> - + - + @@ -513,7 +513,7 @@ android:contentDescription="@string/bow_string" app:srcCompat="@drawable/ic_bow_string_grey600_24dp"/> - + - + @@ -538,7 +538,7 @@ android:contentDescription="@string/bow_button" app:srcCompat="@drawable/ic_bow_button_grey600_24dp"/> - + - + @@ -563,7 +563,7 @@ android:contentDescription="@string/description" app:srcCompat="@drawable/ic_comment_grey600_24dp"/> - + - + @@ -600,7 +600,7 @@ android:padding="16dp" android:text="@string/sight_settings"/> - - - - - - + - + - - + - - + diff --git a/app/src/main/res/layout/fragment_edit_round.xml b/app/src/main/res/layout/fragment_edit_round.xml index 17e692502..1bc662fc2 100644 --- a/app/src/main/res/layout/fragment_edit_round.xml +++ b/app/src/main/res/layout/fragment_edit_round.xml @@ -25,7 +25,7 @@ android:transitionName="@string/transition_root_view" tools:targetApi="lollipop"> - - - - - + - - + diff --git a/app/src/main/res/layout/fragment_edit_training.xml b/app/src/main/res/layout/fragment_edit_training.xml index 0648805ab..4cb4bb461 100644 --- a/app/src/main/res/layout/fragment_edit_training.xml +++ b/app/src/main/res/layout/fragment_edit_training.xml @@ -25,7 +25,7 @@ android:transitionName="@string/transition_root_view" tools:targetApi="lollipop"> - - - - +