Force custom emoji for reactions.
parent
1ff5b2af2a
commit
a5d7bc4efc
|
@ -23,6 +23,7 @@ import org.whispersystems.libsignal.util.guava.Optional;
|
|||
public class EmojiTextView extends AppCompatTextView {
|
||||
|
||||
private final boolean scaleEmojis;
|
||||
private final boolean forceCustom;
|
||||
|
||||
private static final char ELLIPSIS = '…';
|
||||
|
||||
|
@ -49,6 +50,7 @@ public class EmojiTextView extends AppCompatTextView {
|
|||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.EmojiTextView, 0, 0);
|
||||
scaleEmojis = a.getBoolean(R.styleable.EmojiTextView_scaleEmojis, false);
|
||||
maxLength = a.getInteger(R.styleable.EmojiTextView_emoji_maxLength, -1);
|
||||
forceCustom = a.getBoolean(R.styleable.EmojiTextView_emoji_forceCustom, false);
|
||||
a.recycle();
|
||||
|
||||
a = context.obtainStyledAttributes(attrs, new int[]{android.R.attr.textSize});
|
||||
|
@ -166,7 +168,7 @@ public class EmojiTextView extends AppCompatTextView {
|
|||
}
|
||||
|
||||
private boolean useSystemEmoji() {
|
||||
return TextSecurePreferences.isSystemEmojiPreferred(getContext());
|
||||
return !forceCustom && TextSecurePreferences.isSystemEmojiPreferred(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="62dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="6dp"
|
||||
|
@ -19,6 +20,7 @@
|
|||
android:includeFontPadding="false"
|
||||
android:textSize="22dp"
|
||||
android:textStyle="bold"
|
||||
app:emoji_forceCustom="true"
|
||||
tools:ignore="SpUsage"
|
||||
tools:text=":-)" />
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
android:layout_marginStart="16dp"
|
||||
android:gravity="center"
|
||||
android:textSize="22dp"
|
||||
app:emoji_forceCustom="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -16,6 +17,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16dp"
|
||||
app:emoji_forceCustom="true"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
<Space
|
||||
|
|
|
@ -336,6 +336,7 @@
|
|||
<declare-styleable name="EmojiTextView">
|
||||
<attr name="scaleEmojis" format="boolean" />
|
||||
<attr name="emoji_maxLength" format="integer" />
|
||||
<attr name="emoji_forceCustom" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="RingtonePreference">
|
||||
|
|
Loading…
Reference in New Issue