mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 02:08:40 +00:00
Start align text when displaying in smallest size otherwise center.
This commit is contained in:
committed by
Cody Henthorne
parent
6054285ddb
commit
ce8dafd33d
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.mediasend.v2.text
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.TypedValue
|
||||
import android.view.Gravity
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import org.signal.core.util.BreakIteratorCompat
|
||||
@@ -30,6 +31,12 @@ class TextStoryTextWatcher private constructor(private val textView: TextView) :
|
||||
else -> 18f
|
||||
}
|
||||
|
||||
if (expectedTextSize < 24f) {
|
||||
textView.gravity = Gravity.START
|
||||
} else {
|
||||
textView.gravity = Gravity.CENTER
|
||||
}
|
||||
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, DimensionUnit.DP.toPixels(expectedTextSize))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user