mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
parent
b0f7df93a4
commit
534ac22fd2
@ -6,6 +6,7 @@ import android.support.v7.widget.AppCompatEditText;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextUtils.TruncateAt;
|
||||
import android.text.style.RelativeSizeSpan;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
@ -24,6 +25,16 @@ public class ComposeText extends EmojiEditText {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
if (!TextUtils.isEmpty(getHint())) {
|
||||
setHint(TextUtils.ellipsize(getHint(),
|
||||
getPaint(),
|
||||
getWidth() - getPaddingLeft() - getPaddingRight(),
|
||||
TruncateAt.END));
|
||||
}
|
||||
}
|
||||
|
||||
public void setHint(@NonNull String hint) {
|
||||
SpannableString span = new SpannableString(hint);
|
||||
span.setSpan(new RelativeSizeSpan(0.8f), 0, hint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user