Changing font is available. Fix subtitle on toolbar being cut if the font is large.

This commit is contained in:
Alex Ning 2020-06-10 15:43:34 +08:00
parent 4cd07e3bb6
commit 54a9f241d4
54 changed files with 293 additions and 120 deletions

View File

@ -27,8 +27,6 @@ import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import javax.inject.Inject;
@ -41,7 +39,6 @@ import ml.docilealligator.infinityforreddit.Adapter.MultiRedditListingRecyclerVi
import ml.docilealligator.infinityforreddit.AsyncTask.GetCurrentAccountAsyncTask;
import ml.docilealligator.infinityforreddit.AsyncTask.InsertMultiRedditAsyncTask;
import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.Event.RefreshMultiRedditsEvent;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.MultiReddit.DeleteMultiReddit;
import ml.docilealligator.infinityforreddit.MultiReddit.FetchMyMultiReddits;
@ -292,8 +289,8 @@ public class MultiRedditListingActivity extends BaseActivity {
.show();
}
@Subscribe
/*@Subscribe
public void onRefreshMultiRedditsEvent(RefreshMultiRedditsEvent event) {
loadMultiReddits();
}
}*/
}

View File

@ -18,6 +18,7 @@ import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.tabs.TabLayout;
import org.greenrobot.eventbus.EventBus;
@ -36,6 +37,7 @@ import ml.docilealligator.infinityforreddit.AsyncTask.InsertMultiRedditAsyncTask
import ml.docilealligator.infinityforreddit.AsyncTask.InsertSubscribedThingsAsyncTask;
import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.Event.GoBackToMainPageEvent;
import ml.docilealligator.infinityforreddit.Event.RefreshMultiRedditsEvent;
import ml.docilealligator.infinityforreddit.Event.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.FetchSubscribedThing;
import ml.docilealligator.infinityforreddit.Fragment.FollowedUsersListingFragment;
@ -43,6 +45,7 @@ import ml.docilealligator.infinityforreddit.Fragment.MultiRedditListingFragment;
import ml.docilealligator.infinityforreddit.Fragment.SubscribedSubredditsListingFragment;
import ml.docilealligator.infinityforreddit.FragmentCommunicator;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.MultiReddit.DeleteMultiReddit;
import ml.docilealligator.infinityforreddit.MultiReddit.FetchMyMultiReddits;
import ml.docilealligator.infinityforreddit.MultiReddit.MultiReddit;
import ml.docilealligator.infinityforreddit.R;
@ -261,6 +264,30 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
});
}
public void deleteMultiReddit(MultiReddit multiReddit) {
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.delete)
.setMessage(R.string.delete_multi_reddit_dialog_message)
.setPositiveButton(R.string.delete, (dialogInterface, i)
-> DeleteMultiReddit.deleteMultiReddit(mOauthRetrofit, mRedditDataRoomDatabase,
mAccessToken, mAccountName, multiReddit.getPath(), new DeleteMultiReddit.DeleteMultiRedditListener() {
@Override
public void success() {
Toast.makeText(SubscribedThingListingActivity.this,
R.string.delete_multi_reddit_success, Toast.LENGTH_SHORT).show();
loadMultiReddits();
}
@Override
public void failed() {
Toast.makeText(SubscribedThingListingActivity.this,
R.string.delete_multi_reddit_failed, Toast.LENGTH_SHORT).show();
}
}))
.setNegativeButton(R.string.cancel, null)
.show();
}
@Subscribe
public void onAccountSwitchEvent(SwitchAccountEvent event) {
finish();
@ -271,6 +298,11 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
finish();
}
@Subscribe
public void onRefreshMultiRedditsEvent(RefreshMultiRedditsEvent event) {
loadMultiReddits();
}
@Override
public void onLongPress() {
if (sectionsPagerAdapter != null) {

View File

@ -47,11 +47,14 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AsyncTask.SaveGIFToFileAsyncTask;
import ml.docilealligator.infinityforreddit.BuildConfig;
import ml.docilealligator.infinityforreddit.Font.ContentFontFamily;
import ml.docilealligator.infinityforreddit.Font.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Font.FontFamily;
import ml.docilealligator.infinityforreddit.Font.FontStyle;
import ml.docilealligator.infinityforreddit.Font.TitleFontFamily;
import ml.docilealligator.infinityforreddit.Font.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.Font.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
import pl.droidsonroids.gif.GifImageView;
@ -96,6 +99,15 @@ public class ViewGIFActivity extends AppCompatActivity {
getTheme().applyStyle(ContentFontStyle.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY, ContentFontStyle.Normal.name())).getResId(), true);
getTheme().applyStyle(FontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.FONT_FAMILY_KEY, FontFamily.Default.name())).getResId(), true);
getTheme().applyStyle(TitleFontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.TITLE_FONT_FAMILY_KEY, TitleFontFamily.Default.name())).getResId(), true);
getTheme().applyStyle(ContentFontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.CONTENT_FONT_FAMILY_KEY, ContentFontFamily.Default.name())).getResId(), true);
setContentView(R.layout.activity_view_gif);
ButterKnife.bind(this);

