Do not decrease compose hint font size

Fixes #4903
Closes #5275
// FREEBIE
This commit is contained in:
Andreas Fehn 2016-02-21 22:41:38 +01:00 committed by Moxie Marlinspike
parent f2c5e904e8
commit bf806bd717

View File

@ -5,12 +5,9 @@ import android.content.res.Configuration;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.InputType; import android.text.InputType;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextUtils.TruncateAt; import android.text.TextUtils.TruncateAt;
import android.text.style.RelativeSizeSpan;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
@ -20,8 +17,8 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences;
public class ComposeText extends EmojiEditText { public class ComposeText extends EmojiEditText {
private SpannableString hint; private CharSequence hint;
private SpannableString subHint; private CharSequence subHint;
public ComposeText(Context context) { public ComposeText(Context context) {
super(context); super(context);
@ -58,15 +55,8 @@ public class ComposeText extends EmojiEditText {
} }
public void setHint(@NonNull String hint, @Nullable CharSequence subHint) { public void setHint(@NonNull String hint, @Nullable CharSequence subHint) {
this.hint = new SpannableString(hint); this.hint = hint;
this.hint.setSpan(new RelativeSizeSpan(0.8f), 0, hint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); this.subHint = subHint;
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) { if (this.subHint != null) {
super.setHint(new SpannableStringBuilder().append(ellipsizeToWidth(this.hint)) super.setHint(new SpannableStringBuilder().append(ellipsizeToWidth(this.hint))