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