diff --git a/app/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java b/app/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java index f89e34f917..8cdacfbd56 100644 --- a/app/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java +++ b/app/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java @@ -207,11 +207,7 @@ public class SendShareDialog extends BottomSheetDialogFragment implements Inject } private void themeShareButtonImage(ImageView shareImageView) { - shareImageView.getBackground().setColorFilter(themeColorUtils.primaryColor(getContext().getApplicationContext(), - true), - PorterDuff.Mode.SRC_IN); - shareImageView.getDrawable().mutate().setColorFilter(themeColorUtils.fontColor(getContext().getApplicationContext()), - PorterDuff.Mode.SRC_IN); + viewThemeUtils.files.themeAvatarButton(shareImageView); } private void showResharingNotAllowedSnackbar() { diff --git a/app/src/main/java/com/owncloud/android/utils/theme/newm3/FilesSpecificViewThemeUtils.kt b/app/src/main/java/com/owncloud/android/utils/theme/newm3/FilesSpecificViewThemeUtils.kt index 2cb372ec74..89d61a2cbf 100644 --- a/app/src/main/java/com/owncloud/android/utils/theme/newm3/FilesSpecificViewThemeUtils.kt +++ b/app/src/main/java/com/owncloud/android/utils/theme/newm3/FilesSpecificViewThemeUtils.kt @@ -23,6 +23,7 @@ package com.owncloud.android.utils.theme.newm3 import android.content.Context +import android.content.res.ColorStateList import android.graphics.PorterDuff import android.graphics.drawable.Drawable import android.preference.PreferenceCategory @@ -35,6 +36,7 @@ import androidx.annotation.Px import androidx.annotation.StringRes import androidx.appcompat.app.ActionBar import androidx.core.content.res.ResourcesCompat +import com.google.android.material.card.MaterialCardView import com.nextcloud.android.common.ui.theme.MaterialSchemes import com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase import com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils @@ -173,6 +175,30 @@ class FilesSpecificViewThemeUtils @Inject constructor( androidXViewThemeUtils.themeActionBar(context, actionBar, backArrow) } + fun themeTemplateCardView(cardView: MaterialCardView) { + withScheme(cardView.context) { scheme -> + cardView.setStrokeColor( + ColorStateList( + arrayOf( + intArrayOf(android.R.attr.state_checked), + intArrayOf(-android.R.attr.state_checked) + ), + intArrayOf( + scheme.primary, + scheme.outline + ) + ) + ) + } + } + + fun themeAvatarButton(shareImageView: ImageView) { + withScheme(shareImageView.context) { scheme -> + shareImageView.background.setColorFilter(scheme.primary, PorterDuff.Mode.SRC_IN) + shareImageView.drawable.mutate().setColorFilter(scheme.onPrimary, PorterDuff.Mode.SRC_IN) + } + } + companion object { private val TAG = FilesSpecificViewThemeUtils::class.simpleName