kopia lustrzana https://github.com/ryukoposting/Signal-Android
Update coloring of capture first flow toggle.:
rodzic
d04d2f7e93
commit
d30714bfd4
|
@ -1,7 +1,6 @@
|
|||
package org.thoughtcrime.securesms.components
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
|
|
|
@ -12,6 +12,7 @@ import androidx.activity.viewModels
|
|||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.navigation.Navigation
|
||||
|
@ -157,6 +158,9 @@ class MediaSelectionActivity :
|
|||
}
|
||||
|
||||
private fun animateTextStyling(selectedSwitch: TextView, unselectedSwitch: TextView, duration: Long) {
|
||||
val offTextColor = ContextCompat.getColor(this, R.color.signal_colorOnSurface)
|
||||
val onTextColor = ContextCompat.getColor(this, R.color.signal_colorSecondaryContainer)
|
||||
|
||||
animateInShadowLayerValueAnimator?.cancel()
|
||||
animateInTextColorValueAnimator?.cancel()
|
||||
animateOutShadowLayerValueAnimator?.cancel()
|
||||
|
@ -167,7 +171,7 @@ class MediaSelectionActivity :
|
|||
addUpdateListener { selectedSwitch.setShadowLayer(it.animatedValue as Float, 0f, 0f, Color.BLACK) }
|
||||
start()
|
||||
}
|
||||
animateInTextColorValueAnimator = ValueAnimator.ofInt(selectedSwitch.currentTextColor, Color.BLACK).apply {
|
||||
animateInTextColorValueAnimator = ValueAnimator.ofObject(ArgbEvaluatorCompat(), selectedSwitch.currentTextColor, onTextColor).apply {
|
||||
setEvaluator(ArgbEvaluatorCompat.getInstance())
|
||||
this.duration = duration
|
||||
addUpdateListener { selectedSwitch.setTextColor(it.animatedValue as Int) }
|
||||
|
@ -178,7 +182,7 @@ class MediaSelectionActivity :
|
|||
addUpdateListener { unselectedSwitch.setShadowLayer(it.animatedValue as Float, 0f, 0f, Color.BLACK) }
|
||||
start()
|
||||
}
|
||||
animateOutTextColorValueAnimator = ValueAnimator.ofInt(unselectedSwitch.currentTextColor, Color.WHITE).apply {
|
||||
animateOutTextColorValueAnimator = ValueAnimator.ofObject(ArgbEvaluatorCompat(), unselectedSwitch.currentTextColor, offTextColor).apply {
|
||||
setEvaluator(ArgbEvaluatorCompat.getInstance())
|
||||
this.duration = duration
|
||||
addUpdateListener { unselectedSwitch.setTextColor(it.animatedValue as Int) }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true" android:color="@color/core_black" />
|
||||
<item android:color="@color/core_white" />
|
||||
<item android:state_selected="true" android:color="@color/signal_colorSecondaryContainer" />
|
||||
<item android:color="@color/signal_colorOnSurface" />
|
||||
</selector>
|
|
@ -3,7 +3,7 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/white" />
|
||||
<corners android:radius="42dp" />
|
||||
<solid android:color="@color/signal_colorOnSecondaryContainer" />
|
||||
<corners android:radius="32dp" />
|
||||
|
||||
</shape>
|
Ładowanie…
Reference in New Issue