mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
theme share buttons in m3
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
6d1d03caf1
commit
d57ea5a010
2 changed files with 27 additions and 5 deletions
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue