mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 17:23:38 +00:00
Revert "Do not decrease compose hint font size"
This reverts commit bf806bd717e53984a1f048f238e7a17fc0755263. Fixes #5297 // FREEBIE
This commit is contained in:
parent
a7cbe5e2a2
commit
5ce4e5a630
@ -5,9 +5,12 @@ import android.content.res.Configuration;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.InputType;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextUtils.TruncateAt;
|
||||
import android.text.style.RelativeSizeSpan;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
|
||||
@ -18,8 +21,8 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
||||
public class ComposeText extends EmojiEditText {
|
||||
|
||||
private CharSequence hint;
|
||||
private CharSequence subHint;
|
||||
private SpannableString hint;
|
||||
private SpannableString subHint;
|
||||
|
||||
public ComposeText(Context context) {
|
||||
super(context);
|
||||
@ -56,8 +59,15 @@ public class ComposeText extends EmojiEditText {
|
||||
}
|
||||
|
||||
public void setHint(@NonNull String hint, @Nullable CharSequence subHint) {
|
||||
this.hint = hint;
|
||||
this.subHint = subHint;
|
||||
this.hint = new SpannableString(hint);
|
||||
this.hint.setSpan(new RelativeSizeSpan(0.8f), 0, hint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
|
||||
if (subHint != null) {
|
||||
this.subHint = new SpannableString(subHint);
|
||||
this.subHint.setSpan(new RelativeSizeSpan(0.8f), 0, subHint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
} else {
|
||||
this.subHint = null;
|
||||
}
|
||||
|
||||
if (this.subHint != null) {
|
||||
super.setHint(new SpannableStringBuilder().append(ellipsizeToWidth(this.hint))
|
||||
|
Loading…
x
Reference in New Issue
Block a user