From f8ea30d27552bce19dccbeacf75f3b2a2abc2cde Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Sat, 1 Jul 2023 10:09:10 -0500 Subject: [PATCH] Dependency updates 20230630 (#14058) * Bump com.squareup.leakcanary:leakcanary-android from 2.11 to 2.12 Bumps [com.squareup.leakcanary:leakcanary-android](https://github.com/square/leakcanary) from 2.11 to 2.12. - [Release notes](https://github.com/square/leakcanary/releases) - [Changelog](https://github.com/square/leakcanary/blob/main/docs/changelog.md) - [Commits](https://github.com/square/leakcanary/compare/v2.11...v2.12) --- updated-dependencies: - dependency-name: com.squareup.leakcanary:leakcanary-android dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump org.jetbrains.kotlinx:kotlinx-coroutines-test from 1.7.1 to 1.7.2 Bumps [org.jetbrains.kotlinx:kotlinx-coroutines-test](https://github.com/Kotlin/kotlinx.coroutines) from 1.7.1 to 1.7.2. - [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases) - [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md) - [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.7.1...1.7.2) --- updated-dependencies: - dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump com.github.triplet.play from 3.8.3 to 3.8.4 Bumps com.github.triplet.play from 3.8.3 to 3.8.4. --- updated-dependencies: - dependency-name: com.github.triplet.play dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 (#13912) * Bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * build(deps): forward-port BuildConfig / aidl / default-component to gradle 8 * convert to non-transitive R.attr style - directly address the attributes via their specific names - remove an R-containing IntDef since R is no longer constant (the whole UndoAction class will disappear with new backend anyway) * Use attrs directly from `android` Practically, it is a non-functional change, but is is best and more natural to use attrs directly from android instead of using `com.google.android.material` as a intermediate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mike Hardy Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com> --- AnkiDroid/build.gradle | 9 +++++-- .../java/com/ichi2/anki/DeckPickerTest.kt | 2 +- .../main/java/com/ichi2/anki/AnkiActivity.kt | 2 +- .../src/main/java/com/ichi2/anki/Info.kt | 2 +- .../ichi2/anki/NavigationDrawerActivity.kt | 2 +- .../src/main/java/com/ichi2/anki/Reviewer.kt | 4 +-- .../com/ichi2/anki/dialogs/tags/TagsDialog.kt | 2 +- .../main/java/com/ichi2/libanki/UndoAction.kt | 3 --- .../com/ichi2/preferences/HeaderPreference.kt | 4 +-- .../NumberRangePreferenceCompat.kt | 4 +-- .../com/ichi2/preferences/SliderPreference.kt | 8 +++--- .../ichi2/ui/RtlCompliantActionProvider.kt | 2 +- .../java/com/ichi2/anki/RobolectricTest.kt | 2 +- .../anki/dialogs/CustomStudyDialogTest.kt | 2 +- .../DeckPickerContextMenuAndroidTest.kt | 2 +- .../anki/dialogs/DeckPickerContextMenuTest.kt | 4 +-- .../ichi2/anki/dialogs/tags/TagsDialogTest.kt | 26 +++++++++---------- api/build.gradle | 4 +++ build.gradle | 4 +-- gradle.properties | 5 +--- 20 files changed, 48 insertions(+), 45 deletions(-) diff --git a/AnkiDroid/build.gradle b/AnkiDroid/build.gradle index 14c6813ab315..9e549518dfc0 100644 --- a/AnkiDroid/build.gradle +++ b/AnkiDroid/build.gradle @@ -1,6 +1,6 @@ plugins { // Gradle plugin portal - id 'com.github.triplet.play' version '3.8.3' + id 'com.github.triplet.play' version '3.8.4' } apply plugin: 'com.android.application' @@ -30,6 +30,11 @@ android { compileSdkVersion 33 // change api compileSdkVersion at the same time + buildFeatures { + buildConfig = true + aidl = true + } + defaultConfig { applicationId "com.ichi2.anki" buildConfigField "Boolean", "CI", (System.getenv("CI") == "true").toString() @@ -358,7 +363,7 @@ dependencies { // Cannot use debugImplementation since classes need to be imported in AnkiDroidApp // and there's no no-op version for release build. Usage has been disabled for release // build via AnkiDroidApp. - implementation 'com.squareup.leakcanary:leakcanary-android:2.11' + implementation 'com.squareup.leakcanary:leakcanary-android:2.12' api project(":api") diff --git a/AnkiDroid/src/androidTest/java/com/ichi2/anki/DeckPickerTest.kt b/AnkiDroid/src/androidTest/java/com/ichi2/anki/DeckPickerTest.kt index 130d5086d065..1401cad17c86 100644 --- a/AnkiDroid/src/androidTest/java/com/ichi2/anki/DeckPickerTest.kt +++ b/AnkiDroid/src/androidTest/java/com/ichi2/anki/DeckPickerTest.kt @@ -106,7 +106,7 @@ class DeckPickerTest { onView(withId(R.id.fab_main)).perform(click()) onView(withId(R.id.add_deck_action)).perform(click()) onView(withId(R.id.action_edit)).perform(typeText("TestDeck$testString")) - onView(withId(R.id.md_button_positive)).perform(click()) + onView(withId(com.afollestad.materialdialogs.R.id.md_button_positive)).perform(click()) // The deck is currently empty, so if we tap on it, it becomes the selected deck but doesn't enter onView(withId(R.id.files)).perform( diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.kt b/AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.kt index e61acb47af7a..6fccef05c334 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.kt @@ -407,7 +407,7 @@ open class AnkiActivity : AppCompatActivity, SimpleMessageDialogListener, Collec ) return } - val toolbarColor = Themes.getColorFromAttr(this, R.attr.colorPrimary) + val toolbarColor = Themes.getColorFromAttr(this, android.R.attr.colorPrimary) val navBarColor = Themes.getColorFromAttr(this, R.attr.customTabNavBarColor) val colorSchemeParams = CustomTabColorSchemeParams.Builder() .setToolbarColor(toolbarColor) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/Info.kt b/AnkiDroid/src/main/java/com/ichi2/anki/Info.kt index 717e42aa830e..32c370696c8c 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/Info.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/Info.kt @@ -94,7 +94,7 @@ class Info : AnkiActivity() { val backgroundColor = typedArray.getColor(0, -1) val textColor = typedArray.getColor(1, -1).toRGBHex() - val anchorTextThemeColor = ThemeUtils.getThemeAttrColor(this, R.attr.colorAccent) + val anchorTextThemeColor = ThemeUtils.getThemeAttrColor(this, android.R.attr.colorAccent) val anchorTextColor = anchorTextThemeColor.toRGBHex() mWebView!!.setBackgroundColor(backgroundColor) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/NavigationDrawerActivity.kt b/AnkiDroid/src/main/java/com/ichi2/anki/NavigationDrawerActivity.kt index ce40f9075e87..26dcb9cf8157 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/NavigationDrawerActivity.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/NavigationDrawerActivity.kt @@ -116,7 +116,7 @@ abstract class NavigationDrawerActivity : mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START) // Force transparent status bar with primary dark color underlaid so that the drawer displays under status bar window.statusBarColor = ContextCompat.getColor(this, R.color.transparent) - mDrawerLayout.setStatusBarBackgroundColor(Themes.getColorFromAttr(this, R.attr.colorPrimary)) + mDrawerLayout.setStatusBarBackgroundColor(Themes.getColorFromAttr(this, android.R.attr.colorPrimary)) // Setup toolbar and hamburger mNavigationView = mDrawerLayout.findViewById(R.id.navdrawer_items_container) mNavigationView.setNavigationItemSelectedListener(this) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt b/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt index 60f655c8606f..97d0af5ab09a 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt @@ -1324,7 +1324,7 @@ open class Reviewer : // Show / hide the Action bar together with the status bar val prefs = AnkiDroidApp.getSharedPrefs(a) val fullscreenMode = fromPreference(prefs) - a.window.statusBarColor = getColorFromAttr(a, R.attr.colorPrimary) + a.window.statusBarColor = getColorFromAttr(a, android.R.attr.colorPrimary) val decorView = a.window.decorView decorView.setOnSystemUiVisibilityChangeListener { flags: Int -> val toolbar = a.findViewById(R.id.toolbar) @@ -1559,7 +1559,7 @@ open class Reviewer : @MenuRes subMenuRes: Int, onMenuItemSelection: (MenuItem) -> Boolean, showsSubMenu: () -> Boolean - ): View = ImageButton(context, null, R.attr.actionButtonStyle).apply { + ): View = ImageButton(context, null, android.R.attr.actionButtonStyle).apply { TooltipCompat.setTooltipText(this, menuItem.title) menuItem.icon?.isAutoMirrored = true setImageDrawable(menuItem.icon) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialog.kt b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialog.kt index 548ca1f20a75..098622121524 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialog.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialog.kt @@ -210,7 +210,7 @@ class TagsDialog : AnalyticsDialogFragment { mToolbarSearchItem = toolbar.menu.findItem(R.id.tags_dialog_action_filter) val toolbarSearchItem: MenuItem? = mToolbarSearchItem mToolbarSearchView = toolbarSearchItem?.actionView as SearchView - val queryET = mToolbarSearchView!!.findViewById(R.id.search_src_text) + val queryET = mToolbarSearchView!!.findViewById(com.google.android.material.R.id.search_src_text) queryET.filters = arrayOf(addTagFilter) mToolbarSearchView!!.queryHint = getString(R.string.filter_tags) mToolbarSearchView!!.setOnQueryTextListener(object : SearchView.OnQueryTextListener { diff --git a/AnkiDroid/src/main/java/com/ichi2/libanki/UndoAction.kt b/AnkiDroid/src/main/java/com/ichi2/libanki/UndoAction.kt index 9acf2ea53f0a..d1d7b70a3316 100644 --- a/AnkiDroid/src/main/java/com/ichi2/libanki/UndoAction.kt +++ b/AnkiDroid/src/main/java/com/ichi2/libanki/UndoAction.kt @@ -17,9 +17,7 @@ package com.ichi2.libanki import android.content.res.Resources -import androidx.annotation.IntDef import androidx.annotation.StringRes -import com.ichi2.anki.R import com.ichi2.utils.LanguageUtil.getLocaleCompat import timber.log.Timber import java.util.* @@ -32,7 +30,6 @@ abstract class UndoAction val undoNameId: Int ) { @Retention(AnnotationRetention.SOURCE) - @IntDef(R.string.undo_action_change_deck_multi, R.string.menu_delete_note, R.string.card_browser_delete_card, R.string.card_browser_mark_card, R.string.card_browser_unmark_card, R.string.menu_suspend_card, R.string.card_browser_unsuspend_card, R.string.undo_action_review, R.string.menu_bury_note, R.string.menu_suspend_note, R.string.card_editor_reposition_card, R.string.card_editor_reschedule_card, R.string.menu_bury_card, R.string.card_editor_reset_card) annotation class UndoNameId private fun getLocale(resources: Resources): Locale? { diff --git a/AnkiDroid/src/main/java/com/ichi2/preferences/HeaderPreference.kt b/AnkiDroid/src/main/java/com/ichi2/preferences/HeaderPreference.kt index 4d01b77cdb81..559869c067b6 100644 --- a/AnkiDroid/src/main/java/com/ichi2/preferences/HeaderPreference.kt +++ b/AnkiDroid/src/main/java/com/ichi2/preferences/HeaderPreference.kt @@ -30,8 +30,8 @@ class HeaderPreference constructor( context: Context, attrs: AttributeSet? = null, - defStyleAttr: Int = R.attr.preferenceStyle, - defStyleRes: Int = R.style.Preference + defStyleAttr: Int = androidx.preference.R.attr.preferenceStyle, + defStyleRes: Int = androidx.preference.R.style.Preference ) : Preference(context, attrs, defStyleAttr, defStyleRes) { init { diff --git a/AnkiDroid/src/main/java/com/ichi2/preferences/NumberRangePreferenceCompat.kt b/AnkiDroid/src/main/java/com/ichi2/preferences/NumberRangePreferenceCompat.kt index 304b39f31229..ab6db190c19c 100644 --- a/AnkiDroid/src/main/java/com/ichi2/preferences/NumberRangePreferenceCompat.kt +++ b/AnkiDroid/src/main/java/com/ichi2/preferences/NumberRangePreferenceCompat.kt @@ -36,8 +36,8 @@ open class NumberRangePreferenceCompat constructor( context: Context, attrs: AttributeSet? = null, - defStyleAttr: Int = R.attr.editTextPreferenceStyle, - defStyleRes: Int = R.style.Preference_DialogPreference_EditTextPreference + defStyleAttr: Int = androidx.preference.R.attr.editTextPreferenceStyle, + defStyleRes: Int = androidx.preference.R.style.Preference_DialogPreference_EditTextPreference ) : EditTextPreference(context, attrs, defStyleAttr, defStyleRes), DialogFragmentProvider { var defaultValue: String? = null diff --git a/AnkiDroid/src/main/java/com/ichi2/preferences/SliderPreference.kt b/AnkiDroid/src/main/java/com/ichi2/preferences/SliderPreference.kt index 14aed9bb4598..3a94589e6875 100644 --- a/AnkiDroid/src/main/java/com/ichi2/preferences/SliderPreference.kt +++ b/AnkiDroid/src/main/java/com/ichi2/preferences/SliderPreference.kt @@ -78,10 +78,10 @@ class SliderPreference(context: Context, attrs: AttributeSet? = null) : Preferen init { layoutResource = R.layout.preference_slider - context.withStyledAttributes(attrs, R.styleable.Slider) { - valueFrom = getIntOrThrow(R.styleable.Slider_android_valueFrom) - valueTo = getIntOrThrow(R.styleable.Slider_android_valueTo) - stepSize = getFloat(R.styleable.Slider_android_stepSize, 1F) + context.withStyledAttributes(attrs, com.google.android.material.R.styleable.Slider) { + valueFrom = getIntOrThrow(com.google.android.material.R.styleable.Slider_android_valueFrom) + valueTo = getIntOrThrow(com.google.android.material.R.styleable.Slider_android_valueTo) + stepSize = getFloat(com.google.android.material.R.styleable.Slider_android_stepSize, 1F) } context.withStyledAttributes(attrs, R.styleable.CustomPreference) { diff --git a/AnkiDroid/src/main/java/com/ichi2/ui/RtlCompliantActionProvider.kt b/AnkiDroid/src/main/java/com/ichi2/ui/RtlCompliantActionProvider.kt index 2bc51373c404..66114d5be466 100644 --- a/AnkiDroid/src/main/java/com/ichi2/ui/RtlCompliantActionProvider.kt +++ b/AnkiDroid/src/main/java/com/ichi2/ui/RtlCompliantActionProvider.kt @@ -40,7 +40,7 @@ class RtlCompliantActionProvider(context: Context) : ActionProviderCompat(contex } override fun onCreateActionView(forItem: MenuItem): View { - val actionView = ImageButton(context, null, R.attr.actionButtonStyle) + val actionView = ImageButton(context, null, android.R.attr.actionButtonStyle) TooltipCompat.setTooltipText(actionView, forItem.title) forItem.icon?.let { it.isAutoMirrored = true diff --git a/AnkiDroid/src/test/java/com/ichi2/anki/RobolectricTest.kt b/AnkiDroid/src/test/java/com/ichi2/anki/RobolectricTest.kt index 769df33bfbdd..e6a4c12dad16 100644 --- a/AnkiDroid/src/test/java/com/ichi2/anki/RobolectricTest.kt +++ b/AnkiDroid/src/test/java/com/ichi2/anki/RobolectricTest.kt @@ -229,7 +229,7 @@ open class RobolectricTest : CollectionGetter, AndroidTest { Timber.e("The latest dialog has already been dismissed.") return null } - return dialog.view.contentLayout.findViewById(R.id.md_text_message).text.toString() + return dialog.view.contentLayout.findViewById(com.afollestad.materialdialogs.R.id.md_text_message).text.toString() } /** diff --git a/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/CustomStudyDialogTest.kt b/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/CustomStudyDialogTest.kt index 28479309d884..ebda4752d9fa 100644 --- a/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/CustomStudyDialogTest.kt +++ b/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/CustomStudyDialogTest.kt @@ -116,7 +116,7 @@ class CustomStudyDialogTest : RobolectricTest() { whenever(mockCollection.sched).thenReturn(mockSched) whenever(mockSched.newCount()).thenReturn(0) val factory = CustomStudyDialogFactory({ mockCollection }, mMockListener) - val scenario = FragmentScenario.launch(CustomStudyDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(CustomStudyDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: CustomStudyDialog -> val dialog = f.dialog as MaterialDialog? diff --git a/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/DeckPickerContextMenuAndroidTest.kt b/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/DeckPickerContextMenuAndroidTest.kt index 1c4a28a63cf3..e2edce7252a4 100644 --- a/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/DeckPickerContextMenuAndroidTest.kt +++ b/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/DeckPickerContextMenuAndroidTest.kt @@ -58,7 +58,7 @@ class DeckPickerContextMenuAndroidTest : RobolectricTest() { .arguments val factory = DeckPickerContextMenu.Factory { col } - FragmentScenario.launch(DeckPickerContextMenu::class.java, args, R.style.Theme_AppCompat, factory) + FragmentScenario.launch(DeckPickerContextMenu::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) .use { scenario -> scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: DeckPickerContextMenu -> diff --git a/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/DeckPickerContextMenuTest.kt b/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/DeckPickerContextMenuTest.kt index 81b31addd6c1..fed9a215c3d3 100644 --- a/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/DeckPickerContextMenuTest.kt +++ b/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/DeckPickerContextMenuTest.kt @@ -237,7 +237,7 @@ class DeckPickerContextMenuTest : RobolectricTest() { val actualTitle = (ShadowDialog.getLatestDialog() as MaterialDialog) .view - .findViewById(R.id.md_text_title) + .findViewById(com.afollestad.materialdialogs.R.id.md_text_title) ?.text Timber.d("titles = \"$actualTitle\", \"$expectedTitle\"") assertEquals(expectedTitle, "$actualTitle") @@ -253,7 +253,7 @@ class DeckPickerContextMenuTest : RobolectricTest() { .itemView.performLongClick() val dialogRecyclerView = (ShadowDialog.getLatestDialog() as MaterialDialog?)!! - .view.findViewById(R.id.md_recyclerview_content) + .view.findViewById(com.afollestad.materialdialogs.R.id.md_recyclerview_content) dialogRecyclerView.apply { scrollToPosition(index) diff --git a/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/tags/TagsDialogTest.kt b/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/tags/TagsDialogTest.kt index 7379879b58df..a5ab8d264b02 100644 --- a/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/tags/TagsDialogTest.kt +++ b/AnkiDroid/src/test/java/com/ichi2/anki/dialogs/tags/TagsDialogTest.kt @@ -56,7 +56,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -78,7 +78,7 @@ class TagsDialogTest { val args = TagsDialog(ParametersUtils.whatever()) .withArguments(type, ArrayList(), allTags) .arguments - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -116,7 +116,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -151,7 +151,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -189,7 +189,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -244,7 +244,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -291,7 +291,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -345,7 +345,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -393,7 +393,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -434,7 +434,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -481,7 +481,7 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? @@ -600,12 +600,12 @@ class TagsDialogTest { .arguments val mockListener = Mockito.mock(TagsDialogListener::class.java) val factory = TagsDialogFactory(mockListener) - val scenario = FragmentScenario.launch(TagsDialog::class.java, args, R.style.Theme_AppCompat, factory) + val scenario = FragmentScenario.launch(TagsDialog::class.java, args, androidx.appcompat.R.style.Theme_AppCompat, factory) scenario.moveToState(Lifecycle.State.STARTED) scenario.onFragment { f: TagsDialog -> val dialog = f.dialog as MaterialDialog? MatcherAssert.assertThat(dialog, IsNull.notNullValue()) - val editText = f.getSearchView()!!.findViewById(R.id.search_src_text)!! + val editText = f.getSearchView()!!.findViewById(androidx.appcompat.R.id.search_src_text)!! editText.setText("hello ") Assert.assertEquals( diff --git a/api/build.gradle b/api/build.gradle index 4b887aaae0a2..f46d770de42e 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -16,6 +16,10 @@ android { namespace 'com.ichi2.anki.api' compileSdkVersion 33 + buildFeatures { + buildConfig = true + } + defaultConfig { minSdkVersion 16 //noinspection OldTargetApi diff --git a/build.gradle b/build.gradle index e40ed6a9287b..36679cf5551d 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.ankidroid_backend_version = '0.1.21-anki2.1.61' ext.hamcrest_version = '2.2' ext.junit_version = '5.9.3' - ext.coroutines_version = '1.7.1' + ext.coroutines_version = '1.7.2' ext.fragments_version = "1.6.0" ext.espresso_version = '3.5.1' ext.androidx_test_version = '1.5.0' @@ -25,7 +25,7 @@ buildscript { maven { url 'https://jitpack.io' } } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.0.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath "com.github.BrantApps.gradle-amazon-app-store-publisher:amazonappstorepublisher:master-SNAPSHOT" diff --git a/gradle.properties b/gradle.properties index f7cf8fe206c1..13992ecd3164 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,4 @@ org.gradle.parallel=true org.gradle.caching=true # Enable file system watching (should reduce disk IO and increase incremental build speed). -org.gradle.vfs.watch=true - -# Opt in to gradle 8 behavior, silence warning for now. Remove with AGP8+ -android.disableAutomaticComponentCreation=true +org.gradle.vfs.watch=true \ No newline at end of file