Fix a few accent color issues
This commit is contained in:
parent
32d8be34c8
commit
8ff80b7950
@ -21,6 +21,7 @@ import androidx.annotation.AttrRes
|
|||||||
import androidx.annotation.ColorInt
|
import androidx.annotation.ColorInt
|
||||||
import androidx.annotation.ColorRes
|
import androidx.annotation.ColorRes
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import im.vector.riotx.R
|
||||||
import im.vector.riotx.features.themes.ThemeUtils
|
import im.vector.riotx.features.themes.ThemeUtils
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -28,6 +29,8 @@ class ColorProvider @Inject constructor(private val context: Context) {
|
|||||||
|
|
||||||
@ColorInt
|
@ColorInt
|
||||||
fun getColor(@ColorRes colorRes: Int): Int {
|
fun getColor(@ColorRes colorRes: Int): Int {
|
||||||
|
if (colorRes == R.color.riotx_accent)
|
||||||
|
return getColorFromAttribute(R.attr.colorAccent)
|
||||||
return ContextCompat.getColor(context, colorRes)
|
return ContextCompat.getColor(context, colorRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ import im.vector.matrix.android.api.util.MatrixItem
|
|||||||
import im.vector.riotx.R
|
import im.vector.riotx.R
|
||||||
import im.vector.riotx.core.epoxy.VectorEpoxyHolder
|
import im.vector.riotx.core.epoxy.VectorEpoxyHolder
|
||||||
import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
||||||
|
import im.vector.riotx.core.resources.ColorProvider
|
||||||
import im.vector.riotx.features.home.AvatarRenderer
|
import im.vector.riotx.features.home.AvatarRenderer
|
||||||
|
|
||||||
@EpoxyModelClass(layout = R.layout.item_create_direct_room_user)
|
@EpoxyModelClass(layout = R.layout.item_create_direct_room_user)
|
||||||
@ -56,7 +57,7 @@ abstract class CreateDirectRoomUserItem : VectorEpoxyModel<CreateDirectRoomUserI
|
|||||||
private fun renderSelection(holder: Holder, isSelected: Boolean) {
|
private fun renderSelection(holder: Holder, isSelected: Boolean) {
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
holder.avatarCheckedImageView.visibility = View.VISIBLE
|
holder.avatarCheckedImageView.visibility = View.VISIBLE
|
||||||
val backgroundColor = ContextCompat.getColor(holder.view.context, R.color.riotx_accent)
|
val backgroundColor = ColorProvider(holder.view.context).getColor(R.color.riotx_accent)
|
||||||
val backgroundDrawable = TextDrawable.builder().buildRound("", backgroundColor)
|
val backgroundDrawable = TextDrawable.builder().buildRound("", backgroundColor)
|
||||||
holder.avatarImageView.setImageDrawable(backgroundDrawable)
|
holder.avatarImageView.setImageDrawable(backgroundDrawable)
|
||||||
} else {
|
} else {
|
||||||
|
@ -37,6 +37,7 @@ import im.vector.riotx.core.glide.GlideApp
|
|||||||
import im.vector.riotx.core.platform.ToolbarConfigurable
|
import im.vector.riotx.core.platform.ToolbarConfigurable
|
||||||
import im.vector.riotx.core.platform.VectorBaseActivity
|
import im.vector.riotx.core.platform.VectorBaseActivity
|
||||||
import im.vector.riotx.core.platform.VectorBaseFragment
|
import im.vector.riotx.core.platform.VectorBaseFragment
|
||||||
|
import im.vector.riotx.core.resources.ColorProvider
|
||||||
import im.vector.riotx.core.ui.views.KeysBackupBanner
|
import im.vector.riotx.core.ui.views.KeysBackupBanner
|
||||||
import im.vector.riotx.features.home.room.list.RoomListFragment
|
import im.vector.riotx.features.home.room.list.RoomListFragment
|
||||||
import im.vector.riotx.features.home.room.list.RoomListParams
|
import im.vector.riotx.features.home.room.list.RoomListParams
|
||||||
@ -118,7 +119,7 @@ class HomeDetailFragment @Inject constructor(
|
|||||||
iconId = R.drawable.ic_shield_warning
|
iconId = R.drawable.ic_shield_warning
|
||||||
).apply {
|
).apply {
|
||||||
matrixItem = user
|
matrixItem = user
|
||||||
colorInt = ContextCompat.getColor(requireActivity(), R.color.riotx_accent)
|
colorInt = ColorProvider(requireActivity()).getColor(R.color.riotx_accent)
|
||||||
contentAction = Runnable {
|
contentAction = Runnable {
|
||||||
(weakCurrentActivity?.get() as? VectorBaseActivity)
|
(weakCurrentActivity?.get() as? VectorBaseActivity)
|
||||||
?.navigator
|
?.navigator
|
||||||
@ -146,7 +147,7 @@ class HomeDetailFragment @Inject constructor(
|
|||||||
iconId = R.drawable.ic_shield_warning
|
iconId = R.drawable.ic_shield_warning
|
||||||
).apply {
|
).apply {
|
||||||
matrixItem = user
|
matrixItem = user
|
||||||
colorInt = ContextCompat.getColor(requireActivity(), R.color.riotx_accent)
|
colorInt = ColorProvider(requireActivity()).getColor(R.color.riotx_accent)
|
||||||
contentAction = Runnable {
|
contentAction = Runnable {
|
||||||
(weakCurrentActivity?.get() as? VectorBaseActivity)?.let {
|
(weakCurrentActivity?.get() as? VectorBaseActivity)?.let {
|
||||||
// mark as ignored to avoid showing it again
|
// mark as ignored to avoid showing it again
|
||||||
|
@ -743,11 +743,7 @@ class RoomDetailFragment @Inject constructor(
|
|||||||
it.setTextColor(ThemeUtils.getColor(requireContext(), R.attr.vctr_toolbar_secondary_text_color))
|
it.setTextColor(ThemeUtils.getColor(requireContext(), R.attr.vctr_toolbar_secondary_text_color))
|
||||||
it.setTypeface(null, Typeface.NORMAL)
|
it.setTypeface(null, Typeface.NORMAL)
|
||||||
} else {
|
} else {
|
||||||
if (ThemeUtils.isScTheme(context)) {
|
it.setTextColor(ColorProvider(requireContext()).getColor(R.color.riotx_accent))
|
||||||
it.setTextColor(ContextCompat.getColor(requireContext(), R.color.accent_sc))
|
|
||||||
} else {
|
|
||||||
it.setTextColor(ContextCompat.getColor(requireContext(), R.color.riotx_accent))
|
|
||||||
}
|
|
||||||
it.setTypeface(null, Typeface.BOLD)
|
it.setTypeface(null, Typeface.BOLD)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ import im.vector.riotx.R
|
|||||||
import im.vector.riotx.core.epoxy.VectorEpoxyHolder
|
import im.vector.riotx.core.epoxy.VectorEpoxyHolder
|
||||||
import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
||||||
import im.vector.riotx.core.extensions.setTextOrHide
|
import im.vector.riotx.core.extensions.setTextOrHide
|
||||||
|
import im.vector.riotx.core.resources.ColorProvider
|
||||||
import im.vector.riotx.features.crypto.util.toImageRes
|
import im.vector.riotx.features.crypto.util.toImageRes
|
||||||
import im.vector.riotx.features.home.AvatarRenderer
|
import im.vector.riotx.features.home.AvatarRenderer
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ abstract class RoomSummaryItem : VectorEpoxyModel<RoomSummaryItem.Holder>() {
|
|||||||
private fun renderSelection(holder: Holder, isSelected: Boolean) {
|
private fun renderSelection(holder: Holder, isSelected: Boolean) {
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
holder.avatarCheckedImageView.visibility = View.VISIBLE
|
holder.avatarCheckedImageView.visibility = View.VISIBLE
|
||||||
val backgroundColor = ContextCompat.getColor(holder.view.context, R.color.riotx_accent)
|
val backgroundColor = ColorProvider(holder.view.context).getColor(R.color.riotx_accent)
|
||||||
val backgroundDrawable = TextDrawable.builder().buildRound("", backgroundColor)
|
val backgroundDrawable = TextDrawable.builder().buildRound("", backgroundColor)
|
||||||
holder.avatarImageView.setImageDrawable(backgroundDrawable)
|
holder.avatarImageView.setImageDrawable(backgroundDrawable)
|
||||||
} else {
|
} else {
|
||||||
|
@ -45,9 +45,9 @@ sealed class ActivityOtherThemes(@StyleRes val dark: Int,
|
|||||||
R.style.AppTheme_AttachmentsPreview,
|
R.style.AppTheme_AttachmentsPreview,
|
||||||
R.style.AppTheme_AttachmentsPreview,
|
R.style.AppTheme_AttachmentsPreview,
|
||||||
R.style.AppTheme_AttachmentsPreview,
|
R.style.AppTheme_AttachmentsPreview,
|
||||||
R.style.AppTheme_AttachmentsPreview,
|
R.style.AppTheme_AttachmentsPreview_SC,
|
||||||
R.style.AppTheme_AttachmentsPreview,
|
R.style.AppTheme_AttachmentsPreview_SC,
|
||||||
R.style.AppTheme_AttachmentsPreview,
|
R.style.AppTheme_AttachmentsPreview_SC,
|
||||||
R.style.AppTheme_AttachmentsPreview
|
R.style.AppTheme_AttachmentsPreview_SC
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:color="@color/riotx_accent" android:state_checked="true" />
|
<item android:color="?colorAccent" android:state_checked="true" />
|
||||||
<item android:color="@android:color/transparent" />
|
<item android:color="@android:color/transparent" />
|
||||||
</selector>
|
</selector>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item android:color="@color/riotx_accent" android:state_checked="true" />
|
<item android:color="?colorAccent" android:state_checked="true" />
|
||||||
<item android:color="#61708B" />
|
<item android:color="#61708B" />
|
||||||
|
|
||||||
</selector>
|
</selector>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<corners android:radius="40dp" />
|
||||||
|
|
||||||
|
<solid android:color="?colorAccent" />
|
||||||
|
</shape>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
|
||||||
|
<stroke
|
||||||
|
android:width="1.2dp"
|
||||||
|
android:color="?colorAccent" />
|
||||||
|
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
|
||||||
|
</shape>
|
@ -119,7 +119,7 @@
|
|||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:icon="@drawable/ic_plus_circle"
|
app:icon="@drawable/ic_plus_circle"
|
||||||
app:iconPadding="13dp"
|
app:iconPadding="13dp"
|
||||||
app:iconTint="@color/riotx_accent"
|
app:iconTint="?colorAccent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/createDirectRoomFilterDivider" />
|
app:layout_constraintTop_toBottomOf="@id/createDirectRoomFilterDivider" />
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@
|
|||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:text="@string/login_server_modular_learn_more"
|
android:text="@string/login_server_modular_learn_more"
|
||||||
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
|
||||||
android:textColor="@color/riotx_accent"
|
android:textColor="?colorAccent"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/loginServerChoiceModularText"
|
app:layout_constraintBottom_toBottomOf="@+id/loginServerChoiceModularText"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/loginServerChoiceModularText" />
|
app:layout_constraintTop_toTopOf="@+id/loginServerChoiceModularText" />
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:text="@string/login_server_modular_learn_more"
|
android:text="@string/login_server_modular_learn_more"
|
||||||
android:textAppearance="@style/TextAppearance.Vector.Login.Text"
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text"
|
||||||
android:textColor="@color/riotx_accent" />
|
android:textColor="?colorAccent" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/loginServerUrlFormHomeServerUrlTil"
|
android:id="@+id/loginServerUrlFormHomeServerUrlTil"
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
android:text="@string/create_new_room"
|
android:text="@string/create_new_room"
|
||||||
app:icon="@drawable/ic_plus_circle"
|
app:icon="@drawable/ic_plus_circle"
|
||||||
app:iconPadding="13dp"
|
app:iconPadding="13dp"
|
||||||
app:iconTint="@color/riotx_accent"
|
app:iconTint="?colorAccent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/publicRoomsToolbar" />
|
app:layout_constraintTop_toBottomOf="@+id/publicRoomsToolbar" />
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@
|
|||||||
android:contentDescription="@string/a11y_jump_to_bottom"
|
android:contentDescription="@string/a11y_jump_to_bottom"
|
||||||
android:src="@drawable/chevron_down"
|
android:src="@drawable/chevron_down"
|
||||||
app:backgroundTint="#FFFFFF"
|
app:backgroundTint="#FFFFFF"
|
||||||
app:badgeBackgroundColor="@color/riotx_accent"
|
app:badgeBackgroundColor="?colorAccent"
|
||||||
app:badgeTextColor="@color/white"
|
app:badgeTextColor="@color/white"
|
||||||
app:badgeTextPadding="2dp"
|
app:badgeTextPadding="2dp"
|
||||||
app:badgeTextSize="10sp"
|
app:badgeTextSize="10sp"
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_check_white_24dp"
|
android:src="@drawable/ic_check_white_24dp"
|
||||||
android:tint="@color/riotx_accent"
|
android:tint="?colorAccent"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_margin="4dp"
|
android:layout_margin="4dp"
|
||||||
android:src="@drawable/ic_poll"
|
android:src="@drawable/ic_poll"
|
||||||
android:tint="@color/riotx_accent" />
|
android:tint="?colorAccent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/pollLabelText"
|
android:id="@+id/pollLabelText"
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:textColor="@color/riotx_accent"
|
android:textColor="?colorAccent"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constrainedWidth="true"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/itemVerificationActionSubTitle"
|
app:layout_constraintBottom_toTopOf="@+id/itemVerificationActionSubTitle"
|
||||||
|
@ -7,10 +7,11 @@
|
|||||||
|
|
||||||
<style name="VectorAlertDialogStyleDark.SC">
|
<style name="VectorAlertDialogStyleDark.SC">
|
||||||
<item name="buttonBarButtonStyle">@style/VectorAlertDialogButtonStyle.SC</item>
|
<item name="buttonBarButtonStyle">@style/VectorAlertDialogButtonStyle.SC</item>
|
||||||
|
<item name="colorSecondary">@color/accent_sc</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="VectorAlertDialogButtonStyle.SC">
|
<style name="VectorAlertDialogButtonStyle.SC">
|
||||||
<item name="android:textColor">@color/accent_sc</item>
|
<item name="android:textColor">?colorAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Vector.TabView.SC" parent="Vector.TabView.Dark">
|
<style name="Vector.TabView.SC" parent="Vector.TabView.Dark">
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
|
|
||||||
<!-- Keep color accent for legacy widget-->
|
<!-- Keep color accent for legacy widget-->
|
||||||
<item name="colorAccent">@color/accent_sc</item>
|
<item name="colorAccent">@color/accent_sc</item>
|
||||||
|
<item name="android:colorAccent">@color/accent_sc</item>
|
||||||
|
|
||||||
<item name="materialButtonStyle">@style/VectorButtonStyle.SC</item>
|
<item name="materialButtonStyle">@style/VectorButtonStyle.SC</item>
|
||||||
<item name="toolbarStyle">@style/VectorToolbarStyle</item>
|
<item name="toolbarStyle">@style/VectorToolbarStyle</item>
|
||||||
@ -230,4 +231,7 @@
|
|||||||
|
|
||||||
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.Base.SC.Dark.Colored" />
|
<style name="AppTheme.SC.Dark.Colored" parent="AppTheme.Base.SC.Dark.Colored" />
|
||||||
|
|
||||||
|
|
||||||
|
<style name="AppTheme.AttachmentsPreview.SC" parent="AppTheme.Base.SC"/>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user