Start align text when displaying in smallest size otherwise center.
This commit is contained in:
parent
6054285ddb
commit
ce8dafd33d
1 changed files with 7 additions and 0 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue