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

* Add smaller and larger font options

* Fix test sizes, comment out translations
main
Ivan Kupalov 7 years ago committed by Konrad Pozniak
parent 9027e997f8
commit 54d00f0ada
  1. 29
      app/src/main/java/com/keylesspalace/tusky/BaseActivity.java
  2. 10
      app/src/main/res/values-ar/strings.xml
  3. 10
      app/src/main/res/values-ca/strings.xml
  4. 10
      app/src/main/res/values-de/strings.xml
  5. 10
      app/src/main/res/values-es/strings.xml
  6. 10
      app/src/main/res/values-fr/strings.xml
  7. 10
      app/src/main/res/values-ja/strings.xml
  8. 10
      app/src/main/res/values-nl/strings.xml
  9. 10
      app/src/main/res/values-oc/strings.xml
  10. 10
      app/src/main/res/values-pl/strings.xml
  11. 10
      app/src/main/res/values-ru/strings.xml
  12. 10
      app/src/main/res/values-ta/strings.xml
  13. 10
      app/src/main/res/values-zh-rCN/strings.xml
  14. 10
      app/src/main/res/values-zh-rHK/strings.xml
  15. 10
      app/src/main/res/values-zh-rMO/strings.xml
  16. 10
      app/src/main/res/values-zh-rSG/strings.xml
  17. 10
      app/src/main/res/values-zh-rTW/strings.xml
  18. 2
      app/src/main/res/values/donottranslate.xml
  19. 2
      app/src/main/res/values/strings.xml
  20. 68
      app/src/main/res/values/styles.xml

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save