#559 Use emojis for checkboxes in widgets if possible - special decision for samsung

This commit is contained in:
Stefan Niedermann 2021-03-07 18:55:33 +01:00 committed by Niedermann IT-Dienstleistungen
parent 1e152e48fb
commit a153462dfa

View file

@ -91,8 +91,17 @@ public class MarkdownUtil {
@Nullable
private static String getCheckboxEmoji(boolean checked) {
final String[] checkedEmojis = new String[]{"", "☑️", "✔️"};
final String[] uncheckedEmojis = new String[]{"", "\uD83D\uDD32", "☐️"};
final String[] checkedEmojis;
final String[] uncheckedEmojis;
// Seriously what the fuck, Samsung?
// https://emojipedia.org/ballot-box-with-x/
if(Build.MANUFACTURER.toLowerCase().contains("samsung")) {
checkedEmojis = new String[]{"", "☑️", "✔️"};
uncheckedEmojis = new String[]{"", "\uD83D\uDD32", "☐️"};
} else {
checkedEmojis = new String[]{"", "", "☑️", "✔️"};
uncheckedEmojis = new String[]{"", "", "\uD83D\uDD32", "☐️"};
}
final Paint paint = new Paint();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
for (String emoji : checked ? checkedEmojis : uncheckedEmojis) {