Change characters left color to red when negative (#1952)
* Change characters left color to red when negative * Use val for the integers, optimize variable assignment * Added tusky_red color * remove extra line typo * make characters left bold * change red hue * fix typo
This commit is contained in:
parent
8e2e815b84
commit
3b67f339b1
|
@ -682,7 +682,15 @@ class ComposeActivity : BaseActivity(),
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateVisibleCharactersLeft() {
|
private fun updateVisibleCharactersLeft() {
|
||||||
composeCharactersLeftView.text = String.format(Locale.getDefault(), "%d", maximumTootCharacters - calculateTextLength())
|
val remainingLength = maximumTootCharacters - calculateTextLength();
|
||||||
|
composeCharactersLeftView.text = String.format(Locale.getDefault(), "%d", remainingLength)
|
||||||
|
|
||||||
|
val textColor = if (remainingLength < 0) {
|
||||||
|
ContextCompat.getColor(this, R.color.tusky_red)
|
||||||
|
} else {
|
||||||
|
ThemeUtils.getColor(this, android.R.attr.textColorTertiary)
|
||||||
|
}
|
||||||
|
composeCharactersLeftView.setTextColor(textColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onContentWarningChanged() {
|
private fun onContentWarningChanged() {
|
||||||
|
|
|
@ -327,6 +327,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="?android:textColorTertiary"
|
android:textColor="?android:textColorTertiary"
|
||||||
android:textSize="?attr/status_text_medium"
|
android:textSize="?attr/status_text_medium"
|
||||||
|
android:textStyle="bold"
|
||||||
tools:text="500" />
|
tools:text="500" />
|
||||||
|
|
||||||
<com.keylesspalace.tusky.components.compose.view.TootButton
|
<com.keylesspalace.tusky.components.compose.view.TootButton
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<color name="tusky_orange_light">#fab207</color>
|
<color name="tusky_orange_light">#fab207</color>
|
||||||
<color name="tusky_green">#19a341</color>
|
<color name="tusky_green">#19a341</color>
|
||||||
<color name="tusky_green_light">#25d069</color>
|
<color name="tusky_green_light">#25d069</color>
|
||||||
|
<color name="tusky_red">#DF1553</color>
|
||||||
|
|
||||||
<color name="white">#fff</color>
|
<color name="white">#fff</color>
|
||||||
<color name="black">#000</color>
|
<color name="black">#000</color>
|
||||||
|
|
Loading…
Reference in New Issue