diff --git a/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt b/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt index 1796966c8..c13377831 100644 --- a/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt @@ -132,7 +132,7 @@ object ThemeHelper { * Get the styled app name */ fun getStyledAppName(context: Context): Spanned { - val colorPrimary = getThemeColor(context, R.attr.colorPrimaryDark) + val colorPrimary = getThemeColor(context, androidx.appcompat.R.attr.colorPrimaryDark) val hexColor = String.format("#%06X", (0xFFFFFF and colorPrimary)) return "LibreTube" .parseAsHtml(HtmlCompat.FROM_HTML_MODE_COMPACT) diff --git a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt index 24ecbd7e4..d85b60f9f 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt @@ -237,8 +237,14 @@ class MainActivity : BaseActivity() { if (lastSeenVideoIndex < 1) return@observe binding.bottomNav.getOrCreateBadge(R.id.subscriptionsFragment).apply { number = lastSeenVideoIndex - backgroundColor = ThemeHelper.getThemeColor(this@MainActivity, R.attr.colorPrimary) - badgeTextColor = ThemeHelper.getThemeColor(this@MainActivity, R.attr.colorOnPrimary) + backgroundColor = ThemeHelper.getThemeColor( + this@MainActivity, + androidx.appcompat.R.attr.colorPrimary + ) + badgeTextColor = ThemeHelper.getThemeColor( + this@MainActivity, + com.google.android.material.R.attr.colorOnPrimary + ) } } } diff --git a/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt index 98cf79bfc..52799b82d 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/CommentsAdapter.kt @@ -91,7 +91,10 @@ class CommentsAdapter( // highlight the comment that is being replied to if (comment == comments.firstOrNull()) { root.setBackgroundColor( - ThemeHelper.getThemeColor(root.context, R.attr.colorSurface) + ThemeHelper.getThemeColor( + root.context, + com.google.android.material.R.attr.colorSurface + ) ) root.updatePadding(top = 20) root.updateLayoutParams { bottomMargin = 20 } diff --git a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt index eb63bd5a7..0385db34b 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt @@ -40,7 +40,8 @@ class PlaylistsAdapter( // set imageview drawable as empty playlist if imageview empty if (playlist.thumbnail.orEmpty().split("/").size <= 4) { playlistThumbnail.setImageResource(R.drawable.ic_empty_playlist) - playlistThumbnail.setBackgroundColor(R.attr.colorSurface) + playlistThumbnail + .setBackgroundColor(com.google.android.material.R.attr.colorSurface) } else { ImageHelper.loadImage(playlist.thumbnail, playlistThumbnail) } diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt index 6a71f24f9..76e718f50 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/ErrorDialog.kt @@ -21,7 +21,7 @@ class ErrorDialog : DialogFragment() { .setTitle(R.string.error_occurred) .setMessage(errorLog) .setNegativeButton(R.string.okay, null) - .setPositiveButton(R.string.copy) { _, _ -> + .setPositiveButton(androidx.preference.R.string.copy) { _, _ -> ClipboardHelper.save(requireContext(), errorLog) Toast.makeText(context, R.string.copied, Toast.LENGTH_SHORT).show() } diff --git a/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt b/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt index 8d2d7d1f2..32f8d08f1 100644 --- a/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomSwipeToRefresh.kt @@ -7,7 +7,6 @@ import android.view.MotionEvent import android.view.MotionEvent.ACTION_MOVE import android.view.ViewConfiguration import androidx.swiperefreshlayout.widget.SwipeRefreshLayout -import com.github.libretube.R import com.github.libretube.helpers.ThemeHelper import com.google.android.material.elevation.SurfaceColors import kotlin.math.abs @@ -18,7 +17,9 @@ class CustomSwipeToRefresh(context: Context?, attrs: AttributeSet?) : private var mPrevX = 0f init { - setColorSchemeColors(ThemeHelper.getThemeColor(this.context, R.attr.colorPrimary)) + setColorSchemeColors( + ThemeHelper.getThemeColor(this.context, androidx.appcompat.R.attr.colorPrimary) + ) setProgressBackgroundColorSchemeColor( SurfaceColors.getColorForElevation(this.context, 20f) ) diff --git a/app/src/main/java/com/github/libretube/ui/views/MarkableTimeBar.kt b/app/src/main/java/com/github/libretube/ui/views/MarkableTimeBar.kt index 36615a265..86ac19eed 100644 --- a/app/src/main/java/com/github/libretube/ui/views/MarkableTimeBar.kt +++ b/app/src/main/java/com/github/libretube/ui/views/MarkableTimeBar.kt @@ -7,7 +7,6 @@ import android.graphics.Rect import android.util.AttributeSet import android.view.View import androidx.core.view.marginLeft -import com.github.libretube.R import com.github.libretube.api.obj.Segment import com.github.libretube.constants.PreferenceKeys import com.github.libretube.extensions.dpToPx @@ -56,7 +55,10 @@ class MarkableTimeBar( canvas.height - marginY ), Paint().apply { - color = ThemeHelper.getThemeColor(context, R.attr.colorOnSecondary) + color = ThemeHelper.getThemeColor( + context, + com.google.android.material.R.attr.colorOnSecondary + ) } ) } diff --git a/gradle.properties b/gradle.properties index d8ecd90f2..c57869e52 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,5 +16,5 @@ kotlin.code.style=official android.useAndroidX=true android.enableJetifier=true android.defaults.buildfeatures.buildconfig=true -android.nonTransitiveRClass=false +android.nonTransitiveRClass=true android.nonFinalResIds=true \ No newline at end of file