View File

@ -49,11 +49,14 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.AsyncTask.SaveImageToFileAsyncTask;
import ml.docilealligator.infinityforreddit.BuildConfig;
import ml.docilealligator.infinityforreddit.Font.ContentFontFamily;
import ml.docilealligator.infinityforreddit.Font.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Font.FontFamily;
import ml.docilealligator.infinityforreddit.Font.FontStyle;
import ml.docilealligator.infinityforreddit.Font.TitleFontFamily;
import ml.docilealligator.infinityforreddit.Font.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.Font.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
public class ViewImageActivity extends AppCompatActivity {
@ -97,6 +100,15 @@ public class ViewImageActivity extends AppCompatActivity {
getTheme().applyStyle(ContentFontStyle.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY, ContentFontStyle.Normal.name())).getResId(), true);
getTheme().applyStyle(FontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.FONT_FAMILY_KEY, FontFamily.Default.name())).getResId(), true);
getTheme().applyStyle(TitleFontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.TITLE_FONT_FAMILY_KEY, TitleFontFamily.Default.name())).getResId(), true);
getTheme().applyStyle(ContentFontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.CONTENT_FONT_FAMILY_KEY, ContentFontFamily.Default.name())).getResId(), true);
setContentView(R.layout.activity_view_image);
ButterKnife.bind(this);

View File

@ -33,14 +33,17 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.API.ImgurAPI;
import ml.docilealligator.infinityforreddit.Font.ContentFontFamily;
import ml.docilealligator.infinityforreddit.Font.ContentFontStyle;
import ml.docilealligator.infinityforreddit.Font.FontFamily;
import ml.docilealligator.infinityforreddit.Font.FontStyle;
import ml.docilealligator.infinityforreddit.Font.TitleFontFamily;
import ml.docilealligator.infinityforreddit.Font.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Fragment.ViewImgurImageFragment;
import ml.docilealligator.infinityforreddit.Fragment.ViewImgurVideoFragment;
import ml.docilealligator.infinityforreddit.ImgurMedia;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.Font.TitleFontStyle;
import ml.docilealligator.infinityforreddit.Utils.APIUtils;
import ml.docilealligator.infinityforreddit.Utils.JSONUtils;
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
@ -92,6 +95,15 @@ public class ViewImgurMediaActivity extends AppCompatActivity {
getTheme().applyStyle(ContentFontStyle.valueOf(sharedPreferences
.getString(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY, ContentFontStyle.Normal.name())).getResId(), true);
getTheme().applyStyle(FontFamily.valueOf(sharedPreferences
.getString(SharedPreferencesUtils.FONT_FAMILY_KEY, FontFamily.Default.name())).getResId(), true);
getTheme().applyStyle(TitleFontFamily.valueOf(sharedPreferences
.getString(SharedPreferencesUtils.TITLE_FONT_FAMILY_KEY, TitleFontFamily.Default.name())).getResId(), true);
getTheme().applyStyle(ContentFontFamily.valueOf(sharedPreferences
.getString(SharedPreferencesUtils.CONTENT_FONT_FAMILY_KEY, ContentFontFamily.Default.name())).getResId(), true);
setContentView(R.layout.activity_view_imgur_media);
ButterKnife.bind(this);

View File

@ -57,6 +57,9 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.FetchGfycatVideoLinks;
import ml.docilealligator.infinityforreddit.Font.ContentFontFamily;
import ml.docilealligator.infinityforreddit.Font.FontFamily;
import ml.docilealligator.infinityforreddit.Font.TitleFontFamily;
import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.Service.DownloadRedditVideoService;
@ -119,12 +122,22 @@ public class ViewVideoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getTheme().applyStyle(R.style.Theme_Normal, true);
setContentView(R.layout.activity_view_video);
((Infinity) getApplication()).getAppComponent().inject(this);
getTheme().applyStyle(R.style.Theme_Normal, true);
getTheme().applyStyle(FontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.FONT_FAMILY_KEY, FontFamily.Default.name())).getResId(), true);
getTheme().applyStyle(TitleFontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.TITLE_FONT_FAMILY_KEY, TitleFontFamily.Default.name())).getResId(), true);
getTheme().applyStyle(ContentFontFamily.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.CONTENT_FONT_FAMILY_KEY, ContentFontFamily.Default.name())).getResId(), true);
setContentView(R.layout.activity_view_video);
ButterKnife.bind(this);
setVolumeControlStream(AudioManager.STREAM_MUSIC);

