mirror of
https://github.com/M66B/NetGuard.git
synced 2025-03-05 19:29:43 +00:00
parent
959d610a2e
commit
4c0eb31e6c
2 changed files with 58 additions and 19 deletions
39
app/src/main/java/eu/faircode/netguard/SwitchPreference.java
Normal file
39
app/src/main/java/eu/faircode/netguard/SwitchPreference.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package eu.faircode.netguard;
|
||||
|
||||
/*
|
||||
This file is part of NetGuard.
|
||||
|
||||
NetGuard is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
NetGuard is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with NetGuard. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright 2015-2016 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
// https://code.google.com/p/android/issues/detail?id=26194
|
||||
|
||||
public class SwitchPreference extends android.preference.SwitchPreference {
|
||||
public SwitchPreference(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public SwitchPreference(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, android.R.attr.switchPreferenceStyle);
|
||||
}
|
||||
|
||||
public SwitchPreference(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
}
|
|
@ -3,23 +3,23 @@
|
|||
<PreferenceCategory
|
||||
android:key="category_defaults"
|
||||
android:title="@string/setting_defaults">
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="whitelist_wifi"
|
||||
android:title="@string/setting_whitelist_wifi" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="whitelist_other"
|
||||
android:title="@string/setting_whitelist_other" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="screen_wifi"
|
||||
android:title="@string/setting_screen_wifi" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="screen_other"
|
||||
android:title="@string/setting_screen_other" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="whitelist_roaming"
|
||||
android:title="@string/setting_whitelist_roaming" />
|
||||
|
@ -33,7 +33,7 @@
|
|||
android:entries="@array/themeNames"
|
||||
android:entryValues="@array/themeValues"
|
||||
android:key="theme" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="dark_theme"
|
||||
android:title="@string/setting_dark" />
|
||||
|
@ -52,7 +52,7 @@
|
|||
<PreferenceCategory
|
||||
android:key="category_options"
|
||||
android:title="@string/setting_network_options">
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="tethering"
|
||||
android:title="@string/setting_tethering" />
|
||||
|
@ -60,27 +60,27 @@
|
|||
android:defaultValue="@array/default_wifi_home"
|
||||
android:key="wifi_homes"
|
||||
android:summary="@string/summary_wifi_home" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="use_metered"
|
||||
android:summary="@string/summary_metered"
|
||||
android:title="@string/setting_metered" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="unmetered_2g"
|
||||
android:summary="@string/summary_metered_2g"
|
||||
android:title="@string/setting_metered_2g" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="unmetered_3g"
|
||||
android:summary="@string/summary_metered_3g"
|
||||
android:title="@string/setting_metered_3g" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="unmetered_4g"
|
||||
android:summary="@string/summary_metered_4g"
|
||||
android:title="@string/setting_metered_4g" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="national_roaming"
|
||||
android:summary="@string/summary_national_roaming"
|
||||
|
@ -90,28 +90,28 @@
|
|||
<PreferenceCategory
|
||||
android:key="category_options"
|
||||
android:title="@string/setting_advanced_options">
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="manage_system"
|
||||
android:summary="@string/summary_system"
|
||||
android:title="@string/setting_system" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="log_app"
|
||||
android:summary="@string/summary_log_app"
|
||||
android:title="@string/setting_log_app" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:dependency="log_app"
|
||||
android:key="notify_access"
|
||||
android:summary="@string/summary_access"
|
||||
android:title="@string/setting_access" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="filter"
|
||||
android:summary="@string/summary_filter"
|
||||
android:title="@string/setting_filter" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:dependency="filter"
|
||||
android:key="use_hosts"
|
||||
|
@ -135,12 +135,12 @@
|
|||
<PreferenceCategory
|
||||
android:key="category_stats"
|
||||
android:title="@string/setting_stats_category">
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="show_stats"
|
||||
android:summary="@string/summary_stats"
|
||||
android:title="@string/setting_stats" />
|
||||
<SwitchPreference
|
||||
<eu.faircode.netguard.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:dependency="show_stats"
|
||||
android:key="show_top"
|
||||
|
|
Loading…
Add table
Reference in a new issue