mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 20:57:25 +01:00
Add settings for navigation drawer.
This commit is contained in:
parent
5811ca9ff0
commit
c0937304cc
@ -0,0 +1,19 @@
|
|||||||
|
package ml.docilealligator.infinityforreddit.settings;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
|
import ml.docilealligator.infinityforreddit.R;
|
||||||
|
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
|
||||||
|
|
||||||
|
public class NavigationDrawerPreferenceFragment extends PreferenceFragmentCompat {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
|
PreferenceManager preferenceManager = getPreferenceManager();
|
||||||
|
preferenceManager.setSharedPreferencesName(SharedPreferencesUtils.NAVIGATION_DRAWER_SHARED_PREFERENCES_FILE);
|
||||||
|
setPreferencesFromResource(R.xml.navigation_drawer_preferences, rootKey);
|
||||||
|
}
|
||||||
|
}
|
@ -547,6 +547,12 @@
|
|||||||
<string name="settings_restore_settings_title">Restore Settings</string>
|
<string name="settings_restore_settings_title">Restore Settings</string>
|
||||||
<string name="settings_credits_love_animation_title">Love Animation</string>
|
<string name="settings_credits_love_animation_title">Love Animation</string>
|
||||||
<string name="settings_swipe_between_posts_title">Swipe Between Posts</string>
|
<string name="settings_swipe_between_posts_title">Swipe Between Posts</string>
|
||||||
|
<string name="settings_navigation_drawer_title">Navigation Drawer</string>
|
||||||
|
<string name="settings_collapse_account_section_title">Collapse Account Section</string>
|
||||||
|
<string name="settings_collapse_post_section_title">Collapse Post Section</string>
|
||||||
|
<string name="settings_collapse_preferences_section_title">Collapse Preferences Section</string>
|
||||||
|
<string name="settings_collapse_favorite_subreddits_section_title">Collapse Favorite Subreddits Section</string>
|
||||||
|
<string name="settings_collapse_subscribed_subreddits_section_title">Collapse Subscribed Subreddits Section</string>
|
||||||
|
|
||||||
<string name="no_link_available">Cannot get the link</string>
|
<string name="no_link_available">Cannot get the link</string>
|
||||||
|
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
app:fragment="ml.docilealligator.infinityforreddit.settings.ImmersiveInterfacePreferenceFragment"
|
app:fragment="ml.docilealligator.infinityforreddit.settings.ImmersiveInterfacePreferenceFragment"
|
||||||
app:isPreferenceVisible="false" />
|
app:isPreferenceVisible="false" />
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
app:title="@string/settings_navigation_drawer_title"
|
||||||
|
app:fragment="ml.docilealligator.infinityforreddit.settings.NavigationDrawerPreferenceFragment" />
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
app:title="@string/settings_customize_tabs_in_main_page_title"
|
app:title="@string/settings_customize_tabs_in_main_page_title"
|
||||||
app:summary="@string/only_for_logged_in_user"
|
app:summary="@string/only_for_logged_in_user"
|
||||||
|
34
app/src/main/res/xml/navigation_drawer_preferences.xml
Normal file
34
app/src/main/res/xml/navigation_drawer_preferences.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
app:icon="@drawable/ic_info_preference_24dp"
|
||||||
|
app:summary="@string/restart_app_see_changes"
|
||||||
|
app:enabled="false" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
app:defaultValue="false"
|
||||||
|
app:key="collapse_account_section"
|
||||||
|
app:title="@string/settings_collapse_account_section_title" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
app:defaultValue="false"
|
||||||
|
app:key="collapse_post_section"
|
||||||
|
app:title="@string/settings_collapse_post_section_title" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
app:defaultValue="false"
|
||||||
|
app:key="collapse_preferences_section"
|
||||||
|
app:title="@string/settings_collapse_preferences_section_title" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
app:defaultValue="false"
|
||||||
|
app:key="collapse_favorite_subreddits_section"
|
||||||
|
app:title="@string/settings_collapse_favorite_subreddits_section_title" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
app:defaultValue="false"
|
||||||
|
app:key="collapse_subscribed_subreddits_section"
|
||||||
|
app:title="@string/settings_collapse_subscribed_subreddits_section_title" />
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
Loading…
Reference in New Issue
Block a user