View File

@ -16,7 +16,7 @@ import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import ml.docilealligator.infinityforreddit.Activity.EditMultiRedditActivity;
import ml.docilealligator.infinityforreddit.Activity.MultiRedditListingActivity;
import ml.docilealligator.infinityforreddit.Activity.SubscribedThingListingActivity;
import ml.docilealligator.infinityforreddit.MultiReddit.MultiReddit;
import ml.docilealligator.infinityforreddit.R;
@ -31,7 +31,7 @@ public class MultiRedditOptionsBottomSheetFragment extends RoundedBottomSheetDia
TextView editMultiRedditTextView;
@BindView(R.id.delete_multi_reddit_text_view_multi_reddit_options_bottom_sheet_fragment)
TextView deleteMultiRedditTextView;
private MultiRedditListingActivity multiRedditListingActivity;
private SubscribedThingListingActivity subscribedThingListingActivity;
public MultiRedditOptionsBottomSheetFragment() {
// Required empty public constructor
@ -48,14 +48,14 @@ public class MultiRedditOptionsBottomSheetFragment extends RoundedBottomSheetDia
MultiReddit multiReddit = getArguments().getParcelable(EXTRA_MULTI_REDDIT);
editMultiRedditTextView.setOnClickListener(view -> {
Intent editIntent = new Intent(multiRedditListingActivity, EditMultiRedditActivity.class);
Intent editIntent = new Intent(subscribedThingListingActivity, EditMultiRedditActivity.class);
editIntent.putExtra(EditMultiRedditActivity.EXTRA_MULTI_REDDIT, multiReddit);
startActivity(editIntent);
dismiss();
});
deleteMultiRedditTextView.setOnClickListener(view -> {
multiRedditListingActivity.deleteMultiReddit(multiReddit);
subscribedThingListingActivity.deleteMultiReddit(multiReddit);
dismiss();
});
@ -65,6 +65,6 @@ public class MultiRedditOptionsBottomSheetFragment extends RoundedBottomSheetDia
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
multiRedditListingActivity = (MultiRedditListingActivity) context;
subscribedThingListingActivity = (SubscribedThingListingActivity) context;
}
}

View File

@ -15,7 +15,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
import com.bumptech.glide.Glide;
@ -59,6 +58,8 @@ public class ThemePreviewPostsFragment extends Fragment {
CustomTextView nsfwTextView;
@BindView(R.id.flair_custom_text_view_theme_preview_posts_fragment)
CustomTextView flairTextView;
@BindView(R.id.awards_text_view_theme_preview_posts_fragment)
CustomTextView awardsTextView;
@BindView(R.id.archived_image_view_theme_preview_posts_fragment)
ImageView archivedImageView;
@BindView(R.id.locked_image_view_theme_preview_posts_fragment)
@ -120,6 +121,9 @@ public class ThemePreviewPostsFragment extends Fragment {
flairTextView.setBackgroundColor(customTheme.flairBackgroundColor);
flairTextView.setBorderColor(customTheme.flairBackgroundColor);
flairTextView.setTextColor(customTheme.flairTextColor);
awardsTextView.setBackgroundColor(customTheme.awardsBackgroundColor);
awardsTextView.setBorderColor(customTheme.awardsBackgroundColor);
awardsTextView.setTextColor(customTheme.awardsTextColor);
archivedImageView.setColorFilter(customTheme.archivedTint, PorterDuff.Mode.SRC_IN);
lockedImageView.setColorFilter(customTheme.lockedIconTint, PorterDuff.Mode.SRC_IN);
crosspostImageView.setColorFilter(customTheme.crosspostIconTint, PorterDuff.Mode.SRC_IN);

View File

@ -5,7 +5,6 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.preference.EditTextPreference;
import androidx.preference.ListPreference;
@ -32,12 +31,6 @@ public class CustomizeMainPageTabsFragment extends PreferenceFragmentCompat {
CustomThemeWrapper customThemeWrapper;
private SettingsActivity activity;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.customize_main_page_tabs_preferences, rootKey);

View File

@ -14,16 +14,41 @@ import ml.docilealligator.infinityforreddit.Event.RecreateActivityEvent;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
public class FontSizePreferenceFragment extends PreferenceFragmentCompat {
public class FontPreferenceFragment extends PreferenceFragmentCompat {
private Activity activity;
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.font_size_preferences, rootKey);
setPreferencesFromResource(R.xml.font_preferences, rootKey);
ListPreference fontFamilyPreference = findPreference(SharedPreferencesUtils.FONT_FAMILY_KEY);
ListPreference titleFontFamilyPreference = findPreference(SharedPreferencesUtils.TITLE_FONT_FAMILY_KEY);
ListPreference contentFontFamilyPreference = findPreference(SharedPreferencesUtils.CONTENT_FONT_FAMILY_KEY);
ListPreference fontSizePreference = findPreference(SharedPreferencesUtils.FONT_SIZE_KEY);
ListPreference titleFontSizePreference = findPreference(SharedPreferencesUtils.TITLE_FONT_SIZE_KEY);
ListPreference contentFontSizePreference = findPreference(SharedPreferencesUtils.CONTENT_FONT_SIZE_KEY);
if (fontFamilyPreference != null) {
fontFamilyPreference.setOnPreferenceChangeListener((preference, newValue) -> {
EventBus.getDefault().post(new RecreateActivityEvent());
activity.recreate();
return true;
});
}
if (titleFontFamilyPreference != null) {
titleFontFamilyPreference.setOnPreferenceChangeListener((preference, newValue) -> {
EventBus.getDefault().post(new RecreateActivityEvent());
return true;
});
}
if (contentFontFamilyPreference != null) {
contentFontFamilyPreference.setOnPreferenceChangeListener((preference, newValue) -> {
EventBus.getDefault().post(new RecreateActivityEvent());
return true;
});
}
if (fontSizePreference != null) {
fontSizePreference.setOnPreferenceChangeListener((preference, newValue) -> {
EventBus.getDefault().post(new RecreateActivityEvent());

View File

@ -24,7 +24,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_account_posts_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -24,7 +24,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_account_saved_thing_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"

View File

@ -16,7 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_comment_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_create_multi_reddit_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -24,7 +24,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_customize_theme_listing_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -25,7 +25,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_customize_theme_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -16,7 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_edit_comment_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_edit_multi_reddit_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_edit_post_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -24,7 +24,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_filtered_posts_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -15,7 +15,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_login_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_multi_reddit_listing_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -16,7 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_post_image_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />
@ -67,7 +68,6 @@
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:text="@string/rules"
android:textColor="@android:color/white"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />

View File

@ -16,7 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_post_link_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />
@ -67,7 +68,6 @@
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:text="@string/rules"
android:textColor="@android:color/white"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />

View File

@ -16,7 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_post_text_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />
@ -67,7 +68,6 @@
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:text="@string/rules"
android:textColor="@android:color/white"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />

View File

@ -16,7 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_post_video_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />
@ -67,7 +68,6 @@
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:text="@string/rules"
android:textColor="@android:color/white"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />

View File

@ -16,7 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_report_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_rules_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -21,7 +21,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />
@ -29,7 +30,6 @@
android:id="@+id/search_view_search_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@android:color/white"
app:backIconAlpha="1"
app:backIconTint="@android:color/white"
app:cursorColor="@android:color/white"

View File

@ -22,7 +22,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_search_result_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -16,7 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_search_subreddits_result_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_selected_subreddits_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -19,7 +19,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_settings_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_subreddit_selection_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_subscribed_subreddits_multiselection_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_subscribed_thing_listing_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"

View File

@ -70,7 +70,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subscribe"
android:textColor="@android:color/white"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
@ -107,7 +106,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
app:popupTheme="@style/AppTheme.PopupOverlay"

View File

@ -24,7 +24,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_view_message_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -24,7 +24,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_view_multi_reddit_detail_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_view_post_detail_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -23,7 +23,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_view_sidebar_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:navigationIcon="?attr/homeAsUpIndicator" />

View File

@ -72,7 +72,6 @@
android:id="@+id/subscribe_subreddit_chip_view_subreddit_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:layout_gravity="center_horizontal"/>
<androidx.constraintlayout.widget.ConstraintLayout
@ -151,7 +150,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
app:popupTheme="@style/AppTheme.PopupOverlay"

View File

@ -116,7 +116,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_view_user_detail_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
app:popupTheme="@style/AppTheme.PopupOverlay"

View File

@ -24,7 +24,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay" />

View File

@ -133,7 +133,6 @@
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/post_type_preview"
android:textColor="@android:color/white"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family"
app:lib_setRadius="3dp"
@ -147,7 +146,6 @@
android:layout_gravity="center"
android:padding="4dp"
android:text="@string/spoiler"
android:textColor="@android:color/white"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family"
app:lib_setRadius="3dp"
@ -160,7 +158,6 @@
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/nsfw"
android:textColor="@android:color/white"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family"
app:lib_setRadius="3dp"
@ -174,22 +171,23 @@
android:layout_gravity="center"
android:padding="4dp"
android:text="@string/flair_preview"
android:textColor="@android:color/white"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<TextView
<com.libRG.CustomTextView
android:id="@+id/awards_text_view_theme_preview_posts_fragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@drawable/gold"
android:drawablePadding="4dp"
android:text="@string/gilded_preview"
android:textColor="@color/gold"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
android:padding="4dp"
android:text="@string/awards_preview"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
<ImageView
android:id="@+id/archived_image_view_theme_preview_posts_fragment"

View File

@ -23,7 +23,6 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:textColor="@android:color/white"
android:text="@string/retry"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />

View File

@ -114,7 +114,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:textColor="@android:color/white"
android:textSize="?attr/font_10"
android:fontFamily="?attr/font_family"
app:lib_setRadius="3dp"
@ -128,7 +127,6 @@
android:layout_gravity="center"
android:padding="4dp"
android:text="@string/spoiler"
android:textColor="@android:color/white"
android:textSize="?attr/font_10"
android:fontFamily="?attr/font_family"
android:visibility="gone"
@ -142,7 +140,6 @@
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/nsfw"
android:textColor="@android:color/white"
android:textSize="?attr/font_10"
android:fontFamily="?attr/font_family"
android:visibility="gone"
@ -156,7 +153,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:textColor="@android:color/white"
android:textSize="?attr/font_10"
android:fontFamily="?attr/font_family"
android:visibility="gone"

View File

@ -128,7 +128,6 @@
android:padding="4dp"
android:text="@string/text"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:fontFamily="?attr/font_family"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
@ -141,7 +140,6 @@
android:layout_gravity="center"
android:text="@string/spoiler"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:fontFamily="?attr/font_family"
android:padding="4dp"
android:visibility="gone"

View File

@ -122,6 +122,18 @@
<item>XLarge</item>
<item>XXLarge</item>
</string-array>
<string-array name="settings_font_family">
<item>Default</item>
<item>Balsamiq Sans</item>
<item>Noto Sans</item>
</string-array>
<string-array name="settings_font_family_values">
<item>Default</item>
<item>BalsamiqSans</item>
<item>NotoSans</item>
</string-array>
<string-array name="settings_tab_post_type">
<item>Home</item>

View File

@ -348,6 +348,13 @@
<string name="settings_lock_bottom_app_bar_title">Lock Bottom Navigation Bar</string>
<string name="settings_swipe_up_to_hide_jump_to_next_top_level_comment_button_title">Swipe Up to Hide Jump to Next Top-level Comment Button</string>
<string name="settings_lazy_mode_interval_title">Lazy Mode Interval</string>
<string name="settings_font_title">Font</string>
<string name="settings_font_summary">Font</string>
<string name="settings_title_font_summary">Title</string>
<string name="settings_content_font_summary">Content</string>
<string name="settings_font_family_title">Font Family</string>
<string name="settings_title_font_family_title">Title Font Family</string>
<string name="settings_content_font_family_title">Content Font Family</string>
<string name="settings_font_size_title">Font Size</string>
<string name="settings_title_font_size_title">Title Font Size</string>
<string name="settings_content_font_size_title">Content Font Size</string>
@ -711,7 +718,7 @@
<string name="post_content_preview">This gravity joke is getting a bit old, but I fall for it every time.</string>
<string name="post_type_preview">POST</string>
<string name="flair_preview">Flair</string>
<string name="gilded_preview">x4</string>
<string name="awards_preview">4 Awards</string>
<string name="author_flair_preview">Author Flair</string>
<string name="comment_content_preview">I got my girlfriend a “Get better soon” card.\nShe\'s not ill or anything, but she could definitely get better.</string>

View File

@ -39,14 +39,15 @@
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowBackground">@android:color/black</item>
<item name="android:fontFamily">?attr/font_family</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" />
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.DayNight.ActionBar">
<item name="android:fontFamily">?attr/font_family</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.DayNight" />
<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="CustomTabLayout" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@android:color/white</item>
<item name="tabIndicatorHeight">3dp</item>
@ -105,10 +106,12 @@
<style name="PreferenceTitleTextStyle">
<item name="android:textSize">?attr/font_16</item>
<item name="android:textColor">?attr/primaryTextColor</item>
<item name="android:fontFamily">?attr/font_family</item>
</style>
<style name="PreferenceSubtitleTextStyle">
<item name="android:textSize">?attr/font_default</item>
<item name="android:fontFamily">?attr/font_family</item>
</style>
<style name="ListPreferenceStyle" parent="ThemeOverlay.AppCompat.Dialog.Alert">

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
app:title="@string/settings_font_summary" />
<ListPreference
app:defaultValue="Default"
android:entries="@array/settings_font_family"
app:entryValues="@array/settings_font_family_values"
app:key="font_family"
app:title="@string/settings_font_family_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" />
<PreferenceCategory
app:title="@string/settings_title_font_summary" />
<ListPreference
app:defaultValue="Default"
android:entries="@array/settings_font_family"
app:entryValues="@array/settings_font_family_values"
app:key="title_font_family"
app:title="@string/settings_title_font_family_title"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="Normal"
android:entries="@array/settings_title_font_size"
app:entryValues="@array/settings_title_font_size_values"
app:key="title_font_size"
app:title="@string/settings_title_font_size_title"
app:useSimpleSummaryProvider="true" />
<PreferenceCategory
app:title="@string/settings_content_font_summary" />
<ListPreference
app:defaultValue="Default"
android:entries="@array/settings_font_family"
app:entryValues="@array/settings_font_family_values"
app:key="content_font_family"
app:title="@string/settings_content_font_family_title"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="Normal"
android:entries="@array/settings_content_font_size"
app:entryValues="@array/settings_content_font_size_values"
app:key="content_font_size"
app:title="@string/settings_content_font_size_title"
app:useSimpleSummaryProvider="true" />
</PreferenceScreen>

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<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" />
<ListPreference
app:defaultValue="Normal"
android:entries="@array/settings_title_font_size"
app:entryValues="@array/settings_title_font_size_values"
app:key="title_font_size"
app:title="@string/settings_title_font_size_title"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="Normal"
android:entries="@array/settings_content_font_size"
app:entryValues="@array/settings_content_font_size_values"
app:key="content_font_size"
app:title="@string/settings_content_font_size_title"
app:useSimpleSummaryProvider="true" />
</PreferenceScreen>

View File

@ -3,9 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<Preference
app:title="@string/settings_font_size_title"
app:title="@string/settings_font_title"
app:icon="@drawable/ic_font_size_24dp"
app:fragment="ml.docilealligator.infinityforreddit.Settings.FontSizePreferenceFragment" />
app:fragment="ml.docilealligator.infinityforreddit.Settings.FontPreferenceFragment" />
<SwitchPreference
app:defaultValue="true"