Move 'show subscription title' setting to subscription page (#7097)
This commit is contained in:
parent
dbbb21bd3b
commit
d9d48674ed
|
@ -189,6 +189,9 @@ public class SubscriptionFragment extends Fragment
|
||||||
private void refreshToolbarState() {
|
private void refreshToolbarState() {
|
||||||
int columns = prefs.getInt(PREF_NUM_COLUMNS, getDefaultNumOfColumns());
|
int columns = prefs.getInt(PREF_NUM_COLUMNS, getDefaultNumOfColumns());
|
||||||
toolbar.getMenu().findItem(COLUMN_CHECKBOX_IDS[columns - MIN_NUM_COLUMNS]).setChecked(true);
|
toolbar.getMenu().findItem(COLUMN_CHECKBOX_IDS[columns - MIN_NUM_COLUMNS]).setChecked(true);
|
||||||
|
toolbar.getMenu().findItem(R.id.pref_show_subscription_title).setVisible(columns > 1);
|
||||||
|
toolbar.getMenu().findItem(R.id.pref_show_subscription_title)
|
||||||
|
.setChecked(UserPreferences.shouldShowSubscriptionTitle());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
|
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
|
||||||
|
@ -229,6 +232,10 @@ public class SubscriptionFragment extends Fragment
|
||||||
} else if (itemId == R.id.action_statistics) {
|
} else if (itemId == R.id.action_statistics) {
|
||||||
((MainActivity) getActivity()).loadChildFragment(new StatisticsFragment());
|
((MainActivity) getActivity()).loadChildFragment(new StatisticsFragment());
|
||||||
return true;
|
return true;
|
||||||
|
} else if (itemId == R.id.pref_show_subscription_title) {
|
||||||
|
item.setChecked(!item.isChecked());
|
||||||
|
UserPreferences.setShouldShowSubscriptionTitle(item.isChecked());
|
||||||
|
subscriptionAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,4 +49,10 @@
|
||||||
</group>
|
</group>
|
||||||
</menu>
|
</menu>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/pref_show_subscription_title"
|
||||||
|
android:title="@string/pref_show_subscription_title"
|
||||||
|
android:checkable="true"
|
||||||
|
custom:showAsAction="never" />
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -831,6 +831,10 @@ public abstract class UserPreferences {
|
||||||
return prefs.getBoolean(PREF_SUBSCRIPTION_TITLE, false);
|
return prefs.getBoolean(PREF_SUBSCRIPTION_TITLE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setShouldShowSubscriptionTitle(boolean show) {
|
||||||
|
prefs.edit().putBoolean(PREF_SUBSCRIPTION_TITLE, show).apply();
|
||||||
|
}
|
||||||
|
|
||||||
public static void setAllEpisodesSortOrder(SortOrder s) {
|
public static void setAllEpisodesSortOrder(SortOrder s) {
|
||||||
prefs.edit().putString(PREF_SORT_ALL_EPISODES, "" + s.code).apply();
|
prefs.edit().putString(PREF_SORT_ALL_EPISODES, "" + s.code).apply();
|
||||||
}
|
}
|
||||||
|
|
|
@ -525,8 +525,7 @@
|
||||||
<string name="new_episode_notification_disabled">Notification disabled</string>
|
<string name="new_episode_notification_disabled">Notification disabled</string>
|
||||||
<string name="pref_feed_settings_dialog_msg">This setting is unique to each podcast. You can change it by opening the podcast page.</string>
|
<string name="pref_feed_settings_dialog_msg">This setting is unique to each podcast. You can change it by opening the podcast page.</string>
|
||||||
<string name="pref_contribute">Contribute</string>
|
<string name="pref_contribute">Contribute</string>
|
||||||
<string name="pref_show_subscription_title">Show subscription title</string>
|
<string name="pref_show_subscription_title">Show titles</string>
|
||||||
<string name="pref_show_subscription_title_summary">Display the subscription title below the cover image</string>
|
|
||||||
<string name="pref_new_episodes_action_title">New episodes action</string>
|
<string name="pref_new_episodes_action_title">New episodes action</string>
|
||||||
<string name="pref_new_episodes_action_sum">Action to take for new episodes</string>
|
<string name="pref_new_episodes_action_sum">Action to take for new episodes</string>
|
||||||
|
|
||||||
|
|
|
@ -49,11 +49,6 @@
|
||||||
android:title="@string/pref_filter_feed_title"
|
android:title="@string/pref_filter_feed_title"
|
||||||
android:key="prefSubscriptionsFilter"
|
android:key="prefSubscriptionsFilter"
|
||||||
android:summary="@string/pref_filter_feed_sum" />
|
android:summary="@string/pref_filter_feed_sum" />
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:title="@string/pref_show_subscription_title"
|
|
||||||
android:key="prefSubscriptionTitle"
|
|
||||||
android:summary="@string/pref_show_subscription_title_summary"
|
|
||||||
android:defaultValue="false" />
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/external_elements">
|
<PreferenceCategory android:title="@string/external_elements">
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreferenceCompat
|
||||||
|
|
Loading…
Reference in New Issue