kopia lustrzana https://github.com/ryukoposting/Signal-Android
Use jumbo emoji in reaction pickers.
rodzic
9d9e6e2972
commit
3fbc5423e5
|
@ -1,26 +1,39 @@
|
|||
package org.thoughtcrime.securesms.components.emoji;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
||||
public class EmojiImageView extends AppCompatImageView {
|
||||
|
||||
private final boolean forceJumboEmoji;
|
||||
|
||||
public EmojiImageView(Context context) {
|
||||
super(context);
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public EmojiImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public EmojiImageView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.EmojiImageView, 0, 0);
|
||||
forceJumboEmoji = a.getBoolean(R.styleable.EmojiImageView_forceJumbo, false);
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
public void setImageEmoji(CharSequence emoji) {
|
||||
if (isInEditMode()) {
|
||||
setImageResource(R.drawable.ic_emoji);
|
||||
} else {
|
||||
setImageDrawable(EmojiProvider.getEmojiDrawable(getContext(), emoji));
|
||||
setImageDrawable(EmojiProvider.getEmojiDrawable(getContext(), emoji, forceJumboEmoji));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -88,6 +89,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_3"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_1"
|
||||
|
@ -101,6 +103,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_4"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_2"
|
||||
|
@ -114,6 +117,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_5"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_3"
|
||||
|
@ -127,6 +131,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_6"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_4"
|
||||
|
@ -140,6 +145,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_7"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_5"
|
||||
|
|
|
@ -74,9 +74,9 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/edit_reactions_fragment_scrubber"
|
||||
android:layout_width="@dimen/reaction_scrubber_width"
|
||||
android:clickable="false"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@drawable/conversation_reaction_overlay_background"
|
||||
android:clickable="false"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:elevation="4dp"
|
||||
|
@ -90,6 +90,7 @@
|
|||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:foreground="@drawable/dsl_preference_item_background_borderless"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -101,6 +102,7 @@
|
|||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:foreground="@drawable/dsl_preference_item_background_borderless"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_3"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_1"
|
||||
|
@ -112,6 +114,7 @@
|
|||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:foreground="@drawable/dsl_preference_item_background_borderless"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_4"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_2"
|
||||
|
@ -123,6 +126,7 @@
|
|||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:foreground="@drawable/dsl_preference_item_background_borderless"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_5"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_3"
|
||||
|
@ -134,6 +138,7 @@
|
|||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:foreground="@drawable/dsl_preference_item_background_borderless"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_6"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_4"
|
||||
|
@ -145,6 +150,7 @@
|
|||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:foreground="@drawable/dsl_preference_item_background_borderless"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_5"
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -52,6 +53,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_3"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_1"
|
||||
|
@ -65,6 +67,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_4"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_2"
|
||||
|
@ -78,6 +81,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_5"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_3"
|
||||
|
@ -91,6 +95,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_6"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_4"
|
||||
|
@ -104,6 +109,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/reaction_7"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_5"
|
||||
|
@ -117,6 +123,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:alpha="0"
|
||||
android:translationY="@dimen/reaction_scrubber_anim_start_translation_y"
|
||||
app:forceJumbo="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/reaction_6"
|
||||
|
|
|
@ -140,6 +140,10 @@
|
|||
<attr name="emoji_forceJumbo" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="EmojiImageView">
|
||||
<attr name="forceJumbo" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="RingtonePreference">
|
||||
<attr name="showAdd" format="boolean" />
|
||||
<attr name="summaryHasRingtone" format="string|reference" />
|
||||
|
|
Ładowanie…
Reference in New Issue