CustomEmojis: make emojis small when it's appropriate for UX
This commit is contained in:
parent
be5a826783
commit
f13c6bedcb
|
@ -438,7 +438,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
|
||||||
private fun updateToolbar() {
|
private fun updateToolbar() {
|
||||||
loadedAccount?.let { account ->
|
loadedAccount?.let { account ->
|
||||||
|
|
||||||
val emojifiedName = emojifyString(account.name, account.emojis, accountToolbar)
|
val emojifiedName = emojifyString(account.name, account.emojis, accountToolbar, true)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
supportActionBar?.title = EmojiCompat.get().process(emojifiedName)
|
supportActionBar?.title = EmojiCompat.get().process(emojifiedName)
|
||||||
|
|
|
@ -130,7 +130,7 @@ class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreference
|
||||||
}
|
}
|
||||||
"statusTextSize", "absoluteTimeView", "showBotOverlay", "animateGifAvatars",
|
"statusTextSize", "absoluteTimeView", "showBotOverlay", "animateGifAvatars",
|
||||||
"useBlurhash", "showCardsInTimelines", "confirmReblogs", "hideMutedUsers",
|
"useBlurhash", "showCardsInTimelines", "confirmReblogs", "hideMutedUsers",
|
||||||
"enableSwipeForTabs" -> {
|
"enableSwipeForTabs", "bigEmojis" -> {
|
||||||
restartActivitiesOnExit = true
|
restartActivitiesOnExit = true
|
||||||
}
|
}
|
||||||
"language" -> {
|
"language" -> {
|
||||||
|
|
|
@ -18,7 +18,7 @@ internal class FollowRequestViewHolder(itemView: View, private val showHeader: B
|
||||||
fun setupWithAccount(account: Account, formatter: BidiFormatter?) {
|
fun setupWithAccount(account: Account, formatter: BidiFormatter?) {
|
||||||
id = account.id
|
id = account.id
|
||||||
val wrappedName = formatter?.unicodeWrap(account.name) ?: account.name
|
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
|
itemView.displayNameTextView.text = emojifiedName
|
||||||
if (showHeader) {
|
if (showHeader) {
|
||||||
itemView.notificationTextView?.text = itemView.context.getString(R.string.notification_follow_request_format, emojifiedName)
|
itemView.notificationTextView?.text = itemView.context.getString(R.string.notification_follow_request_format, emojifiedName)
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class MutedStatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setDisplayName(String name, List<Emoji> customEmojis) {
|
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);
|
displayName.setText(emojifiedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -347,13 +347,13 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
|
||||||
String format = context.getString(R.string.notification_follow_format);
|
String format = context.getString(R.string.notification_follow_format);
|
||||||
String wrappedDisplayName = bidiFormatter.unicodeWrap(account.getName());
|
String wrappedDisplayName = bidiFormatter.unicodeWrap(account.getName());
|
||||||
String wholeMessage = String.format(format, wrappedDisplayName);
|
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);
|
message.setText(emojifiedMessage);
|
||||||
|
|
||||||
String username = context.getString(R.string.status_username_format, account.getUsername());
|
String username = context.getString(R.string.status_username_format, account.getUsername());
|
||||||
usernameView.setText(username);
|
usernameView.setText(username);
|
||||||
|
|
||||||
CharSequence emojifiedDisplayName = CustomEmojiHelperKt.emojifyString(wrappedDisplayName, account.getEmojis(), usernameView);
|
CharSequence emojifiedDisplayName = CustomEmojiHelperKt.emojifyString(wrappedDisplayName, account.getEmojis(), usernameView, true);
|
||||||
|
|
||||||
displayNameView.setText(emojifiedDisplayName);
|
displayNameView.setText(emojifiedDisplayName);
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDisplayName(String name, List<Emoji> emojis) {
|
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);
|
displayName.setText(emojifiedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
||||||
protected abstract int getMediaPreviewHeight(Context context);
|
protected abstract int getMediaPreviewHeight(Context context);
|
||||||
|
|
||||||
protected void setDisplayName(String name, List<Emoji> customEmojis) {
|
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);
|
displayName.setText(emojifiedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue