diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-09-20 13:27:00 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-09-20 13:27:00 +0000 |
commit | 9ca494d4b5409b12b8262194f736284036858c01 (patch) | |
tree | eabfd8bda9a18cf2c8053d6916627f7ee6f06759 /app/src | |
parent | 010c323769faf9703a84144576ba33eb4410562e (diff) | |
download | infinity-for-reddit-9ca494d4b5409b12b8262194f736284036858c01.tar infinity-for-reddit-9ca494d4b5409b12b8262194f736284036858c01.tar.gz infinity-for-reddit-9ca494d4b5409b12b8262194f736284036858c01.tar.bz2 infinity-for-reddit-9ca494d4b5409b12b8262194f736284036858c01.tar.lz infinity-for-reddit-9ca494d4b5409b12b8262194f736284036858c01.tar.xz infinity-for-reddit-9ca494d4b5409b12b8262194f736284036858c01.tar.zst infinity-for-reddit-9ca494d4b5409b12b8262194f736284036858c01.zip |
Changing font size is available. Delete duplicate Edit menu in comments.
Diffstat (limited to 'app/src')
84 files changed, 496 insertions, 153 deletions
diff --git a/app/src/main/java/Settings/MainPreferenceFragment.java b/app/src/main/java/Settings/MainPreferenceFragment.java index 11093bf6..847112a9 100644 --- a/app/src/main/java/Settings/MainPreferenceFragment.java +++ b/app/src/main/java/Settings/MainPreferenceFragment.java @@ -15,6 +15,7 @@ import org.greenrobot.eventbus.EventBus; import javax.inject.Inject; +import ml.docilealligator.infinityforreddit.ChangeFontSizeEvent; import ml.docilealligator.infinityforreddit.ChangeNSFWBlurEvent; import ml.docilealligator.infinityforreddit.ChangeNSFWEvent; import ml.docilealligator.infinityforreddit.Infinity; @@ -44,7 +45,8 @@ public class MainPreferenceFragment extends PreferenceFragmentCompat { SwitchPreference nsfwSwitch = findPreference(SharedPreferencesUtils.NSFW_KEY); SwitchPreference blurNSFWSwitch = findPreference(SharedPreferencesUtils.BLUR_NSFW_KEY); - ListPreference listPreference = findPreference(SharedPreferencesUtils.THEME_KEY); + ListPreference themePreference = findPreference(SharedPreferencesUtils.THEME_KEY); + ListPreference fontSizePreference = findPreference(SharedPreferencesUtils.FONT_SIZE_KEY); if(nsfwSwitch != null) { nsfwSwitch.setOnPreferenceChangeListener((preference, newValue) -> { @@ -73,14 +75,14 @@ public class MainPreferenceFragment extends PreferenceFragmentCompat { boolean systemDefault = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q; - if(listPreference != null) { + if(themePreference != null) { if(systemDefault) { - listPreference.setEntries(R.array.settings_theme_q); + themePreference.setEntries(R.array.settings_theme_q); } else { - listPreference.setEntries(R.array.settings_theme); + themePreference.setEntries(R.array.settings_theme); } - listPreference.setOnPreferenceChangeListener((preference, newValue) -> { + themePreference.setOnPreferenceChangeListener((preference, newValue) -> { int option = Integer.parseInt((String) newValue); switch (option) { case 0: @@ -99,6 +101,14 @@ public class MainPreferenceFragment extends PreferenceFragmentCompat { return true; }); } + + if(fontSizePreference != null) { + fontSizePreference.setOnPreferenceChangeListener((preference, newValue) -> { + EventBus.getDefault().post(new ChangeFontSizeEvent((String) newValue)); + activity.recreate(); + return true; + }); + } } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AccountPostsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AccountPostsActivity.java index e2e0a5b8..3a99ebf1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AccountPostsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AccountPostsActivity.java @@ -67,12 +67,16 @@ public class AccountPostsActivity extends AppCompatActivity implements UserThing @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_account_posts); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); Resources resources = getResources(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AccountSavedThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AccountSavedThingActivity.java index 2b8206e4..ccd56a77 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AccountSavedThingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AccountSavedThingActivity.java @@ -75,12 +75,16 @@ public class AccountSavedThingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_account_saved_thing); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); Resources resources = getResources(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java index 4cbc8e2f..1c134841 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AppComponent.java @@ -44,4 +44,5 @@ public interface AppComponent { void inject(SettingsActivity settingsActivity); void inject(MainPreferenceFragment mainPreferenceFragment); void inject(AccountSavedThingActivity accountSavedThingActivity); + void inject(ViewImageActivity viewImageActivity); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ChangeFontSizeEvent.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ChangeFontSizeEvent.java new file mode 100644 index 00000000..78846c79 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ChangeFontSizeEvent.java @@ -0,0 +1,8 @@ +package ml.docilealligator.infinityforreddit; + +public class ChangeFontSizeEvent { + public String fontSize; + public ChangeFontSizeEvent(String fontSize) { + this.fontSize = fontSize; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentActivity.java index 17e4061c..5104bef8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentActivity.java @@ -83,12 +83,16 @@ public class CommentActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_comment); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/EditCommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/EditCommentActivity.java index c5606ae8..602095ea 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/EditCommentActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/EditCommentActivity.java @@ -72,12 +72,16 @@ public class EditCommentActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_edit_comment); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/EditPostActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/EditPostActivity.java index 882fe11c..d1352cdf 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/EditPostActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/EditPostActivity.java @@ -71,12 +71,16 @@ public class EditPostActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_edit_post); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FilteredThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FilteredThingActivity.java index 27a9ddf0..66ce2fcf 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FilteredThingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FilteredThingActivity.java @@ -78,12 +78,16 @@ public class FilteredThingActivity extends AppCompatActivity implements SortType @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_filtered_thing); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); Resources resources = getResources(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FontStyle.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FontStyle.java new file mode 100644 index 00000000..bb2448ca --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FontStyle.java @@ -0,0 +1,24 @@ +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; + + public int getResId() { + return resId; + } + + public String getTitle() { + return title; + } + + FontStyle(int resId, String title) { + this.resId = resId; + this.title = title; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java index d4365b0a..38cf5cc0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java @@ -166,11 +166,16 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe setTheme(R.style.AppTheme_NoActionBarWithTransparentStatusBar); super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_main); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); EventBus.getDefault().register(this); @@ -885,6 +890,11 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe sectionsPagerAdapter.changeNSFW(changeNSFWEvent.nsfw); } + @Subscribe + public void onChangeFontSizeEvent(ChangeFontSizeEvent changeFontSizeEvent) { + recreate(); + } + private class SectionsPagerAdapter extends FragmentPagerAdapter { private PostFragment frontPagePostFragment; private PostFragment popularPostFragment; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSource.java index 4b8deadd..0d13dc2e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSource.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSource.java @@ -1,5 +1,7 @@ package ml.docilealligator.infinityforreddit; +import android.util.Log; + import androidx.annotation.NonNull; import androidx.lifecycle.MutableLiveData; import androidx.paging.PageKeyedDataSource; @@ -69,6 +71,7 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { PostDataSource(Retrofit retrofit, String accessToken, Locale locale, String subredditOrUserName, int postType, String sortType, int filter, boolean nsfw) { + Log.i("asfdasdf", "datasource: " + sortType); this.retrofit = retrofit; this.accessToken = accessToken; this.locale = locale; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSourceFactory.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSourceFactory.java index 3942bec3..6e2aaa89 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSourceFactory.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSourceFactory.java @@ -1,5 +1,7 @@ package ml.docilealligator.infinityforreddit; +import android.util.Log; + import androidx.annotation.NonNull; import androidx.lifecycle.MutableLiveData; import androidx.paging.DataSource; @@ -37,6 +39,7 @@ class PostDataSourceFactory extends DataSource.Factory { PostDataSourceFactory(Retrofit retrofit, String accessToken, Locale locale, String subredditName, int postType, String sortType, int filter, boolean nsfw) { + Log.i("asfdasdf", "datasource factory: " + sortType); this.retrofit = retrofit; this.accessToken = accessToken; this.locale = locale; @@ -86,6 +89,7 @@ class PostDataSourceFactory extends DataSource.Factory { postDataSource = new PostDataSource(retrofit, accessToken, locale, subredditName, query, postType, sortType, filter, nsfw); } else if(postType == PostDataSource.TYPE_SUBREDDIT) { + Log.i("asfdasdf", "datasource create: " + sortType); postDataSource = new PostDataSource(retrofit, accessToken, locale, subredditName, postType, sortType, filter, nsfw); } else { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java index 67a0b247..6497f57c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java @@ -255,6 +255,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { int postType = getArguments().getInt(EXTRA_POST_TYPE); String sortType = getArguments().getString(EXTRA_SORT_TYPE); + int filter = getArguments().getInt(EXTRA_FILTER); String accessToken = getArguments().getString(EXTRA_ACCESS_TOKEN); boolean nsfw = mSharedPreferences.getBoolean(SharedPreferencesUtils.NSFW_KEY, false); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostImageActivity.java index 27c27fd2..1e2dc155 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostImageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostImageActivity.java @@ -133,14 +133,18 @@ public class PostImageActivity extends AppCompatActivity implements FlairBottomS @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_post_image); ButterKnife.bind(this); EventBus.getDefault().register(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { Window window = getWindow(); if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostLinkActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostLinkActivity.java index cab3288d..cf384682 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostLinkActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostLinkActivity.java @@ -110,14 +110,18 @@ public class PostLinkActivity extends AppCompatActivity implements FlairBottomSh @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_post_link); ButterKnife.bind(this); EventBus.getDefault().register(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { Window window = getWindow(); if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostTextActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostTextActivity.java index b8e967f2..5f1200b3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostTextActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostTextActivity.java @@ -110,14 +110,18 @@ public class PostTextActivity extends AppCompatActivity implements FlairBottomSh @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_post_text); ButterKnife.bind(this); EventBus.getDefault().register(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { Window window = getWindow(); if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java index eb3e51ff..f287fd07 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostVideoActivity.java @@ -143,14 +143,18 @@ public class PostVideoActivity extends AppCompatActivity implements FlairBottomS @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_post_video); ButterKnife.bind(this); EventBus.getDefault().register(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { Window window = getWindow(); if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostViewModel.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostViewModel.java index 412a0d0e..9340e20b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostViewModel.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostViewModel.java @@ -1,5 +1,7 @@ package ml.docilealligator.infinityforreddit; +import android.util.Log; + import androidx.annotation.NonNull; import androidx.core.util.Pair; import androidx.lifecycle.LiveData; @@ -58,6 +60,7 @@ public class PostViewModel extends ViewModel { public PostViewModel(Retrofit retrofit, String accessToken, Locale locale, String subredditName, int postType, String sortType, int filter, boolean nsfw) { + Log.i("asfdasdf", "viewmodel: " + sortType); postDataSourceFactory = new PostDataSourceFactory(retrofit, accessToken, locale, subredditName, postType, sortType, filter, nsfw); @@ -206,6 +209,7 @@ public class PostViewModel extends ViewModel { public Factory(Retrofit retrofit, String accessToken, Locale locale, String subredditName, int postType, String sortType, int filter, boolean nsfw) { + Log.i("asfdasdf", "viewmodel factory: " + sortType); this.retrofit = retrofit; this.accessToken = accessToken; this.locale = locale; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java index e519797a..8923e364 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java @@ -70,12 +70,16 @@ public class RulesActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_rules); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java index b1627f0b..a715014f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java @@ -67,12 +67,16 @@ public class SearchActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_search); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java index 9a6652c5..b0640071 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchResultActivity.java @@ -72,12 +72,16 @@ public class SearchResultActivity extends AppCompatActivity implements SearchPos @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_search_result); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchSubredditsResultActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchSubredditsResultActivity.java index c6bd9685..31118441 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchSubredditsResultActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchSubredditsResultActivity.java @@ -63,12 +63,16 @@ public class SearchSubredditsResultActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_search_subreddits_result); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SettingsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SettingsActivity.java index f963b0a4..4e8b0a64 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SettingsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SettingsActivity.java @@ -42,12 +42,16 @@ public class SettingsActivity extends AppCompatActivity implements @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.settings_activity); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { Window window = getWindow(); if((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SharedPreferencesUtils.java index e0b6672a..6bc34647 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SharedPreferencesUtils.java @@ -23,4 +23,5 @@ public class SharedPreferencesUtils { public static final String EMAIL_KEY = "email"; public static final String REDDIT_ACCOUNT_KEY = "reddit_account"; public static final String SUBREDDIT_KEY = "subreddit"; + public static final String FONT_SIZE_KEY = "font_size"; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java index 4bb67e27..e3d5d82d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditSelectionActivity.java @@ -82,12 +82,16 @@ public class SubredditSelectionActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_subreddit_selection); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java index 35d49eeb..15380d86 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedThingListingActivity.java @@ -75,12 +75,16 @@ public class SubscribedThingListingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_subscribed_thing_listing); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java index 3f81263f..2db793e5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java @@ -7,6 +7,7 @@ import android.animation.ValueAnimator; import android.app.DownloadManager; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.PorterDuff; import android.graphics.drawable.ColorDrawable; @@ -45,6 +46,8 @@ import com.github.pwittchen.swipe.library.rx2.Swipe; import java.io.File; +import javax.inject.Inject; + import butterknife.BindView; import butterknife.ButterKnife; @@ -76,10 +79,20 @@ public class ViewImageActivity extends AppCompatActivity { private boolean isSwiping = false; + @Inject + SharedPreferences mSharedPreferences; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_view_image); + ButterKnife.bind(this); ActionBar actionBar = getSupportActionBar(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewMessageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewMessageActivity.java index 34f1d653..5d748643 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewMessageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewMessageActivity.java @@ -86,12 +86,16 @@ public class ViewMessageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_view_message); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); mGlide = Glide.with(this); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java index 3063e0c0..d6d6c0b7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java @@ -139,6 +139,12 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_view_post_detail); Bridge.restoreInstanceState(this, savedInstanceState); @@ -147,8 +153,6 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo EventBus.getDefault().register(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - Resources resources = getResources(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java index cf950b2b..f567349f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java @@ -121,12 +121,16 @@ public class ViewSubredditDetailActivity extends AppCompatActivity implements So @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_view_subreddit_detail); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java index 91525a3e..d57e57f8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java @@ -127,12 +127,16 @@ public class ViewUserDetailActivity extends AppCompatActivity implements UserThi @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + ((Infinity) getApplication()).getAppComponent().inject(this); + + getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences + .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); + setContentView(R.layout.activity_view_user_detail); ButterKnife.bind(this); - ((Infinity) getApplication()).getAppComponent().inject(this); - EventBus.getDefault().register(this); boolean systemDefault = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q; diff --git a/app/src/main/res/layout/activity_comment.xml b/app/src/main/res/layout/activity_comment.xml index 494872ce..f5c5afe1 100644 --- a/app/src/main/res/layout/activity_comment.xml +++ b/app/src/main/res/layout/activity_comment.xml @@ -37,7 +37,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" - android:textSize="16sp" /> + android:textSize="?attr/font_16" /> <EditText android:id="@+id/comment_edit_text_comment_activity" @@ -46,7 +46,7 @@ android:gravity="top" android:hint="@string/write_comment_hint" android:inputType="textCapSentences|textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" /> diff --git a/app/src/main/res/layout/activity_edit_comment.xml b/app/src/main/res/layout/activity_edit_comment.xml index 93504c14..94f9b602 100644 --- a/app/src/main/res/layout/activity_edit_comment.xml +++ b/app/src/main/res/layout/activity_edit_comment.xml @@ -29,7 +29,7 @@ android:padding="16dp" android:hint="@string/post_text_content_hint" android:inputType="textCapSentences|textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> diff --git a/app/src/main/res/layout/activity_edit_post.xml b/app/src/main/res/layout/activity_edit_post.xml index e95ba34c..e7645c5e 100644 --- a/app/src/main/res/layout/activity_edit_post.xml +++ b/app/src/main/res/layout/activity_edit_post.xml @@ -37,7 +37,7 @@ android:layout_height="wrap_content" android:gravity="top" android:padding="16dp" - android:textSize="18sp" + android:textSize="?attr/font_18" android:textColor="@color/primaryTextColor" /> <View @@ -53,7 +53,7 @@ android:padding="16dp" android:hint="@string/post_text_content_hint" android:inputType="textCapSentences|textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" /> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 6d85662b..4cf0b16f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -45,7 +45,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="16dp" - android:text="@string/label_account" /> + android:text="@string/label_account" + android:textSize="?attr/font_default" /> <LinearLayout android:id="@+id/profile_linear_layout_main_activity" @@ -69,7 +70,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/profile" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -95,7 +97,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/subscriptions" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -121,7 +124,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/inbox" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -130,7 +134,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="16dp" - android:text="@string/label_post" /> + android:text="@string/label_post" + android:textSize="?attr/font_default" /> <LinearLayout android:id="@+id/upvoted_linear_layout_main_activity" @@ -154,7 +159,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/upvoted" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -180,7 +186,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/downvoted" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -206,7 +213,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/hidden" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -232,7 +240,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/saved" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -258,7 +267,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/gilded" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -290,7 +300,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/settings" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/activity_post_image.xml b/app/src/main/res/layout/activity_post_image.xml index 795e53cf..1cf36a16 100644 --- a/app/src/main/res/layout/activity_post_image.xml +++ b/app/src/main/res/layout/activity_post_image.xml @@ -55,7 +55,8 @@ android:layout_centerVertical="true" android:layout_marginStart="32dp" android:layout_marginEnd="16dp" - android:text="@string/choose_a_subreddit" /> + android:text="@string/choose_a_subreddit" + android:textSize="?attr/font_default" /> <Button android:id="@+id/rules_button_post_image_activity" @@ -64,7 +65,8 @@ android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:text="@string/rules" - android:textColor="@android:color/white" /> + android:textColor="@android:color/white" + android:textSize="?attr/font_default" /> </RelativeLayout> @@ -85,6 +87,7 @@ android:padding="4dp" android:text="@string/flair" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:visibility="gone" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorPrimaryDarkDayNightTheme" @@ -99,6 +102,7 @@ android:padding="4dp" android:text="@string/spoiler" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorPrimaryDarkDayNightTheme" app:lib_setRoundedView="true" @@ -112,6 +116,7 @@ android:padding="4dp" android:text="@string/nsfw" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorAccent" app:lib_setRoundedView="true" @@ -132,7 +137,7 @@ android:padding="16dp" android:hint="@string/post_title_hint" android:inputType="textCapSentences|textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" /> @@ -182,6 +187,7 @@ android:padding="16dp" android:text="@string/select_again" android:textColor="@color/colorAccent" + android:textSize="?attr/font_default" android:visibility="gone" /> <ImageView diff --git a/app/src/main/res/layout/activity_post_link.xml b/app/src/main/res/layout/activity_post_link.xml index 54c843bf..23374e78 100644 --- a/app/src/main/res/layout/activity_post_link.xml +++ b/app/src/main/res/layout/activity_post_link.xml @@ -55,7 +55,8 @@ android:layout_centerVertical="true" android:layout_marginStart="32dp" android:layout_marginEnd="16dp" - android:text="@string/choose_a_subreddit" /> + android:text="@string/choose_a_subreddit" + android:textSize="?attr/font_default" /> <Button android:id="@+id/rules_button_post_link_activity" @@ -64,7 +65,8 @@ android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:text="@string/rules" - android:textColor="@android:color/white" /> + android:textColor="@android:color/white" + android:textSize="?attr/font_default" /> </RelativeLayout> @@ -85,6 +87,7 @@ android:padding="4dp" android:text="@string/flair" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:visibility="gone" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorPrimaryDarkDayNightTheme" @@ -99,6 +102,7 @@ android:padding="4dp" android:text="@string/spoiler" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorPrimaryDarkDayNightTheme" app:lib_setRoundedView="true" @@ -112,6 +116,7 @@ android:padding="4dp" android:text="@string/nsfw" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorAccent" app:lib_setRoundedView="true" @@ -132,7 +137,7 @@ android:padding="16dp" android:hint="@string/post_title_hint" android:inputType="textCapSentences|textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" /> @@ -149,7 +154,7 @@ android:padding="16dp" android:hint="@string/post_link_hint" android:inputType="textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" /> diff --git a/app/src/main/res/layout/activity_post_text.xml b/app/src/main/res/layout/activity_post_text.xml index 11001a14..b10266f1 100644 --- a/app/src/main/res/layout/activity_post_text.xml +++ b/app/src/main/res/layout/activity_post_text.xml @@ -55,7 +55,8 @@ android:layout_centerVertical="true" android:layout_marginStart="32dp" android:layout_marginEnd="16dp" - android:text="@string/choose_a_subreddit" /> + android:text="@string/choose_a_subreddit" + android:textSize="?attr/font_default" /> <Button android:id="@+id/rules_button_post_text_activity" @@ -64,7 +65,8 @@ android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:text="@string/rules" - android:textColor="@android:color/white" /> + android:textColor="@android:color/white" + android:textSize="?attr/font_default" /> </RelativeLayout> @@ -85,6 +87,7 @@ android:padding="4dp" android:text="@string/flair" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:visibility="gone" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorPrimaryDarkDayNightTheme" @@ -99,6 +102,7 @@ android:padding="4dp" android:text="@string/spoiler" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorPrimaryDarkDayNightTheme" app:lib_setRoundedView="true" @@ -112,6 +116,7 @@ android:padding="4dp" android:text="@string/nsfw" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorAccent" app:lib_setRoundedView="true" @@ -132,7 +137,7 @@ android:padding="16dp" android:hint="@string/post_title_hint" android:inputType="textCapSentences|textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" /> @@ -149,7 +154,7 @@ android:padding="16dp" android:hint="@string/post_text_content_hint" android:inputType="textCapSentences|textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" /> diff --git a/app/src/main/res/layout/activity_post_video.xml b/app/src/main/res/layout/activity_post_video.xml index 2ba2d8eb..086c63b8 100644 --- a/app/src/main/res/layout/activity_post_video.xml +++ b/app/src/main/res/layout/activity_post_video.xml @@ -55,7 +55,8 @@ android:layout_centerVertical="true" android:layout_marginStart="32dp" android:layout_marginEnd="16dp" - android:text="@string/choose_a_subreddit" /> + android:text="@string/choose_a_subreddit" + android:textSize="?attr/font_default" /> <Button android:id="@+id/rules_button_post_video_activity" @@ -64,7 +65,8 @@ android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:text="@string/rules" - android:textColor="@android:color/white" /> + android:textColor="@android:color/white" + android:textSize="?attr/font_default" /> </RelativeLayout> @@ -85,6 +87,7 @@ android:padding="4dp" android:text="@string/flair" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:visibility="gone" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorPrimaryDarkDayNightTheme" @@ -99,6 +102,7 @@ android:padding="4dp" android:text="@string/spoiler" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorPrimaryDarkDayNightTheme" app:lib_setRoundedView="true" @@ -112,6 +116,7 @@ android:padding="4dp" android:text="@string/nsfw" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:lib_setRadius="3dp" app:lib_setRoundedBorderColor="@color/colorAccent" app:lib_setRoundedView="true" @@ -132,7 +137,7 @@ android:padding="16dp" android:hint="@string/post_title_hint" android:inputType="textCapSentences|textMultiLine" - android:textSize="18sp" + android:textSize="?attr/font_18" android:background="#00000000" android:textColor="@color/primaryTextColor" /> @@ -182,6 +187,7 @@ android:padding="16dp" android:text="@string/select_again" android:textColor="@color/colorAccent" + android:textSize="?attr/font_default" android:visibility="gone" /> <com.google.android.exoplayer2.ui.PlayerView diff --git a/app/src/main/res/layout/activity_rules.xml b/app/src/main/res/layout/activity_rules.xml index 9b8d2f87..9756a716 100644 --- a/app/src/main/res/layout/activity_rules.xml +++ b/app/src/main/res/layout/activity_rules.xml @@ -50,6 +50,7 @@ android:layout_height="match_parent" android:gravity="center" android:visibility="gone" + android:textSize="?attr/font_default" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 647ec1ec..15c3ba9e 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -69,7 +69,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/search_in" - android:textColor="@color/colorAccent" /> + android:textColor="@color/colorAccent" + android:textSize="?attr/font_default" /> <TextView android:id="@+id/subreddit_name_text_view_search_activity" @@ -80,7 +81,8 @@ android:layout_marginEnd="16dp" android:layout_toEndOf="@id/search_in_text_view_search_activity" android:text="@string/all_subreddits" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </RelativeLayout> diff --git a/app/src/main/res/layout/activity_view_image.xml b/app/src/main/res/layout/activity_view_image.xml index ddf04698..6a34d7a5 100644 --- a/app/src/main/res/layout/activity_view_image.xml +++ b/app/src/main/res/layout/activity_view_image.xml @@ -33,7 +33,8 @@ android:layout_gravity="center" android:gravity="center" android:textColor="@android:color/white" - android:text="@string/tap_to_retry" /> + android:text="@string/tap_to_retry" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/activity_view_message.xml b/app/src/main/res/layout/activity_view_message.xml index b05badf3..7a2ca1ff 100644 --- a/app/src/main/res/layout/activity_view_message.xml +++ b/app/src/main/res/layout/activity_view_message.xml @@ -72,7 +72,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:gravity="center" /> + android:gravity="center" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/activity_view_post_detail.xml b/app/src/main/res/layout/activity_view_post_detail.xml index 9c4a811c..a2e7d4c0 100644 --- a/app/src/main/res/layout/activity_view_post_detail.xml +++ b/app/src/main/res/layout/activity_view_post_detail.xml @@ -64,7 +64,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:gravity="center" /> + android:gravity="center" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/activity_view_subreddit_detail.xml b/app/src/main/res/layout/activity_view_subreddit_detail.xml index 443881da..5a912c66 100644 --- a/app/src/main/res/layout/activity_view_subreddit_detail.xml +++ b/app/src/main/res/layout/activity_view_subreddit_detail.xml @@ -58,7 +58,7 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:layout_marginBottom="16dp" - android:textSize="18sp" + android:textSize="?attr/font_18" android:textColor="@color/colorAccent" android:layout_gravity="center_horizontal"/> @@ -80,6 +80,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:layout_alignParentStart="true" android:layout_toStartOf="@id/online_subscriber_count_text_view_view_subreddit_detail_activity" /> @@ -88,7 +89,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </RelativeLayout> @@ -98,6 +100,7 @@ android:layout_height="wrap_content" android:layout_marginBottom="16dp" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:visibility="gone"/> </LinearLayout> diff --git a/app/src/main/res/layout/activity_view_user_detail.xml b/app/src/main/res/layout/activity_view_user_detail.xml index 7917e45a..4567989f 100644 --- a/app/src/main/res/layout/activity_view_user_detail.xml +++ b/app/src/main/res/layout/activity_view_user_detail.xml @@ -63,7 +63,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:textSize="18sp" + android:textSize="?attr/font_18" android:textColor="@color/colorPrimaryDarkDayNightTheme" android:layout_gravity="center_horizontal"/> @@ -74,6 +74,7 @@ android:layout_marginTop="16dp" android:layout_marginBottom="16dp" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:layout_gravity="center_horizontal"/> <com.google.android.material.chip.Chip diff --git a/app/src/main/res/layout/dialog_edit_flair.xml b/app/src/main/res/layout/dialog_edit_flair.xml index 7893cf66..5872be15 100644 --- a/app/src/main/res/layout/dialog_edit_flair.xml +++ b/app/src/main/res/layout/dialog_edit_flair.xml @@ -19,6 +19,7 @@ android:layout_marginStart="24dp" android:layout_marginEnd="24dp" android:text="@string/only_allow_64_chars" - android:textColor="@color/colorAccent"/> + android:textColor="@color/colorAccent" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_comments_listing.xml b/app/src/main/res/layout/fragment_comments_listing.xml index 0e29f42a..40e02a6f 100644 --- a/app/src/main/res/layout/fragment_comments_listing.xml +++ b/app/src/main/res/layout/fragment_comments_listing.xml @@ -44,7 +44,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:gravity="center" /> + android:gravity="center" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_flair_bottom_sheet.xml b/app/src/main/res/layout/fragment_flair_bottom_sheet.xml index 8f9511d6..edd8ad20 100644 --- a/app/src/main/res/layout/fragment_flair_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_flair_bottom_sheet.xml @@ -11,7 +11,7 @@ android:layout_height="wrap_content" android:padding="16dp" android:text="@string/flair" - android:textSize="18sp" /> + android:textSize="?attr/font_18" /> <ProgressBar android:id="@+id/progress_bar_flair_bottom_sheet_fragment" @@ -27,7 +27,8 @@ android:layout_gravity="center" android:gravity="center" android:padding="48dp" - android:visibility="gone" /> + android:visibility="gone" + android:textSize="?attr/font_default" /> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recycler_view_bottom_sheet_fragment" diff --git a/app/src/main/res/layout/fragment_followed_users_listing.xml b/app/src/main/res/layout/fragment_followed_users_listing.xml index 62ab964e..adddb913 100644 --- a/app/src/main/res/layout/fragment_followed_users_listing.xml +++ b/app/src/main/res/layout/fragment_followed_users_listing.xml @@ -30,7 +30,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:gravity="center" - android:text="@string/no_users" /> + android:text="@string/no_users" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_modify_comment_bottom_sheet.xml b/app/src/main/res/layout/fragment_modify_comment_bottom_sheet.xml index c637e910..3f223176 100644 --- a/app/src/main/res/layout/fragment_modify_comment_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_modify_comment_bottom_sheet.xml @@ -8,20 +8,6 @@ tools:context=".ModifyCommentBottomSheetFragment"> <TextView - android:id="@+id/save_text_view_modify_comment_bottom_sheet_fragment" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingTop="16dp" - android:paddingBottom="16dp" - android:paddingStart="32dp" - android:paddingEnd="32dp" - android:text="@string/edit" - android:textColor="@color/primaryTextColor" - android:clickable="true" - android:focusable="true" - android:background="?attr/selectableItemBackground" /> - - <TextView android:id="@+id/edit_text_view_modify_comment_bottom_sheet_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -31,6 +17,7 @@ android:paddingEnd="32dp" android:text="@string/edit" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:clickable="true" android:focusable="true" android:background="?attr/selectableItemBackground" /> @@ -45,6 +32,7 @@ android:paddingEnd="32dp" android:text="@string/delete" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:clickable="true" android:focusable="true" android:background="?attr/selectableItemBackground" /> diff --git a/app/src/main/res/layout/fragment_post.xml b/app/src/main/res/layout/fragment_post.xml index 34d34e02..3d42709a 100644 --- a/app/src/main/res/layout/fragment_post.xml +++ b/app/src/main/res/layout/fragment_post.xml @@ -42,7 +42,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:gravity="center" /> + android:gravity="center" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml index 9cdce5a0..aa15e791 100644 --- a/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml @@ -30,7 +30,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/bottom_sheet_post_text" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -59,7 +60,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/bottom_sheet_post_link" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -88,7 +90,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/bottom_sheet_post_image" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -117,7 +120,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/bottom_sheet_post_video" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_search_post_sort_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_search_post_sort_type_bottom_sheet.xml index 1db23d62..8b615fc8 100644 --- a/app/src/main/res/layout/fragment_search_post_sort_type_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_search_post_sort_type_bottom_sheet.xml @@ -10,6 +10,7 @@ android:layout_height="wrap_content" android:text="@string/sort_relevance" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -24,6 +25,7 @@ android:layout_height="wrap_content" android:text="@string/sort_hot" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -38,6 +40,7 @@ android:layout_height="wrap_content" android:text="@string/sort_top" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -52,6 +55,7 @@ android:layout_height="wrap_content" android:text="@string/sort_new" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -66,6 +70,7 @@ android:layout_height="wrap_content" android:text="@string/sort_comments" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" diff --git a/app/src/main/res/layout/fragment_search_user_and_subreddit_sort_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_search_user_and_subreddit_sort_type_bottom_sheet.xml index acc7e65a..79579bfa 100644 --- a/app/src/main/res/layout/fragment_search_user_and_subreddit_sort_type_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_search_user_and_subreddit_sort_type_bottom_sheet.xml @@ -11,6 +11,7 @@ android:layout_height="wrap_content" android:text="@string/sort_relevance" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -25,6 +26,7 @@ android:layout_height="wrap_content" android:text="@string/sort_activity" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" diff --git a/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml index e059a36b..a92cfc2c 100644 --- a/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml @@ -10,6 +10,7 @@ android:layout_height="wrap_content" android:text="@string/sort_best" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -24,6 +25,7 @@ android:layout_height="wrap_content" android:text="@string/sort_hot" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -38,6 +40,7 @@ android:layout_height="wrap_content" android:text="@string/sort_new" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -52,6 +55,7 @@ android:layout_height="wrap_content" android:text="@string/sort_random" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -66,6 +70,7 @@ android:layout_height="wrap_content" android:text="@string/sort_rising" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -80,6 +85,7 @@ android:layout_height="wrap_content" android:text="@string/sort_top" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -94,6 +100,7 @@ android:layout_height="wrap_content" android:text="@string/sort_controversial" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" diff --git a/app/src/main/res/layout/fragment_subreddit_listing.xml b/app/src/main/res/layout/fragment_subreddit_listing.xml index 26c1c8fa..780612bb 100644 --- a/app/src/main/res/layout/fragment_subreddit_listing.xml +++ b/app/src/main/res/layout/fragment_subreddit_listing.xml @@ -43,7 +43,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:gravity="center" /> + android:gravity="center" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_subscribed_subreddits_listing.xml b/app/src/main/res/layout/fragment_subscribed_subreddits_listing.xml index 89227f12..3ff79487 100644 --- a/app/src/main/res/layout/fragment_subscribed_subreddits_listing.xml +++ b/app/src/main/res/layout/fragment_subscribed_subreddits_listing.xml @@ -30,7 +30,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:gravity="center" - android:text="@string/no_subreddits" /> + android:text="@string/no_subreddits" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_user_listing.xml b/app/src/main/res/layout/fragment_user_listing.xml index c44298ad..0356ef99 100644 --- a/app/src/main/res/layout/fragment_user_listing.xml +++ b/app/src/main/res/layout/fragment_user_listing.xml @@ -43,7 +43,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:gravity="center" /> + android:gravity="center" + android:textSize="?attr/font_default" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_user_thing_sort_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_user_thing_sort_type_bottom_sheet.xml index aa928f7c..e9746197 100644 --- a/app/src/main/res/layout/fragment_user_thing_sort_type_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_user_thing_sort_type_bottom_sheet.xml @@ -10,6 +10,7 @@ android:layout_height="wrap_content" android:text="@string/sort_new" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -24,6 +25,7 @@ android:layout_height="wrap_content" android:text="@string/sort_hot" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -38,6 +40,7 @@ android:layout_height="wrap_content" android:text="@string/sort_top" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" @@ -52,6 +55,7 @@ android:layout_height="wrap_content" android:text="@string/sort_controversial" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingStart="32dp" diff --git a/app/src/main/res/layout/item_account.xml b/app/src/main/res/layout/item_account.xml index d347dd67..35405b82 100644 --- a/app/src/main/res/layout/item_account.xml +++ b/app/src/main/res/layout/item_account.xml @@ -20,6 +20,7 @@ android:layout_marginStart="16dp" android:layout_marginEnd="16dp" android:layout_gravity="center_vertical" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_acknowledgement.xml b/app/src/main/res/layout/item_acknowledgement.xml index 6ad6deb8..5e75d492 100644 --- a/app/src/main/res/layout/item_acknowledgement.xml +++ b/app/src/main/res/layout/item_acknowledgement.xml @@ -15,12 +15,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/primaryTextColor" - android:textSize="16sp" /> + android:textSize="?attr/font_16" /> <TextView android:id="@+id/introduction_text_view_item_acknowledgement" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="8dp" /> + android:layout_marginTop="8dp" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_comment.xml b/app/src/main/res/layout/item_comment.xml index 0c103825..c286738a 100644 --- a/app/src/main/res/layout/item_comment.xml +++ b/app/src/main/res/layout/item_comment.xml @@ -32,6 +32,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="16dp" android:textColor="@color/colorPrimaryDarkDayNightTheme" + android:textSize="?attr/font_default" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -42,6 +43,7 @@ android:id="@+id/comment_time_text_view_item_post_comment" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:textSize="?attr/font_default" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> @@ -56,7 +58,8 @@ android:layout_marginStart="32dp" android:layout_marginEnd="32dp" android:layout_marginBottom="8dp" - android:textColor="@color/primaryTextColor"/> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" @@ -82,6 +85,7 @@ android:layout_height="wrap_content" android:layout_marginStart="8dp" android:gravity="center" + android:textSize="?attr/font_default" app:layout_constraintStart_toEndOf="@+id/up_vote_button_item_post_comment" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> diff --git a/app/src/main/res/layout/item_comment_footer_error.xml b/app/src/main/res/layout/item_comment_footer_error.xml index 39195989..ab0bc98f 100644 --- a/app/src/main/res/layout/item_comment_footer_error.xml +++ b/app/src/main/res/layout/item_comment_footer_error.xml @@ -12,7 +12,7 @@ android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_toStartOf="@id/retry_button_item_comment_footer_error" - android:textSize="18sp" /> + android:textSize="?attr/font_18" /> <Button android:id="@+id/retry_button_item_comment_footer_error" @@ -20,6 +20,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" - android:text="@string/retry" /> + android:text="@string/retry" + android:textSize="?attr/font_default" /> </RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_flair.xml b/app/src/main/res/layout/item_flair.xml index 7cce337f..596da813 100644 --- a/app/src/main/res/layout/item_flair.xml +++ b/app/src/main/res/layout/item_flair.xml @@ -11,7 +11,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="16dp" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> <ImageView android:id="@+id/edit_flair_image_view_item_flair" diff --git a/app/src/main/res/layout/item_footer_error.xml b/app/src/main/res/layout/item_footer_error.xml index f795adf9..faf0a9f6 100644 --- a/app/src/main/res/layout/item_footer_error.xml +++ b/app/src/main/res/layout/item_footer_error.xml @@ -14,7 +14,7 @@ android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_toStartOf="@id/retry_button_item_footer_error" - android:textSize="18sp" /> + android:textSize="?attr/font_18" /> <Button android:id="@+id/retry_button_item_footer_error" @@ -22,6 +22,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" - android:text="@string/retry" /> + android:text="@string/retry" + android:textSize="?attr/font_default" /> </RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_load_comments_failed_placeholder.xml b/app/src/main/res/layout/item_load_comments_failed_placeholder.xml index 48fc99f5..02f3b24f 100644 --- a/app/src/main/res/layout/item_load_comments_failed_placeholder.xml +++ b/app/src/main/res/layout/item_load_comments_failed_placeholder.xml @@ -16,6 +16,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:gravity="center" - android:text="@string/load_comments_failed" /> + android:text="@string/load_comments_failed" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_load_more_comments_placeholder.xml b/app/src/main/res/layout/item_load_more_comments_placeholder.xml index 0d967b27..981ac789 100644 --- a/app/src/main/res/layout/item_load_more_comments_placeholder.xml +++ b/app/src/main/res/layout/item_load_more_comments_placeholder.xml @@ -17,6 +17,7 @@ android:gravity="center" android:padding="8dp" android:text="@string/comment_load_more_comments" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_message.xml b/app/src/main/res/layout/item_message.xml index 9fe9e0d4..35b8ada4 100644 --- a/app/src/main/res/layout/item_message.xml +++ b/app/src/main/res/layout/item_message.xml @@ -9,14 +9,15 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> <TextView android:id="@+id/subject_text_view_item_message" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" - android:textSize="16sp" + android:textSize="?attr/font_16" android:textColor="@color/primaryTextColor" /> <TextView @@ -24,11 +25,13 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" - android:textColor="@color/primaryTextColor" /> + android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" /> <TextView android:id="@+id/content_custom_markwon_view_item_message" android:layout_width="match_parent" - android:layout_height="wrap_content" /> + android:layout_height="wrap_content" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_no_comment_placeholder.xml b/app/src/main/res/layout/item_no_comment_placeholder.xml index 402f797c..530f17c8 100644 --- a/app/src/main/res/layout/item_no_comment_placeholder.xml +++ b/app/src/main/res/layout/item_no_comment_placeholder.xml @@ -15,6 +15,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:text="@string/no_comments_yet" /> + android:text="@string/no_comments_yet" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml index c4f8e944..cb45fbd0 100644 --- a/app/src/main/res/layout/item_post.xml +++ b/app/src/main/res/layout/item_post.xml @@ -42,7 +42,8 @@ android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_gravity="center" - android:textColor="#E91E63"/> + android:textColor="#E91E63" + android:textSize="?attr/font_default" /> </LinearLayout> @@ -64,6 +65,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="16dp" + android:textSize="?attr/font_default" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@id/stickied_post_image_view_item_post" app:layout_constraintEnd_toEndOf="parent" @@ -78,7 +80,7 @@ android:layout_height="wrap_content" android:paddingStart="16dp" android:paddingEnd="16dp" - android:textSize="18sp" + android:textSize="?attr/font_18" android:textColor="@color/primaryTextColor"/> <androidx.constraintlayout.widget.ConstraintLayout @@ -113,7 +115,7 @@ android:layout_height="wrap_content" android:layout_marginStart="4dp" android:textColor="@color/gold" - android:textSize="20sp" + android:textSize="?attr/font_20" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@+id/gilded_image_view_item_post" @@ -185,7 +187,7 @@ android:layout_gravity="center" android:layout_marginStart="16dp" android:text="@string/spoiler" - android:textSize="12sp" + android:textSize="?attr/font_12" android:textColor="@android:color/white" android:padding="4dp" android:visibility="gone" @@ -200,7 +202,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginStart="16dp" - android:textSize="12sp" + android:textSize="?attr/font_12" android:textColor="@android:color/white" android:padding="4dp" android:visibility="gone" @@ -218,7 +220,7 @@ android:layout_marginBottom="16dp" android:paddingStart="16dp" android:paddingEnd="16dp" - android:textSize="12sp" + android:textSize="?attr/font_12" android:visibility="gone"/> <RelativeLayout @@ -253,7 +255,8 @@ android:drawableTop="@drawable/ic_error_outline_black_24dp" android:layout_gravity="center" android:gravity="center" - android:text="@string/tap_to_retry" /> + android:text="@string/tap_to_retry" + android:textSize="?attr/font_default" /> </RelativeLayout> @@ -293,7 +296,8 @@ android:layout_toEndOf="@id/plus_button_item_post" android:layout_alignBottom="@id/plus_button_item_post" android:layout_alignParentTop="true" - android:gravity="center"/> + android:gravity="center" + android:textSize="?attr/font_default" /> <ImageView android:id="@+id/minus_button_item_post" diff --git a/app/src/main/res/layout/item_post_detail.xml b/app/src/main/res/layout/item_post_detail.xml index 918165e1..c0979ca8 100644 --- a/app/src/main/res/layout/item_post_detail.xml +++ b/app/src/main/res/layout/item_post_detail.xml @@ -35,7 +35,8 @@ android:layout_marginStart="16dp" android:layout_alignParentTop="true" android:layout_toEndOf="@id/icon_gif_image_view_item_post_detail" - android:textColor="@color/colorAccent" /> + android:textColor="@color/colorAccent" + android:textSize="?attr/font_default" /> <TextView android:id="@+id/user_text_view_item_post_detail" @@ -45,7 +46,8 @@ android:layout_alignParentBottom="true" android:layout_below="@id/subreddit_text_view_item_post_detail" android:layout_toEndOf="@id/icon_gif_image_view_item_post_detail" - android:textColor="@color/colorPrimaryDarkDayNightTheme" /> + android:textColor="@color/colorPrimaryDarkDayNightTheme" + android:textSize="?attr/font_default" /> </RelativeLayout> @@ -55,6 +57,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginEnd="16dp" + android:textSize="?attr/font_default" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@id/subreddit_icon_name_relative_layout_item_post_detail" app:layout_constraintEnd_toEndOf="parent" @@ -69,7 +72,7 @@ android:paddingStart="16dp" android:paddingEnd="16dp" android:textColor="@color/primaryTextColor" - android:textSize="18sp" /> + android:textSize="?attr/font_18" /> <TextView android:id="@+id/content_markdown_view_item_post_detail" @@ -78,7 +81,8 @@ android:paddingStart="16dp" android:paddingEnd="16dp" android:layout_marginTop="16dp" - android:visibility="gone" /> + android:visibility="gone" + android:textSize="?attr/font_default" /> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" @@ -112,7 +116,7 @@ android:layout_height="wrap_content" android:layout_marginStart="4dp" android:textColor="@color/gold" - android:textSize="20sp" + android:textSize="?attr/font_20" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@+id/gilded_image_view_item_post_detail" @@ -184,7 +188,7 @@ android:layout_gravity="center" android:layout_marginStart="16dp" android:text="@string/spoiler" - android:textSize="12sp" + android:textSize="?attr/font_12" android:textColor="@android:color/white" android:padding="4dp" android:visibility="gone" @@ -199,7 +203,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginStart="16dp" - android:textSize="12sp" + android:textSize="?attr/font_12" android:textColor="@android:color/white" android:padding="4dp" android:visibility="gone" @@ -217,7 +221,7 @@ android:layout_marginBottom="16dp" android:paddingStart="16dp" android:paddingEnd="16dp" - android:textSize="12sp" + android:textSize="?attr/font_12" android:visibility="gone"/> <RelativeLayout @@ -253,6 +257,7 @@ android:layout_centerInParent="true" android:gravity="center" android:text="@string/tap_to_retry" + android:textSize="?attr/font_default" android:visibility="gone" /> </RelativeLayout> @@ -292,7 +297,8 @@ android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toEndOf="@id/plus_button_item_post_detail" - android:gravity="center" /> + android:gravity="center" + android:textSize="?attr/font_default" /> <ImageView android:id="@+id/minus_button_item_post_detail" diff --git a/app/src/main/res/layout/item_rule.xml b/app/src/main/res/layout/item_rule.xml index 2c4a845b..652d53b0 100644 --- a/app/src/main/res/layout/item_rule.xml +++ b/app/src/main/res/layout/item_rule.xml @@ -9,7 +9,7 @@ android:layout_height="wrap_content" android:padding="16dp" android:textColor="@color/primaryTextColor" - android:textSize="16sp" /> + android:textSize="?attr/font_16" /> <TextView android:id="@+id/description_markwon_view_item_rule" @@ -17,6 +17,7 @@ android:layout_height="wrap_content" android:paddingBottom="16dp" android:paddingStart="16dp" - android:paddingEnd="16dp" /> + android:paddingEnd="16dp" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_subreddit_listing.xml b/app/src/main/res/layout/item_subreddit_listing.xml index 369f34fb..f710ca43 100644 --- a/app/src/main/res/layout/item_subreddit_listing.xml +++ b/app/src/main/res/layout/item_subreddit_listing.xml @@ -25,6 +25,7 @@ android:layout_gravity="center_vertical" android:layout_marginStart="32dp" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@+id/subreddit_icon_gif_image_view_item_subreddit_listing" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/item_subscribed_thing.xml b/app/src/main/res/layout/item_subscribed_thing.xml index d7ede059..92e381aa 100644 --- a/app/src/main/res/layout/item_subscribed_thing.xml +++ b/app/src/main/res/layout/item_subscribed_thing.xml @@ -13,13 +13,14 @@ android:layout_width="24dp" android:layout_height="24dp" android:layout_gravity="center_vertical" - android:layout_marginEnd="32dp"/> + android:layout_marginEnd="32dp" /> <TextView android:id="@+id/subreddit_name_text_view_item_subscribed_subreddit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/primaryTextColor" - android:layout_gravity="center_vertical"/> + android:textSize="?attr/font_default" + android:layout_gravity="center_vertical" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_user_listing.xml b/app/src/main/res/layout/item_user_listing.xml index bdf5436f..6ecb1ab7 100644 --- a/app/src/main/res/layout/item_user_listing.xml +++ b/app/src/main/res/layout/item_user_listing.xml @@ -25,6 +25,7 @@ android:layout_gravity="center_vertical" android:layout_marginStart="32dp" android:textColor="@color/primaryTextColor" + android:textSize="?attr/font_default" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@+id/user_icon_gif_image_view_item_user_listing" app:layout_constraintTop_toTopOf="parent" /> @@ -42,6 +43,6 @@ android:clickable="true" android:focusable="true" android:background="?attr/selectableItemBackground" - android:visibility="gone"/> + android:visibility="gone" /> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_view_all_comments.xml b/app/src/main/res/layout/item_view_all_comments.xml index 8ded08c1..7a3b28fe 100644 --- a/app/src/main/res/layout/item_view_all_comments.xml +++ b/app/src/main/res/layout/item_view_all_comments.xml @@ -12,6 +12,7 @@ android:layout_height="wrap_content" android:text="@string/view_all_comments" android:gravity="center" - android:textColor="@color/colorAccent" /> + android:textColor="@color/colorAccent" + android:textSize="?attr/font_default" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml index 9938d47c..a620fbb9 100644 --- a/app/src/main/res/layout/nav_header_main.xml +++ b/app/src/main/res/layout/nav_header_main.xml @@ -32,6 +32,7 @@ android:layout_marginEnd="16dp" android:layout_alignParentStart="true" android:textAppearance="@style/TextAppearance.AppCompat.Body1" + android:textSize="?attr/font_default" android:layout_below="@id/profile_image_view_nav_header_main" android:layout_toStartOf="@id/account_switcher_image_view_nav_header_main" /> @@ -43,7 +44,8 @@ android:layout_marginEnd="16dp" android:layout_alignParentStart="true" android:layout_below="@id/name_text_view_nav_header_main" - android:layout_toStartOf="@id/account_switcher_image_view_nav_header_main" /> + android:layout_toStartOf="@id/account_switcher_image_view_nav_header_main" + android:textSize="?attr/font_default" /> <ImageView android:id="@+id/account_switcher_image_view_nav_header_main" diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 196fc489..43b955c8 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -56,4 +56,18 @@ <item>7</item> <item>10</item> </string-array> + + <string-array name="settings_font_size"> + <item>Small</item> + <item>Normal</item> + <item>Large</item> + <item>Extra Large</item> + </string-array> + + <string-array name="settings_font_size_values"> + <item>Small</item> + <item>Normal</item> + <item>Large</item> + <item>XLarge</item> + </string-array> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/attr.xml b/app/src/main/res/values/attr.xml index f855de6a..64aa4b9e 100644 --- a/app/src/main/res/values/attr.xml +++ b/app/src/main/res/values/attr.xml @@ -1,4 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <bool name="isTablet">false</bool> + + <declare-styleable name="FontStyle"> + <attr name="font_default" format="dimension"/> + <attr name="font_12" format="dimension"/> + <attr name="font_16" format="dimension"/> + <attr name="font_18" format="dimension"/> + <attr name="font_20" format="dimension"/> + </declare-styleable> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 094846ee..84595591 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -273,6 +273,7 @@ <string name="settings_theme_dark_theme_summary">Dark Theme</string> <string name="settings_theme_system_default_summary">Device default</string> <string name="settings_lazy_mode_interval_title">Lazy Mode Interval</string> + <string name="settings_font_size_title">Font Size</string> <string name="settings_enable_nsfw_title">Enable NSFW</string> <string name="settings_blur_nsfw_title">Blur NSFW images</string> <string name="settings_layout_no_limits_title">Display Under Navigation bar and Status Bar</string> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 0b7ea5c2..6a59fbc6 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -45,6 +45,9 @@ </style> <style name="MaterialAlertDialogTheme" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog"> + <item name="android:textSize">?attr/font_default</item> + <item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialogTitleTextStyle</item> + <item name="materialAlertDialogBodyTextStyle">@style/MaterialAlertDialogBodyTextStyle</item> <item name="buttonBarPositiveButtonStyle">@style/MaterialAlertDialogPositiveButtonStyle</item> <item name="buttonBarNegativeButtonStyle">@style/MaterialAlertDialogNegativeButtonStyle</item> </style> @@ -57,10 +60,63 @@ <item name="android:textColor">@color/primaryTextColor</item> </style> + <style name="MaterialAlertDialogTitleTextStyle" parent="MaterialAlertDialog.MaterialComponents.Title.Text"> + <item name="android:textSize">?attr/font_20</item> + </style> + + <style name="MaterialAlertDialogBodyTextStyle"> + <item name="android:textSize">?attr/font_default</item> + </style> + <style name="PreferenceActivityTheme" parent="AppTheme.NoActionBar"> + <item name="android:textAppearanceListItem">@style/PreferenceTitleTextStyle</item> + <item name="android:textAppearanceListItemSecondary">@style/PreferenceSubtitleTextStyle</item> <item name="android:textColorPrimary">@color/primaryTextColor</item> <item name="buttonBarPositiveButtonStyle">@style/MaterialAlertDialogPositiveButtonStyle</item> <item name="buttonBarNegativeButtonStyle">@style/MaterialAlertDialogNegativeButtonStyle</item> </style> + <style name="PreferenceTitleTextStyle"> + <item name="android:textSize">?attr/font_16</item> + </style> + + <style name="PreferenceSubtitleTextStyle"> + <item name="android:textSize">?attr/font_default</item> + </style> + + <style name="FontStyle"> + </style> + + <style name="FontStyle.Small"> + <item name="font_default">12sp</item> + <item name="font_12">12sp</item> + <item name="font_16">14sp</item> + <item name="font_18">16sp</item> + <item name="font_20">18sp</item> + </style> + + <style name="FontStyle.Normal"> + <item name="font_default">14sp</item> + <item name="font_12">12sp</item> + <item name="font_16">16sp</item> + <item name="font_18">18sp</item> + <item name="font_20">20sp</item> + </style> + + <style name="FontStyle.Large"> + <item name="font_default">16sp</item> + <item name="font_12">14sp</item> + <item name="font_16">18sp</item> + <item name="font_18">20sp</item> + <item name="font_20">22sp</item> + </style> + + <style name="FontStyle.XLarge"> + <item name="font_default">18sp</item> + <item name="font_12">16sp</item> + <item name="font_16">20sp</item> + <item name="font_18">22sp</item> + <item name="font_20">24sp</item> + </style> + </resources> diff --git a/app/src/main/res/xml/main_preferences.xml b/app/src/main/res/xml/main_preferences.xml index 80df0c11..e1f8a0a0 100644 --- a/app/src/main/res/xml/main_preferences.xml +++ b/app/src/main/res/xml/main_preferences.xml @@ -24,6 +24,14 @@ app:title="@string/settings_lazy_mode_interval_title" app:useSimpleSummaryProvider="true" /> + <ListPreference + app:defaultValue="Normal" + android:entries="@array/settings_font_size" + app:entryValues="@array/settings_font_size_values" + app:key="font_size" + app:title="@string/settings_font_size_title" + app:useSimpleSummaryProvider="true" /> + <SwitchPreference app:defaultValue="false" app:key="nsfw" |