Fix flow colors.

This commit is contained in:
Alex Hart 2022-10-07 14:35:05 -03:00 committed by Greyson Parrelli
parent 3dd31432c8
commit 5c77c33dff
3 changed files with 8 additions and 17 deletions

View file

@ -19,6 +19,11 @@ data class ViewColorSet(
val background: ViewColor
) : Parcelable {
companion object {
val PRIMARY = ViewColorSet(
foreground = ViewColor.ColorResource(R.color.signal_colorOnPrimary),
background = ViewColor.ColorResource(R.color.signal_colorPrimary)
)
fun forCustomColor(@ColorInt customColor: Int): ViewColorSet {
return ViewColorSet(
foreground = ViewColor.ColorResource(R.color.signal_colorOnCustom),

View file

@ -35,21 +35,7 @@ open class MultiselectForwardActivity : FragmentWrapperActivity(), MultiselectFo
}
override fun getFragment(): Fragment {
return MultiselectForwardFragment.create(
args.let {
if (it.sendButtonColors == null) {
args.withSendButtonTint(ContextCompat.getColor(this, R.color.signal_colorPrimary))
args.copy(
sendButtonColors = ViewColorSet(
foreground = ViewColorSet.ViewColor.ColorResource(R.color.signal_colorOnPrimary),
background = ViewColorSet.ViewColor.ColorResource(R.color.signal_colorPrimary)
)
)
} else {
args
}
}
)
return MultiselectForwardFragment.create(args)
}
override fun onFinishForwardAction() {

View file

@ -44,7 +44,7 @@ data class MultiselectForwardFragmentArgs @JvmOverloads constructor(
val forceDisableAddMessage: Boolean = false,
val forceSelectionOnly: Boolean = false,
val selectSingleRecipient: Boolean = false,
val sendButtonColors: ViewColorSet? = null,
val sendButtonColors: ViewColorSet = ViewColorSet.PRIMARY,
val storySendRequirements: Stories.MediaTransform.SendRequirements = Stories.MediaTransform.SendRequirements.CAN_NOT_SEND,
val isSearchEnabled: Boolean = true
) : Parcelable {
@ -74,7 +74,7 @@ data class MultiselectForwardFragmentArgs @JvmOverloads constructor(
isMmsSupported,
listOf(multiShareArgs),
storySendRequirements = Stories.MediaTransform.SendRequirements.CAN_NOT_SEND,
sendButtonColors = sendButtonColors
sendButtonColors = sendButtonColors ?: ViewColorSet.PRIMARY
)
)
}