From 6417f31767d6ba4d04a1c24c46180a988f0bcdf2 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 May 2020 22:19:34 +0300 Subject: [PATCH] CustomEmojis: make emojis small when it's appropriate for UX --- .../main/java/com/keylesspalace/tusky/AccountActivity.kt | 2 +- .../java/com/keylesspalace/tusky/PreferencesActivity.kt | 2 +- .../keylesspalace/tusky/adapter/FollowRequestViewHolder.kt | 2 +- .../keylesspalace/tusky/adapter/MutedStatusViewHolder.java | 2 +- .../keylesspalace/tusky/adapter/NotificationsAdapter.java | 6 +++--- .../keylesspalace/tusky/adapter/StatusBaseViewHolder.java | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt index 86fa2ea5..0ea00bc8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt @@ -438,7 +438,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI private fun updateToolbar() { loadedAccount?.let { account -> - val emojifiedName = emojifyString(account.name, account.emojis, accountToolbar) + val emojifiedName = emojifyString(account.name, account.emojis, accountToolbar, true) try { supportActionBar?.title = EmojiCompat.get().process(emojifiedName) diff --git a/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.kt b/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.kt index 4d117d71..b091adf7 100644 --- a/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.kt @@ -130,7 +130,7 @@ class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreference } "statusTextSize", "absoluteTimeView", "showBotOverlay", "animateGifAvatars", "useBlurhash", "showCardsInTimelines", "confirmReblogs", "hideMutedUsers", - "enableSwipeForTabs" -> { + "enableSwipeForTabs", "bigEmojis" -> { restartActivitiesOnExit = true } "language" -> { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/FollowRequestViewHolder.kt b/app/src/main/java/com/keylesspalace/tusky/adapter/FollowRequestViewHolder.kt index 98c29f67..b973c57b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/FollowRequestViewHolder.kt +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/FollowRequestViewHolder.kt @@ -18,7 +18,7 @@ internal class FollowRequestViewHolder(itemView: View, private val showHeader: B fun setupWithAccount(account: Account, formatter: BidiFormatter?) { id = account.id val wrappedName = formatter?.unicodeWrap(account.name) ?: account.name - val emojifiedName: CharSequence = emojifyString(wrappedName, account.emojis, itemView) + val emojifiedName: CharSequence = emojifyString(wrappedName, account.emojis, itemView, true) itemView.displayNameTextView.text = emojifiedName if (showHeader) { itemView.notificationTextView?.text = itemView.context.getString(R.string.notification_follow_request_format, emojifiedName) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/MutedStatusViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/MutedStatusViewHolder.java index 2725d5e9..07ec7f44 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/MutedStatusViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/MutedStatusViewHolder.java @@ -48,7 +48,7 @@ public class MutedStatusViewHolder extends RecyclerView.ViewHolder { } protected void setDisplayName(String name, List customEmojis) { - CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, customEmojis, displayName); + CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, customEmojis, displayName, true); displayName.setText(emojifiedName); } diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java index 79e64b80..560ea9f6 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java @@ -347,13 +347,13 @@ public class NotificationsAdapter extends RecyclerView.Adapter { String format = context.getString(R.string.notification_follow_format); String wrappedDisplayName = bidiFormatter.unicodeWrap(account.getName()); String wholeMessage = String.format(format, wrappedDisplayName); - CharSequence emojifiedMessage = CustomEmojiHelperKt.emojifyString(wholeMessage, account.getEmojis(), message); + CharSequence emojifiedMessage = CustomEmojiHelperKt.emojifyString(wholeMessage, account.getEmojis(), message, true); message.setText(emojifiedMessage); String username = context.getString(R.string.status_username_format, account.getUsername()); usernameView.setText(username); - CharSequence emojifiedDisplayName = CustomEmojiHelperKt.emojifyString(wrappedDisplayName, account.getEmojis(), usernameView); + CharSequence emojifiedDisplayName = CustomEmojiHelperKt.emojifyString(wrappedDisplayName, account.getEmojis(), usernameView, true); displayNameView.setText(emojifiedDisplayName); @@ -429,7 +429,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter { } private void setDisplayName(String name, List emojis) { - CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, emojis, displayName); + CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, emojis, displayName, true); displayName.setText(emojifiedName); } diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index f8f779d9..70113a88 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -195,7 +195,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { protected abstract int getMediaPreviewHeight(Context context); protected void setDisplayName(String name, List customEmojis) { - CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, customEmojis, displayName); + CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, customEmojis, displayName, true); displayName.setText(emojifiedName); }