mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-19 06:27:30 +00:00
488767550e
Fixes #3134 Closes #3160 // FREEBIE
39 lines
1.1 KiB
Java
39 lines
1.1 KiB
Java
package org.thoughtcrime.securesms.components;
|
|
|
|
import android.content.Context;
|
|
import android.support.annotation.NonNull;
|
|
import android.support.v7.widget.AppCompatEditText;
|
|
import android.text.Spannable;
|
|
import android.text.SpannableString;
|
|
import android.text.TextUtils;
|
|
import android.text.style.RelativeSizeSpan;
|
|
import android.util.AttributeSet;
|
|
|
|
public class ComposeText extends AppCompatEditText {
|
|
public ComposeText(Context context) {
|
|
super(context);
|
|
}
|
|
|
|
public ComposeText(Context context, AttributeSet attrs) {
|
|
super(context, attrs);
|
|
}
|
|
|
|
public ComposeText(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
super(context, attrs, defStyleAttr);
|
|
}
|
|
|
|
public void setHint(@NonNull String hint) {
|
|
SpannableString span = new SpannableString(hint);
|
|
span.setSpan(new RelativeSizeSpan(0.8f), 0, hint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
|
super.setHint(span);
|
|
}
|
|
|
|
public void appendInvite(String invite) {
|
|
if (!TextUtils.isEmpty(getText()) && !getText().toString().equals(" ")) {
|
|
append(" ");
|
|
}
|
|
|
|
append(invite);
|
|
}
|
|
}
|