CustomEmojis: make emojis small when it's appropriate for UX

This commit is contained in:
Alibek Omarov 2020-05-11 22:19:34 +03:00
parent beb9dd69e4
commit 6417f31767
6 changed files with 8 additions and 8 deletions

View File

@ -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)

View File

@ -130,7 +130,7 @@ class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreference
}
"statusTextSize", "absoluteTimeView", "showBotOverlay", "animateGifAvatars",
"useBlurhash", "showCardsInTimelines", "confirmReblogs", "hideMutedUsers",
"enableSwipeForTabs" -> {
"enableSwipeForTabs", "bigEmojis" -> {
restartActivitiesOnExit = true
}
"language" -> {

View File

@ -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)

View File

@ -48,7 +48,7 @@ public class MutedStatusViewHolder extends RecyclerView.ViewHolder {
}
protected void setDisplayName(String name, List<Emoji> customEmojis) {
CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, customEmojis, displayName);
CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, customEmojis, displayName, true);
displayName.setText(emojifiedName);
}

View File

@ -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<Emoji> emojis) {
CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, emojis, displayName);
CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, emojis, displayName, true);
displayName.setText(emojifiedName);
}

View File

@ -195,7 +195,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
protected abstract int getMediaPreviewHeight(Context context);
protected void setDisplayName(String name, List<Emoji> customEmojis) {
CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, customEmojis, displayName);
CharSequence emojifiedName = CustomEmojiHelperKt.emojifyString(name, customEmojis, displayName, true);
displayName.setText(emojifiedName);
}