Add smaller and larger font options (fix #657) (#660)

* Add smaller and larger font options

* Fix test sizes, comment out translations
This commit is contained in:
Ivan Kupalov 2018-06-07 22:19:39 +02:00 committed by Konrad Pozniak
parent e63efdde5d
commit 7254a5d7d6
20 changed files with 151 additions and 110 deletions

View file

@ -66,10 +66,19 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
accountManager.setActiveAccount(accountId);
}
int style = textStyle(preferences.getString("statusTextSize", "medium"));
getTheme().applyStyle(style, false);
redirectIfNotLoggedIn();
callList = new ArrayList<>();
}
private int textStyle(String name) {
int style;
switch (preferences.getString("statusTextSize", "medium")) {
case "large":
style = R.style.TextSizeLarge;
switch (name) {
case "smallest":
style = R.style.TextSizeSmallest;
break;
case "small":
style = R.style.TextSizeSmall;
@ -78,14 +87,14 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
default:
style = R.style.TextSizeMedium;
break;
case "large":
style = R.style.TextSizeLarge;
break;
case "largest":
style = R.style.TextSizeLargest;
break;
}
getTheme().applyStyle(style, false);
redirectIfNotLoggedIn();
callList = new ArrayList<>();
return style;
}
@Override

View file

@ -207,11 +207,11 @@
<string name="pref_status_text_size">حجم الخط</string>
<string-array name="status_text_size_names">
<item>صغير</item>
<item>متوسط</item>
<item>كبير</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>صغير</item>-->
<!--<item>متوسط</item>-->
<!--<item>كبير</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">إشارات جديدة</string>
<string name="notification_channel_mention_descriptions">الإخطارات عندما يشار إليك</string>

View file

@ -184,11 +184,11 @@
<string name="pref_status_text_size">Mida de text de l\'estat</string>
<string-array name="status_text_size_names">
<item>Petita</item>
<item>Mitjana</item>
<item>Gran</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>Petita</item>-->
<!--<item>Mitjana</item>-->
<!--<item>Gran</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">Mencions noves</string>
<string name="notification_channel_mention_descriptions">Notificacions sobre mencions noves</string>

View file

@ -152,11 +152,11 @@
<string name="pref_status_text_size">Schriftgröße</string>
<string-array name="status_text_size_names">
<item>Klein</item>
<item>Normal</item>
<item>Groß</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>Klein</item>-->
<!--<item>Normal</item>-->
<!--<item>Groß</item>-->
<!--</string-array>-->
<string name="notification_mention_format">%s hat dich erwähnt</string>
<string name="notification_summary_large">%1$s, %2$s, %3$s und %4$d andere</string>

View file

@ -207,11 +207,11 @@
<string name="pref_status_text_size">Tamaño del texto</string>
<string-array name="status_text_size_names">
<item>Pequeño</item>
<item>Medio</item>
<item>Grande</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>Pequeño</item>-->
<!--<item>Medio</item>-->
<!--<item>Grande</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">Nuevas menciones</string>
<string name="notification_channel_mention_descriptions">Notificaciones de nuevas menciones</string>

View file

@ -216,11 +216,11 @@
<string name="pref_status_text_size">Taille du texte pour les status</string>
<string-array name="status_text_size_names">
<item>Petit</item>
<item>Moyen</item>
<item>Grand</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>Petit</item>-->
<!--<item>Moyen</item>-->
<!--<item>Grand</item>-->
<!--</string-array>-->
<string name="pref_title_alway_show_sensitive_media">Toujours afficher le contenu sensible</string>

View file

@ -202,11 +202,11 @@
<string name="pref_status_text_size">トゥートのテキストサイズ</string>
<string-array name="status_text_size_names">
<item></item>
<item></item>
<item></item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>小</item>-->
<!--<item>中</item>-->
<!--<item>大</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">新しい返信</string>
<string name="notification_channel_mention_descriptions">新しい返信の通知</string>

View file

@ -202,11 +202,11 @@
<string name="pref_status_text_size">Tekstgrootte status</string>
<string-array name="status_text_size_names">
<item>Klein</item>
<item>Medium</item>
<item>Groot</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>Klein</item>-->
<!--<item>Medium</item>-->
<!--<item>Groot</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">Nieuwe vermeldingen</string>
<string name="notification_channel_mention_descriptions">Meldingen over nieuwe vermeldingen</string>

View file

@ -212,11 +212,11 @@
<string name="pref_status_text_size">Talha de text de l\'estatut</string>
<string-array name="status_text_size_names">
<item>Pichona</item>
<item>Mejana</item>
<item>Granda</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>Pichona</item>-->
<!--<item>Mejana</item>-->
<!--<item>Granda</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">Mencions nòvas</string>
<string name="notification_channel_mention_descriptions">Notificacions de mencions noves</string>

View file

@ -225,11 +225,11 @@
<string name="pref_status_text_size">Rozmiar tekstu wpisów</string>
<string-array name="status_text_size_names">
<item>Mały</item>
<item>Średni</item>
<item>Duży</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>Mały</item>-->
<!--<item>Średni</item>-->
<!--<item>Duży</item>-->
<!--</string-array>-->

View file

@ -211,11 +211,11 @@
<string name="pref_status_text_size">Размер текста статусов</string>
<string-array name="status_text_size_names">
<item>Маленький</item>
<item>Средний</item>
<item>Большой</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>Маленький</item>-->
<!--<item>Средний</item>-->
<!--<item>Большой</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">Новые упоминания</string>
<string name="notification_channel_mention_descriptions">Уведомлять о новых упоминаниях</string>

View file

@ -195,11 +195,11 @@
<string name="pref_status_text_size">நிலை உரை அளவு</string>
<string-array name="status_text_size_names">
<item>சிறிய</item>
<item>நடுதர</item>
<item>பெரிய</item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>சிறிய</item>-->
<!--<item>நடுதர</item>-->
<!--<item>பெரிய</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">புதிய குறிப்புகள்</string>
<string name="notification_channel_mention_descriptions">புதிய குறிப்புகள் பற்றிய அறிவிப்புகள்</string>

View file

@ -203,11 +203,11 @@
<string name="pref_status_text_size">字体大小</string>
<string-array name="status_text_size_names">
<item></item>
<item></item>
<item></item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>小</item>-->
<!--<item>中</item>-->
<!--<item>大</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">被提及</string>
<string name="notification_channel_mention_descriptions">当有用户在嘟文中提及我时</string>

View file

@ -203,11 +203,11 @@
<string name="pref_status_text_size">字體大小</string>
<string-array name="status_text_size_names">
<item></item>
<item></item>
<item></item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>小</item>-->
<!--<item>中</item>-->
<!--<item>大</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">被提及</string>
<string name="notification_channel_mention_descriptions">當有用户在嘟文中提及我時</string>

View file

@ -203,11 +203,11 @@
<string name="pref_status_text_size">字體大小</string>
<string-array name="status_text_size_names">
<item></item>
<item></item>
<item></item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>小</item>-->
<!--<item>中</item>-->
<!--<item>大</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">被提及</string>
<string name="notification_channel_mention_descriptions">當有用户在嘟文中提及我時</string>

View file

@ -203,11 +203,11 @@
<string name="pref_status_text_size">字体大小</string>
<string-array name="status_text_size_names">
<item></item>
<item></item>
<item></item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>小</item>-->
<!--<item>中</item>-->
<!--<item>大</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">被提及</string>
<string name="notification_channel_mention_descriptions">当有用户在嘟文中提及我时</string>

View file

@ -203,11 +203,11 @@
<string name="pref_status_text_size">字體大小</string>
<string-array name="status_text_size_names">
<item></item>
<item></item>
<item></item>
</string-array>
<!--<string-array name="status_text_size_names">-->
<!--<item>小</item>-->
<!--<item>中</item>-->
<!--<item>大</item>-->
<!--</string-array>-->
<string name="notification_channel_mention_name">被提及</string>
<string name="notification_channel_mention_descriptions">當有用戶在嘟文中提及我時</string>

View file

@ -25,9 +25,11 @@
</string-array>
<string-array name="status_text_size_values">
<item>smallest</item>
<item>small</item>
<item>medium</item>
<item>large</item>
<item>largest</item>
</string-array>
<string-array name="app_theme_values">

View file

@ -214,9 +214,11 @@
<string name="pref_status_text_size">Status text size</string>
<string-array name="status_text_size_names">
<item>Smallest</item>
<item>Small</item>
<item>Medium</item>
<item>Large</item>
<item>Largest</item>
</string-array>
<string name="notification_channel_mention_name">New Mentions</string>

View file

@ -1,19 +1,33 @@
<resources>
<style name="TextSizeSmallest">
<item name="status_text_small">10sp</item>
<item name="status_text_medium">12sp</item>
<item name="status_text_large">14sp</item>
</style>
<style name="TextSizeSmall">
<item name="status_text_small">12dp</item>
<item name="status_text_medium">14dp</item>
<item name="status_text_large">16dp</item>
<item name="status_text_small">12sp</item>
<item name="status_text_medium">14sp</item>
<item name="status_text_large">16sp</item>
</style>
<style name="TextSizeMedium">
<item name="status_text_small">14dp</item>
<item name="status_text_medium">16dp</item>
<item name="status_text_large">18dp</item>
<item name="status_text_small">14sp</item>
<item name="status_text_medium">16sp</item>
<item name="status_text_large">18sp</item>
</style>
<style name="TextSizeLarge">
<item name="status_text_small">16dp</item>
<item name="status_text_medium">18dp</item>
<item name="status_text_large">20dp</item>
<item name="status_text_small">16sp</item>
<item name="status_text_medium">18sp</item>
<item name="status_text_large">20sp</item>
</style>
<style name="TextSizeLargest">
<item name="status_text_small">18sp</item>
<item name="status_text_medium">20sp</item>
<item name="status_text_large">22sp</item>`
</style>
<style name="TabLayoutTextStyle" parent="TextAppearance.Design.Tab">
@ -25,7 +39,7 @@
<item name="android:textColorSecondary">@color/text_color_secondary_dark</item>
<item name="android:textColorTertiary">@color/text_color_tertiary_dark</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
<item name="colorPrimaryDark">@color/color_primary_dark_dark</item>
@ -33,8 +47,10 @@
</style>
<!--Light Application Theme Styles-->
<style name="TuskyTheme" parent="TuskyBaseTheme"/>
<style name="TuskyTheme" parent="TuskyBaseTheme" />
<style name="TuskyDialogActivityTheme" parent="@style/TuskyTheme" />
<style name="TuskyBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/color_primary_light</item>
<item name="colorPrimaryDark">@color/color_primary_dark_light</item>
@ -48,8 +64,10 @@
<item name="android:textColorSecondary">@color/text_color_secondary_light</item>
<item name="android:textColorTertiary">@color/text_color_tertiary_light</item>
<item name="android:textColorPrimaryInverse">@color/text_color_primary_inverse_light</item>
<item name="android:textColorSecondaryInverse">@color/text_color_secondary_inverse_light</item>
<item name="android:textColorTertiaryInverse">@color/text_color_tertiary_inverse_light</item>
<item name="android:textColorSecondaryInverse">@color/text_color_secondary_inverse_light
</item>
<item name="android:textColorTertiaryInverse">@color/text_color_tertiary_inverse_light
</item>
<item name="android:actionMenuTextColor">@color/text_color_primary_light</item>
<item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog.Light</item>
@ -66,21 +84,30 @@
<item name="status_favourite_active_drawable">@drawable/favourite_active_light</item>
<item name="status_favourite_inactive_drawable">@drawable/favourite_inactive_light</item>
<item name="content_warning_button">@drawable/toggle_small_light</item>
<item name="sensitive_media_warning_background_color">@color/sensitive_media_warning_background_light</item>
<item name="sensitive_media_warning_background_color">
@color/sensitive_media_warning_background_light
</item>
<item name="media_preview_unloaded_drawable">@drawable/media_preview_unloaded_light</item>
<item name="status_divider_drawable">@drawable/status_divider_light</item>
<item name="conversation_thread_line_drawable">@drawable/conversation_thread_line_light</item>
<item name="conversation_thread_line_drawable">@drawable/conversation_thread_line_light
</item>
<item name="tab_icon_selected_tint">@color/color_accent_light</item>
<item name="tab_page_margin_drawable">@drawable/tab_page_margin_light</item>
<item name="account_header_background_color">@color/account_header_background_light</item>
<item name="account_toolbar_icon_tint_uncollapsed">@color/toolbar_icon_dark</item> <!--Default to dark on purpose, because header backgrounds with gradients are always dark.-->
<item name="account_toolbar_icon_tint_collapsed">@color/account_toolbar_icon_collapsed_light</item>
<item name="account_toolbar_icon_tint_uncollapsed">@color/toolbar_icon_dark
</item> <!--Default to dark on purpose, because header backgrounds with gradients are always dark.-->
<item name="account_toolbar_icon_tint_collapsed">
@color/account_toolbar_icon_collapsed_light
</item>
<item name="toolbar_popup_theme">@style/AppTheme.Account.ToolbarPopupTheme.Light</item>
<item name="compose_close_button_tint">@color/toolbar_icon_light</item>
<item name="compose_media_button_disabled_tint">@color/compose_media_button_disabled_light</item>
<item name="compose_media_button_disabled_tint">@color/compose_media_button_disabled_light
</item>
<item name="compose_mention_color">@color/compose_mention_light</item>
<item name="compose_content_warning_bar_background">@drawable/border_background_light</item>
<item name="compose_reply_content_background">@color/compose_reply_content_background_light</item>
<item name="compose_reply_content_background">
@color/compose_reply_content_background_light
</item>
<item name="report_status_background_color">@color/report_status_background_light</item>
<item name="report_status_divider_drawable">@drawable/report_status_divider_light</item>
@ -93,7 +120,8 @@
<item name="material_drawer_divider">@color/color_primary_dark_light</item>
<item name="material_drawer_selected">@color/color_primary_light</item>
<item name="material_drawer_selected_text">@color/text_color_primary_light</item>
<item name="material_drawer_header_selection_text">@color/text_color_primary_dark</item> <!--Intentionally dark so it can be overlayed over the account's header image.-->
<item name="material_drawer_header_selection_text">@color/text_color_primary_dark
</item> <!--Intentionally dark so it can be overlayed over the account's header image.-->
<item name="card_background">@drawable/card_frame_light</item>
<item name="card_image_background">@color/text_color_tertiary_light</item>