Skip to content

Commit a371d65

Browse files
david-allisonBrayanDSO
authored andcommitted
fix(material): use non-transitive R.id/attr references
Material 1.13.0 uses `android.nonTransitiveRClass=true` Therefore `com.google.android.material.R.attr.colorPrimary` is no longer usable `colorPrimary` => androidx.appcompat.R.attr.colorPrimary `search_src_text` => androidx.appcompat.R.id.search_src_text https://github.com/material-components/material-components-android/blob/c2051db2a9be2a1e23f1128bfc76a9ff29ede7c4/docs/getting-started.md#non-transitive-r-classes-referencing-library-resources-programmatically
1 parent ac3d4ad commit a371d65

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/dialogs/customstudy/IncludedExcludedTagsAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class IncludedExcludedTagsAdapter(
7272
init {
7373
val ta =
7474
context.obtainStyledAttributes(
75-
intArrayOf(android.R.attr.selectableItemBackground, com.google.android.material.R.attr.colorPrimary),
75+
intArrayOf(android.R.attr.selectableItemBackground, androidx.appcompat.R.attr.colorPrimary),
7676
)
7777
selectableItemBackground = ta.getResourceId(0, 0)
7878
selectedItemBackground = ta.getColor(1, Color.BLUE)

AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsDialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class TagsDialog : AnalyticsDialogFragment {
334334
toolbarSearchItem = toolbar.menu.findItem(R.id.tags_dialog_action_filter)
335335
val toolbarSearchItem: MenuItem? = toolbarSearchItem
336336
toolbarSearchView = toolbarSearchItem?.actionView as AccessibleSearchView
337-
val queryET = toolbarSearchView!!.findViewById<EditText>(com.google.android.material.R.id.search_src_text)
337+
val queryET = toolbarSearchView!!.findViewById<EditText>(androidx.appcompat.R.id.search_src_text)
338338
queryET.filters = arrayOf(addTagFilter)
339339
toolbarSearchView!!.queryHint = getString(R.string.filter_tags)
340340
toolbarSearchView!!.setOnQueryTextListener(

0 commit comments

Comments
 (0)