From 4cd07e3bb61d848590a953a37c8501962e2c0bd8 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Wed, 10 Jun 2020 12:22:19 +0800 Subject: Prepare to add different font support. --- .../infinityforreddit/Activity/BaseActivity.java | 18 +++++++-- .../Activity/ThemePreviewActivity.java | 6 +-- .../Activity/ViewGIFActivity.java | 6 +-- .../Activity/ViewImageActivity.java | 6 +-- .../Activity/ViewImgurMediaActivity.java | 6 +-- .../infinityforreddit/ContentFontStyle.java | 25 ------------ .../infinityforreddit/Font/ContentFontFamily.java | 25 ++++++++++++ .../infinityforreddit/Font/ContentFontStyle.java | 27 +++++++++++++ .../infinityforreddit/Font/FontFamily.java | 25 ++++++++++++ .../infinityforreddit/Font/FontStyle.java | 26 +++++++++++++ .../infinityforreddit/Font/TitleFontFamily.java | 25 ++++++++++++ .../infinityforreddit/Font/TitleFontStyle.java | 26 +++++++++++++ .../infinityforreddit/FontStyle.java | 24 ------------ .../infinityforreddit/TitleFontStyle.java | 24 ------------ .../Utils/SharedPreferencesUtils.java | 3 ++ app/src/main/res/font/balsamiq_sans.xml | 22 +++++++++++ app/src/main/res/font/balsamiq_sans_bold.ttf | Bin 0 -> 354180 bytes .../main/res/font/balsamiq_sans_bold_italic.ttf | Bin 0 -> 337284 bytes app/src/main/res/font/balsamiq_sans_italic.ttf | Bin 0 -> 366832 bytes app/src/main/res/font/balsamiq_sans_regular.ttf | Bin 0 -> 389784 bytes app/src/main/res/font/noto_sans.xml | 22 +++++++++++ app/src/main/res/font/noto_sans_bold.ttf | Bin 0 -> 398652 bytes app/src/main/res/font/noto_sans_bold_italic.ttf | Bin 0 -> 285736 bytes app/src/main/res/font/noto_sans_italic.ttf | Bin 0 -> 274624 bytes app/src/main/res/font/noto_sans_regular.ttf | Bin 0 -> 398968 bytes app/src/main/res/layout/activity_comment.xml | 6 ++- .../res/layout/activity_create_multi_reddit.xml | 8 +++- app/src/main/res/layout/activity_edit_comment.xml | 1 + .../main/res/layout/activity_edit_multi_reddit.xml | 1 + app/src/main/res/layout/activity_edit_post.xml | 6 ++- .../res/layout/activity_multi_reddit_listing.xml | 3 +- app/src/main/res/layout/activity_post_image.xml | 13 +++++-- app/src/main/res/layout/activity_post_link.xml | 15 ++++++-- app/src/main/res/layout/activity_post_text.xml | 15 ++++++-- app/src/main/res/layout/activity_post_video.xml | 13 +++++-- app/src/main/res/layout/activity_rules.xml | 2 + app/src/main/res/layout/activity_search.xml | 6 ++- ...tivity_subscribed_subreddits_multiselection.xml | 4 +- app/src/main/res/layout/activity_theme_preview.xml | 14 ++++--- app/src/main/res/layout/activity_view_gif.xml | 3 +- app/src/main/res/layout/activity_view_image.xml | 3 +- .../main/res/layout/activity_view_imgur_media.xml | 3 +- app/src/main/res/layout/activity_view_message.xml | 3 +- .../main/res/layout/activity_view_post_detail.xml | 3 +- .../res/layout/activity_view_subreddit_detail.xml | 9 ++++- .../main/res/layout/activity_view_user_detail.xml | 8 +++- app/src/main/res/layout/adapter_default_entry.xml | 3 +- app/src/main/res/layout/color_picker.xml | 21 ++++++++--- .../main/res/layout/copy_text_material_dialog.xml | 1 + app/src/main/res/layout/dialog_edit_flair.xml | 4 +- app/src/main/res/layout/dialog_edit_theme_name.xml | 3 +- .../layout/exo_autoplay_playback_control_view.xml | 9 +++-- .../main/res/layout/exo_playback_control_view.xml | 6 ++- .../layout/fragment_comment_more_bottom_sheet.xml | 11 ++++-- .../main/res/layout/fragment_comments_listing.xml | 4 +- .../res/layout/fragment_copy_text_bottom_sheet.xml | 4 ++ .../layout/fragment_create_theme_bottom_sheet.xml | 7 +++- .../fragment_custom_theme_options_bottom_sheet.xml | 7 +++- .../res/layout/fragment_flair_bottom_sheet.xml | 6 ++- .../res/layout/fragment_followed_users_listing.xml | 3 +- .../res/layout/fragment_multi_reddit_listing.xml | 3 +- .../fragment_multi_reddit_options_bottom_sheet.xml | 2 + app/src/main/res/layout/fragment_post.xml | 3 +- ...ragment_post_comment_sort_type_bottom_sheet.xml | 27 ++++++++----- .../layout/fragment_post_layot_bottom_sheet.xml | 6 ++- .../res/layout/fragment_post_type_bottom_sheet.xml | 4 ++ ...fragment_search_post_sort_type_bottom_sheet.xml | 5 +++ ...h_user_and_subreddit_sort_type_bottom_sheet.xml | 2 + .../layout/fragment_share_link_bottom_sheet.xml | 4 ++ .../res/layout/fragment_sort_time_bottom_sheet.xml | 6 +++ .../res/layout/fragment_sort_type_bottom_sheet.xml | 7 ++++ .../main/res/layout/fragment_subreddit_listing.xml | 3 +- .../fragment_subscribed_subreddits_listing.xml | 3 +- .../res/layout/fragment_theme_preview_comments.xml | 7 +++- .../res/layout/fragment_theme_preview_posts.xml | 19 ++++++++-- .../res/layout/fragment_url_menu_bottom_sheet.xml | 3 ++ app/src/main/res/layout/fragment_user_listing.xml | 4 +- .../fragment_user_thing_sort_type_bottom_sheet.xml | 4 ++ .../main/res/layout/fragment_view_imgur_images.xml | 3 +- app/src/main/res/layout/item_acknowledgement.xml | 6 ++- app/src/main/res/layout/item_comment.xml | 12 +++++- .../main/res/layout/item_comment_footer_error.xml | 6 ++- .../res/layout/item_custom_theme_color_item.xml | 6 ++- .../res/layout/item_custom_theme_switch_item.xml | 6 ++- .../res/layout/item_favorite_thing_divider.xml | 3 +- app/src/main/res/layout/item_flair.xml | 3 +- app/src/main/res/layout/item_footer_error.xml | 6 ++- .../item_load_comments_failed_placeholder.xml | 3 +- .../layout/item_load_more_comments_placeholder.xml | 3 +- app/src/main/res/layout/item_message.xml | 12 ++++-- app/src/main/res/layout/item_multi_reddit.xml | 1 + .../main/res/layout/item_nav_drawer_account.xml | 3 +- .../layout/item_nav_drawer_menu_group_title.xml | 3 +- .../main/res/layout/item_nav_drawer_menu_item.xml | 3 +- .../layout/item_nav_drawer_subscribed_thing.xml | 1 + .../res/layout/item_no_comment_placeholder.xml | 3 +- app/src/main/res/layout/item_post_compact.xml | 11 ++++++ .../item_post_detail_image_and_gif_autoplay.xml | 18 +++++++-- app/src/main/res/layout/item_post_detail_link.xml | 21 ++++++++--- .../layout/item_post_detail_no_preview_link.xml | 20 +++++++--- app/src/main/res/layout/item_post_detail_text.xml | 15 +++++++- .../item_post_detail_video_and_gif_preview.xml | 18 +++++++-- .../res/layout/item_post_detail_video_autoplay.xml | 17 +++++++-- .../layout/item_post_image_and_gif_autoplay.xml | 16 +++++++- app/src/main/res/layout/item_post_link.xml | 17 ++++++++- .../main/res/layout/item_post_no_preview_link.xml | 16 +++++++- app/src/main/res/layout/item_post_text.xml | 14 ++++++- .../res/layout/item_post_video_and_gif_preview.xml | 16 +++++++- .../res/layout/item_post_video_type_autoplay.xml | 13 ++++++- .../res/layout/item_predefined_custom_theme.xml | 3 +- app/src/main/res/layout/item_report_reason.xml | 4 +- app/src/main/res/layout/item_rule.xml | 7 ++-- .../main/res/layout/item_selected_subreddit.xml | 4 +- app/src/main/res/layout/item_subreddit_listing.xml | 2 +- .../item_subscribed_subreddit_multi_selection.xml | 4 +- app/src/main/res/layout/item_subscribed_thing.xml | 2 +- app/src/main/res/layout/item_theme_name.xml | 6 ++- .../main/res/layout/item_theme_type_divider.xml | 3 +- app/src/main/res/layout/item_user_custom_theme.xml | 3 +- app/src/main/res/layout/item_user_listing.xml | 2 +- app/src/main/res/layout/item_view_all_comments.xml | 4 +- app/src/main/res/layout/nav_header_main.xml | 4 +- app/src/main/res/layout/view_table_entry_cell.xml | 1 + app/src/main/res/values/attr.xml | 12 ++++++ app/src/main/res/values/styles.xml | 42 +++++++++++++++++++++ 125 files changed, 805 insertions(+), 249 deletions(-) delete mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/ContentFontStyle.java create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/Font/ContentFontFamily.java create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/Font/ContentFontStyle.java create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/Font/FontFamily.java create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/Font/FontStyle.java create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/Font/TitleFontFamily.java create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/Font/TitleFontStyle.java delete mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/FontStyle.java delete mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/TitleFontStyle.java create mode 100644 app/src/main/res/font/balsamiq_sans.xml create mode 100644 app/src/main/res/font/balsamiq_sans_bold.ttf create mode 100644 app/src/main/res/font/balsamiq_sans_bold_italic.ttf create mode 100644 app/src/main/res/font/balsamiq_sans_italic.ttf create mode 100644 app/src/main/res/font/balsamiq_sans_regular.ttf create mode 100644 app/src/main/res/font/noto_sans.xml create mode 100644 app/src/main/res/font/noto_sans_bold.ttf create mode 100644 app/src/main/res/font/noto_sans_bold_italic.ttf create mode 100644 app/src/main/res/font/noto_sans_italic.ttf create mode 100644 app/src/main/res/font/noto_sans_regular.ttf (limited to 'app') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java index 1eb8aa0a..883d0ce8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java @@ -27,11 +27,14 @@ import com.google.android.material.tabs.TabLayout; import ml.docilealligator.infinityforreddit.ActivityToolbarInterface; import ml.docilealligator.infinityforreddit.AppBarStateChangeListener; -import ml.docilealligator.infinityforreddit.ContentFontStyle; import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeWrapper; -import ml.docilealligator.infinityforreddit.FontStyle; +import ml.docilealligator.infinityforreddit.Font.ContentFontFamily; +import ml.docilealligator.infinityforreddit.Font.ContentFontStyle; +import ml.docilealligator.infinityforreddit.Font.FontFamily; +import ml.docilealligator.infinityforreddit.Font.FontStyle; +import ml.docilealligator.infinityforreddit.Font.TitleFontFamily; +import ml.docilealligator.infinityforreddit.Font.TitleFontStyle; import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.TitleFontStyle; import ml.docilealligator.infinityforreddit.Utils.CustomThemeSharedPreferencesUtils; import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils; @@ -113,6 +116,15 @@ public abstract class BaseActivity extends AppCompatActivity { getTheme().applyStyle(ContentFontStyle.valueOf(mSharedPreferences .getString(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY, ContentFontStyle.Normal.name())).getResId(), true); + getTheme().applyStyle(FontFamily.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_FAMILY_KEY, FontFamily.Default.name())).getResId(), true); + + getTheme().applyStyle(TitleFontFamily.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.TITLE_FONT_FAMILY_KEY, TitleFontFamily.Default.name())).getResId(), true); + + getTheme().applyStyle(ContentFontFamily.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.CONTENT_FONT_FAMILY_KEY, ContentFontFamily.Default.name())).getResId(), true); + Window window = getWindow(); View decorView = window.getDecorView(); if (!hasDrawerLayout) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java index c9a08f48..015f0a37 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java @@ -41,15 +41,15 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.AppBarStateChangeListener; -import ml.docilealligator.infinityforreddit.ContentFontStyle; +import ml.docilealligator.infinityforreddit.Font.ContentFontStyle; import ml.docilealligator.infinityforreddit.CustomTheme.CustomTheme; import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeSettingsItem; -import ml.docilealligator.infinityforreddit.FontStyle; +import ml.docilealligator.infinityforreddit.Font.FontStyle; import ml.docilealligator.infinityforreddit.Fragment.ThemePreviewCommentsFragment; import ml.docilealligator.infinityforreddit.Fragment.ThemePreviewPostsFragment; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.TitleFontStyle; +import ml.docilealligator.infinityforreddit.Font.TitleFontStyle; import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils; import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java index 8bdc82fe..59521940 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewGIFActivity.java @@ -47,11 +47,11 @@ import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.AsyncTask.SaveGIFToFileAsyncTask; import ml.docilealligator.infinityforreddit.BuildConfig; -import ml.docilealligator.infinityforreddit.ContentFontStyle; -import ml.docilealligator.infinityforreddit.FontStyle; +import ml.docilealligator.infinityforreddit.Font.ContentFontStyle; +import ml.docilealligator.infinityforreddit.Font.FontStyle; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.TitleFontStyle; +import ml.docilealligator.infinityforreddit.Font.TitleFontStyle; import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils; import pl.droidsonroids.gif.GifImageView; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java index 779d7fe7..6db185e0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java @@ -49,11 +49,11 @@ import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.AsyncTask.SaveImageToFileAsyncTask; import ml.docilealligator.infinityforreddit.BuildConfig; -import ml.docilealligator.infinityforreddit.ContentFontStyle; -import ml.docilealligator.infinityforreddit.FontStyle; +import ml.docilealligator.infinityforreddit.Font.ContentFontStyle; +import ml.docilealligator.infinityforreddit.Font.FontStyle; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.TitleFontStyle; +import ml.docilealligator.infinityforreddit.Font.TitleFontStyle; import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils; public class ViewImageActivity extends AppCompatActivity { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImgurMediaActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImgurMediaActivity.java index 9e0b95e7..7d776ed6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImgurMediaActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImgurMediaActivity.java @@ -33,14 +33,14 @@ import javax.inject.Named; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.API.ImgurAPI; -import ml.docilealligator.infinityforreddit.ContentFontStyle; -import ml.docilealligator.infinityforreddit.FontStyle; +import ml.docilealligator.infinityforreddit.Font.ContentFontStyle; +import ml.docilealligator.infinityforreddit.Font.FontStyle; import ml.docilealligator.infinityforreddit.Fragment.ViewImgurImageFragment; import ml.docilealligator.infinityforreddit.Fragment.ViewImgurVideoFragment; import ml.docilealligator.infinityforreddit.ImgurMedia; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.TitleFontStyle; +import ml.docilealligator.infinityforreddit.Font.TitleFontStyle; import ml.docilealligator.infinityforreddit.Utils.APIUtils; import ml.docilealligator.infinityforreddit.Utils.JSONUtils; import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ContentFontStyle.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ContentFontStyle.java deleted file mode 100644 index 4eee6b53..00000000 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ContentFontStyle.java +++ /dev/null @@ -1,25 +0,0 @@ -package ml.docilealligator.infinityforreddit; - -public enum ContentFontStyle { - Small(R.style.ContentFontStyle_Small, "Small"), - Normal(R.style.ContentFontStyle_Normal, "Normal"), - Large(R.style.ContentFontStyle_Large, "Large"), - XLarge(R.style.ContentFontStyle_XLarge, "XLarge"), - XXLarge(R.style.ContentFontStyle_XXLarge, "XXLarge"); - - private int resId; - private String title; - - ContentFontStyle(int resId, String title) { - this.resId = resId; - this.title = title; - } - - public int getResId() { - return resId; - } - - public String getTitle() { - return title; - } -} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Font/ContentFontFamily.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/ContentFontFamily.java new file mode 100644 index 00000000..1ef28bbe --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/ContentFontFamily.java @@ -0,0 +1,25 @@ +package ml.docilealligator.infinityforreddit.Font; + +import ml.docilealligator.infinityforreddit.R; + +public enum ContentFontFamily { + Default(R.style.ContentFontFamily, "Default"), + BalsamiqSans(R.style.ContentFontFamily_BalsamiqSans, "BalsamiqSans"), + NotoSans(R.style.ContentFontFamily_NotoSans, "NotoSans"); + + private int resId; + private String title; + + ContentFontFamily(int resId, String title) { + this.resId = resId; + this.title = title; + } + + public int getResId() { + return resId; + } + + public String getTitle() { + return title; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Font/ContentFontStyle.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/ContentFontStyle.java new file mode 100644 index 00000000..654cff07 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/ContentFontStyle.java @@ -0,0 +1,27 @@ +package ml.docilealligator.infinityforreddit.Font; + +import ml.docilealligator.infinityforreddit.R; + +public enum ContentFontStyle { + Small(R.style.ContentFontStyle_Small, "Small"), + Normal(R.style.ContentFontStyle_Normal, "Normal"), + Large(R.style.ContentFontStyle_Large, "Large"), + XLarge(R.style.ContentFontStyle_XLarge, "XLarge"), + XXLarge(R.style.ContentFontStyle_XXLarge, "XXLarge"); + + private int resId; + private String title; + + ContentFontStyle(int resId, String title) { + this.resId = resId; + this.title = title; + } + + public int getResId() { + return resId; + } + + public String getTitle() { + return title; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Font/FontFamily.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/FontFamily.java new file mode 100644 index 00000000..f33873b2 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/FontFamily.java @@ -0,0 +1,25 @@ +package ml.docilealligator.infinityforreddit.Font; + +import ml.docilealligator.infinityforreddit.R; + +public enum FontFamily { + Default(R.style.FontFamily, "Default"), + BalsamiqSans(R.style.FontFamily_BalsamiqSans, "BalsamiqSans"), + NotoSans(R.style.FontFamily_NotoSans, "NotoSans"); + + private int resId; + private String title; + + FontFamily(int resId, String title) { + this.resId = resId; + this.title = title; + } + + public int getResId() { + return resId; + } + + public String getTitle() { + return title; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Font/FontStyle.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/FontStyle.java new file mode 100644 index 00000000..101b17b4 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/FontStyle.java @@ -0,0 +1,26 @@ +package ml.docilealligator.infinityforreddit.Font; + +import ml.docilealligator.infinityforreddit.R; + +public enum FontStyle { + Small(R.style.FontStyle_Small, "Small"), + Normal(R.style.FontStyle_Normal, "Normal"), + Large(R.style.FontStyle_Large, "Large"), + XLarge(R.style.FontStyle_XLarge, "XLarge"); + + private int resId; + private String title; + + FontStyle(int resId, String title) { + this.resId = resId; + this.title = title; + } + + public int getResId() { + return resId; + } + + public String getTitle() { + return title; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Font/TitleFontFamily.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/TitleFontFamily.java new file mode 100644 index 00000000..2b9a73b0 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/TitleFontFamily.java @@ -0,0 +1,25 @@ +package ml.docilealligator.infinityforreddit.Font; + +import ml.docilealligator.infinityforreddit.R; + +public enum TitleFontFamily { + Default(R.style.TitleFontFamily, "Default"), + BalsamiqSans(R.style.TitleFontFamily_BalsamiqSans, "BalsamiqSans"), + NotoSans(R.style.TitleFontFamily_NotoSans, "NotoSans"); + + private int resId; + private String title; + + TitleFontFamily(int resId, String title) { + this.resId = resId; + this.title = title; + } + + public int getResId() { + return resId; + } + + public String getTitle() { + return title; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Font/TitleFontStyle.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/TitleFontStyle.java new file mode 100644 index 00000000..9ac48525 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Font/TitleFontStyle.java @@ -0,0 +1,26 @@ +package ml.docilealligator.infinityforreddit.Font; + +import ml.docilealligator.infinityforreddit.R; + +public enum TitleFontStyle { + Small(R.style.TitleFontStyle_Small, "Small"), + Normal(R.style.TitleFontStyle_Normal, "Normal"), + Large(R.style.TitleFontStyle_Large, "Large"), + XLarge(R.style.TitleFontStyle_XLarge, "XLarge"); + + private int resId; + private String title; + + TitleFontStyle(int resId, String title) { + this.resId = resId; + this.title = title; + } + + public int getResId() { + return resId; + } + + public String getTitle() { + return title; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FontStyle.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FontStyle.java deleted file mode 100644 index 61d4cfb8..00000000 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FontStyle.java +++ /dev/null @@ -1,24 +0,0 @@ -package ml.docilealligator.infinityforreddit; - -public enum FontStyle { - Small(R.style.FontStyle_Small, "Small"), - Normal(R.style.FontStyle_Normal, "Normal"), - Large(R.style.FontStyle_Large, "Large"), - XLarge(R.style.FontStyle_XLarge, "XLarge"); - - private int resId; - private String title; - - FontStyle(int resId, String title) { - this.resId = resId; - this.title = title; - } - - public int getResId() { - return resId; - } - - public String getTitle() { - return title; - } -} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/TitleFontStyle.java b/app/src/main/java/ml/docilealligator/infinityforreddit/TitleFontStyle.java deleted file mode 100644 index 5dc32c9d..00000000 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/TitleFontStyle.java +++ /dev/null @@ -1,24 +0,0 @@ -package ml.docilealligator.infinityforreddit; - -public enum TitleFontStyle { - Small(R.style.TitleFontStyle_Small, "Small"), - Normal(R.style.TitleFontStyle_Normal, "Normal"), - Large(R.style.TitleFontStyle_Large, "Large"), - XLarge(R.style.TitleFontStyle_XLarge, "XLarge"); - - private int resId; - private String title; - - TitleFontStyle(int resId, String title) { - this.resId = resId; - this.title = title; - } - - public int getResId() { - return resId; - } - - public String getTitle() { - return title; - } -} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java index a51c9e0b..b29ff3ed 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java @@ -29,6 +29,9 @@ public class SharedPreferencesUtils { public static final String FONT_SIZE_KEY = "font_size"; public static final String TITLE_FONT_SIZE_KEY = "title_font_size"; public static final String CONTENT_FONT_SIZE_KEY = "content_font_size"; + public static final String FONT_FAMILY_KEY = "font_family"; + public static final String TITLE_FONT_FAMILY_KEY = "title_font_family"; + public static final String CONTENT_FONT_FAMILY_KEY = "content_font_family"; public static final String AMOLED_DARK_KEY = "amoled_dark"; public static final String IMMERSIVE_INTERFACE_KEY = "immersive_interface"; public static final String IMMERSIVE_INTERFACE_IGNORE_NAV_BAR_KEY = "immersive_interface_ignore_nav_bar"; diff --git a/app/src/main/res/font/balsamiq_sans.xml b/app/src/main/res/font/balsamiq_sans.xml new file mode 100644 index 00000000..01faaeb6 --- /dev/null +++ b/app/src/main/res/font/balsamiq_sans.xml @@ -0,0 +1,22 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/font/balsamiq_sans_bold.ttf b/app/src/main/res/font/balsamiq_sans_bold.ttf new file mode 100644 index 00000000..840ff319 Binary files /dev/null and b/app/src/main/res/font/balsamiq_sans_bold.ttf differ diff --git a/app/src/main/res/font/balsamiq_sans_bold_italic.ttf b/app/src/main/res/font/balsamiq_sans_bold_italic.ttf new file mode 100644 index 00000000..9a8d7567 Binary files /dev/null and b/app/src/main/res/font/balsamiq_sans_bold_italic.ttf differ diff --git a/app/src/main/res/font/balsamiq_sans_italic.ttf b/app/src/main/res/font/balsamiq_sans_italic.ttf new file mode 100644 index 00000000..6c749d45 Binary files /dev/null and b/app/src/main/res/font/balsamiq_sans_italic.ttf differ diff --git a/app/src/main/res/font/balsamiq_sans_regular.ttf b/app/src/main/res/font/balsamiq_sans_regular.ttf new file mode 100644 index 00000000..5f3febff Binary files /dev/null and b/app/src/main/res/font/balsamiq_sans_regular.ttf differ diff --git a/app/src/main/res/font/noto_sans.xml b/app/src/main/res/font/noto_sans.xml new file mode 100644 index 00000000..5fe68106 --- /dev/null +++ b/app/src/main/res/font/noto_sans.xml @@ -0,0 +1,22 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/font/noto_sans_bold.ttf b/app/src/main/res/font/noto_sans_bold.ttf new file mode 100644 index 00000000..54ad879b Binary files /dev/null and b/app/src/main/res/font/noto_sans_bold.ttf differ diff --git a/app/src/main/res/font/noto_sans_bold_italic.ttf b/app/src/main/res/font/noto_sans_bold_italic.ttf new file mode 100644 index 00000000..530a8283 Binary files /dev/null and b/app/src/main/res/font/noto_sans_bold_italic.ttf differ diff --git a/app/src/main/res/font/noto_sans_italic.ttf b/app/src/main/res/font/noto_sans_italic.ttf new file mode 100644 index 00000000..27ff1ed6 Binary files /dev/null and b/app/src/main/res/font/noto_sans_italic.ttf differ diff --git a/app/src/main/res/font/noto_sans_regular.ttf b/app/src/main/res/font/noto_sans_regular.ttf new file mode 100644 index 00000000..10589e27 Binary files /dev/null and b/app/src/main/res/font/noto_sans_regular.ttf differ diff --git a/app/src/main/res/layout/activity_comment.xml b/app/src/main/res/layout/activity_comment.xml index 33b9cfc3..0fb6ef04 100644 --- a/app/src/main/res/layout/activity_comment.xml +++ b/app/src/main/res/layout/activity_comment.xml @@ -37,7 +37,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="16dp" - android:textSize="?attr/title_font_16" /> + android:textSize="?attr/title_font_16" + android:fontFamily="?attr/content_font_family" /> + android:textSize="?attr/content_font_18" + android:fontFamily="?attr/content_font_family" /> diff --git a/app/src/main/res/layout/activity_create_multi_reddit.xml b/app/src/main/res/layout/activity_create_multi_reddit.xml index a3a6f916..b606221d 100644 --- a/app/src/main/res/layout/activity_create_multi_reddit.xml +++ b/app/src/main/res/layout/activity_create_multi_reddit.xml @@ -51,6 +51,7 @@ android:textSize="?attr/font_default" android:background="#00000000" android:textColor="?attr/primaryTextColor" + android:fontFamily="?attr/font_family" android:maxLength="50" /> + android:textColor="?attr/primaryTextColor" + android:fontFamily="?attr/font_family" /> + android:textColor="?attr/primaryTextColor" + android:fontFamily="?attr/font_family" /> diff --git a/app/src/main/res/layout/activity_edit_comment.xml b/app/src/main/res/layout/activity_edit_comment.xml index 305c9578..79bc90f3 100644 --- a/app/src/main/res/layout/activity_edit_comment.xml +++ b/app/src/main/res/layout/activity_edit_comment.xml @@ -33,6 +33,7 @@ android:padding="16dp" android:textColor="?attr/primaryTextColor" android:textSize="?attr/content_font_18" + android:fontFamily="?attr/content_font_family" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_edit_multi_reddit.xml b/app/src/main/res/layout/activity_edit_multi_reddit.xml index c95ea6d1..c037daea 100644 --- a/app/src/main/res/layout/activity_edit_multi_reddit.xml +++ b/app/src/main/res/layout/activity_edit_multi_reddit.xml @@ -59,6 +59,7 @@ android:textSize="?attr/font_default" android:background="#00000000" android:textColor="?attr/primaryTextColor" + android:fontFamily="?attr/font_family" android:maxLength="50" /> + android:textColor="?attr/primaryTextColor" + android:fontFamily="?attr/title_font_family" /> + android:textColor="?attr/primaryTextColor" + android:fontFamily="?attr/content_font_family" /> diff --git a/app/src/main/res/layout/activity_multi_reddit_listing.xml b/app/src/main/res/layout/activity_multi_reddit_listing.xml index 6fdd794a..308374b2 100644 --- a/app/src/main/res/layout/activity_multi_reddit_listing.xml +++ b/app/src/main/res/layout/activity_multi_reddit_listing.xml @@ -66,7 +66,8 @@ android:layout_marginTop="16dp" android:gravity="center" android:text="@string/no_multi_reddits" - android:textSize="?attr/font_default" /> + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> diff --git a/app/src/main/res/layout/activity_post_image.xml b/app/src/main/res/layout/activity_post_image.xml index 8360f4b9..c6367aa1 100644 --- a/app/src/main/res/layout/activity_post_image.xml +++ b/app/src/main/res/layout/activity_post_image.xml @@ -57,7 +57,8 @@ android:layout_toStartOf="@id/rules_button_post_image_activity" android:layout_toEndOf="@id/subreddit_icon_gif_image_view_post_image_activity" android:text="@string/choose_a_subreddit" - android:textSize="?attr/font_default" /> + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" />