Use framework switch
This commit is contained in:
9 files changed
+44
-44
No files matched your search
@@ -46,6 +46,7 @@ import android.webkit.MimeTypeMap;
|
|||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@@ -54,7 +55,6 @@ import androidx.activity.result.contract.ActivityResultContracts;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.widget.SwitchCompat;
|
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
@@ -980,14 +980,14 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
|
|||||||
private final Spinner mScaleMode;
|
private final Spinner mScaleMode;
|
||||||
private final Spinner mStartPosition;
|
private final Spinner mStartPosition;
|
||||||
private final Spinner mReadTheme;
|
private final Spinner mReadTheme;
|
||||||
private final SwitchCompat mKeepScreenOn;
|
private final Switch mKeepScreenOn;
|
||||||
private final SwitchCompat mShowClock;
|
private final Switch mShowClock;
|
||||||
private final SwitchCompat mShowProgress;
|
private final Switch mShowProgress;
|
||||||
private final SwitchCompat mShowBattery;
|
private final Switch mShowBattery;
|
||||||
private final SwitchCompat mShowPageInterval;
|
private final Switch mShowPageInterval;
|
||||||
private final SwitchCompat mVolumePage;
|
private final Switch mVolumePage;
|
||||||
private final SwitchCompat mReadingFullscreen;
|
private final Switch mReadingFullscreen;
|
||||||
private final SwitchCompat mCustomScreenLightness;
|
private final Switch mCustomScreenLightness;
|
||||||
private final SeekBar mScreenLightness;
|
private final SeekBar mScreenLightness;
|
||||||
|
|
||||||
@SuppressLint("InflateParams")
|
@SuppressLint("InflateParams")
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.IntDef;
|
import androidx.annotation.IntDef;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.SwitchCompat;
|
|
||||||
import androidx.recyclerview.widget.DefaultItemAnimator;
|
import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@@ -80,7 +80,7 @@ public class SearchLayout extends EasyRecyclerView implements CompoundButton.OnC
|
|||||||
private CategoryTable mCategoryTable;
|
private CategoryTable mCategoryTable;
|
||||||
private RadioGridGroup mNormalSearchMode;
|
private RadioGridGroup mNormalSearchMode;
|
||||||
private ImageView mNormalSearchModeHelp;
|
private ImageView mNormalSearchModeHelp;
|
||||||
private SwitchCompat mEnableAdvanceSwitch;
|
private Switch mEnableAdvanceSwitch;
|
||||||
private View mAdvanceView;
|
private View mAdvanceView;
|
||||||
private AdvanceSearchTable mTableAdvanceSearch;
|
private AdvanceSearchTable mTableAdvanceSearch;
|
||||||
private ImageSearchLayout mImageView;
|
private ImageSearchLayout mImageView;
|
||||||
|
|||||||
@@ -154,56 +154,56 @@
|
|||||||
android:paddingTop="@dimen/keyline_margin"
|
android:paddingTop="@dimen/keyline_margin"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<Switch
|
||||||
android:id="@+id/keep_screen_on"
|
android:id="@+id/keep_screen_on"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_read_keep_screen_on"
|
android:text="@string/settings_read_keep_screen_on"
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<Switch
|
||||||
android:id="@+id/show_clock"
|
android:id="@+id/show_clock"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_read_show_clock"
|
android:text="@string/settings_read_show_clock"
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<Switch
|
||||||
android:id="@+id/show_progress"
|
android:id="@+id/show_progress"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_read_show_progress"
|
android:text="@string/settings_read_show_progress"
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<Switch
|
||||||
android:id="@+id/show_battery"
|
android:id="@+id/show_battery"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_read_show_battery"
|
android:text="@string/settings_read_show_battery"
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<Switch
|
||||||
android:id="@+id/show_page_interval"
|
android:id="@+id/show_page_interval"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_read_show_page_interval"
|
android:text="@string/settings_read_show_page_interval"
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<Switch
|
||||||
android:id="@+id/volume_page"
|
android:id="@+id/volume_page"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_read_volume_page"
|
android:text="@string/settings_read_volume_page"
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<Switch
|
||||||
android:id="@+id/reading_fullscreen"
|
android:id="@+id/reading_fullscreen"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_read_reading_fullscreen"
|
android:text="@string/settings_read_reading_fullscreen"
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<Switch
|
||||||
android:id="@+id/custom_screen_lightness"
|
android:id="@+id/custom_screen_lightness"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<Switch
|
||||||
android:id="@+id/search_enable_advance"
|
android:id="@+id/search_enable_advance"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -17,14 +17,14 @@
|
|||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="save_parse_error_body"
|
android:key="save_parse_error_body"
|
||||||
android:summary="@string/settings_advanced_save_parse_error_body_summary"
|
android:summary="@string/settings_advanced_save_parse_error_body_summary"
|
||||||
android:title="@string/settings_advanced_save_parse_error_body"
|
android:title="@string/settings_advanced_save_parse_error_body"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="save_crash_log"
|
android:key="save_crash_log"
|
||||||
android:summary="@string/settings_advanced_save_crash_log_summary"
|
android:summary="@string/settings_advanced_save_crash_log_summary"
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
android:title="@string/settings_advanced_proxy"
|
android:title="@string/settings_advanced_proxy"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="built_in_hosts_2"
|
android:key="built_in_hosts_2"
|
||||||
android:summary="@string/settings_advanced_built_in_hosts_summary"
|
android:summary="@string/settings_advanced_built_in_hosts_summary"
|
||||||
@@ -86,21 +86,21 @@
|
|||||||
android:fragment="com.hippo.ehviewer.ui.fragment.HostsFragment"
|
android:fragment="com.hippo.ehviewer.ui.fragment.HostsFragment"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="dns_over_https"
|
android:key="dns_over_https"
|
||||||
android:summary="@string/settings_advanced_dns_over_http_summary"
|
android:summary="@string/settings_advanced_dns_over_http_summary"
|
||||||
android:title="@string/settings_advanced_dns_over_http_title"
|
android:title="@string/settings_advanced_dns_over_http_title"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="domain_fronting"
|
android:key="domain_fronting"
|
||||||
android:summary="@string/settings_advanced_domain_fronting_summary"
|
android:summary="@string/settings_advanced_domain_fronting_summary"
|
||||||
android:title="@string/settings_advanced_domain_fronting_title"
|
android:title="@string/settings_advanced_domain_fronting_title"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="e_ink_mode_2"
|
android:key="e_ink_mode_2"
|
||||||
android:summary="@string/settings_e_ink_mode_summary"
|
android:summary="@string/settings_e_ink_mode_summary"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
android:title="@string/settings_download_download_location"
|
android:title="@string/settings_download_download_location"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="media_scan"
|
android:key="media_scan"
|
||||||
android:title="@string/settings_download_media_scan"
|
android:title="@string/settings_download_media_scan"
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
app:entryValues="@array/image_resolution_entry_values"
|
app:entryValues="@array/image_resolution_entry_values"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="download_origin_image"
|
android:key="download_origin_image"
|
||||||
android:summary="@string/settings_download_download_origin_image_summary"
|
android:summary="@string/settings_download_download_origin_image_summary"
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
android:title="@string/settings_eh_theme"
|
android:title="@string/settings_eh_theme"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:key="black_dark_theme"
|
android:key="black_dark_theme"
|
||||||
android:title="@string/black_dark_theme"
|
android:title="@string/black_dark_theme"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
@@ -111,27 +111,27 @@
|
|||||||
app:entryValues="@array/thumb_resolution_entry_values"
|
app:entryValues="@array/thumb_resolution_entry_values"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="fix_thumb_url"
|
android:key="fix_thumb_url"
|
||||||
android:title="@string/settings_eh_fix_thumb_url"
|
android:title="@string/settings_eh_fix_thumb_url"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="show_jpn_title"
|
android:key="show_jpn_title"
|
||||||
android:summary="@string/settings_eh_show_jpn_title_summary"
|
android:summary="@string/settings_eh_show_jpn_title_summary"
|
||||||
android:title="@string/settings_eh_show_jpn_title"
|
android:title="@string/settings_eh_show_jpn_title"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="show_gallery_pages"
|
android:key="show_gallery_pages"
|
||||||
android:summary="@string/settings_eh_show_gallery_pages_summary"
|
android:summary="@string/settings_eh_show_gallery_pages_summary"
|
||||||
android:title="@string/settings_eh_show_gallery_pages"
|
android:title="@string/settings_eh_show_gallery_pages"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="show_tag_translations"
|
android:key="show_tag_translations"
|
||||||
android:summary="@string/settings_eh_show_tag_translations_summary"
|
android:summary="@string/settings_eh_show_tag_translations_summary"
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
android:fragment="com.hippo.ehviewer.ui.fragment.FilterFragment"
|
android:fragment="com.hippo.ehviewer.ui.fragment.FilterFragment"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="cellular_network_warning"
|
android:key="cellular_network_warning"
|
||||||
android:title="@string/settings_eh_metered_network_warning"
|
android:title="@string/settings_eh_metered_network_warning"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
android:fragment="com.hippo.ehviewer.ui.fragment.SetSecurityFragment"
|
android:fragment="com.hippo.ehviewer.ui.fragment.SetSecurityFragment"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="enable_secure"
|
android:key="enable_secure"
|
||||||
android:title="@string/settings_privacy_secure"
|
android:title="@string/settings_privacy_secure"
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
app:summaryOff="@string/settings_privacy_secure_summary"
|
app:summaryOff="@string/settings_privacy_secure_summary"
|
||||||
app:summaryOn="@string/settings_privacy_secure_summary" />
|
app:summaryOn="@string/settings_privacy_secure_summary" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
app:iconSpaceReserved="false"
|
app:iconSpaceReserved="false"
|
||||||
android:key="enable_analytics"
|
android:key="enable_analytics"
|
||||||
android:title="@string/settings_privacy_enable_analytics"
|
android:title="@string/settings_privacy_enable_analytics"
|
||||||
|
|||||||
@@ -62,49 +62,49 @@
|
|||||||
app:entryValues="@array/read_theme_entry_values"
|
app:entryValues="@array/read_theme_entry_values"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="keep_screen_on"
|
android:key="keep_screen_on"
|
||||||
android:title="@string/settings_read_keep_screen_on"
|
android:title="@string/settings_read_keep_screen_on"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="gallery_show_clock"
|
android:key="gallery_show_clock"
|
||||||
android:title="@string/settings_read_show_clock"
|
android:title="@string/settings_read_show_clock"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="gallery_show_progress"
|
android:key="gallery_show_progress"
|
||||||
android:title="@string/settings_read_show_progress"
|
android:title="@string/settings_read_show_progress"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="gallery_show_battery"
|
android:key="gallery_show_battery"
|
||||||
android:title="@string/settings_read_show_battery"
|
android:title="@string/settings_read_show_battery"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="gallery_show_page_interval"
|
android:key="gallery_show_page_interval"
|
||||||
android:title="@string/settings_read_show_page_interval"
|
android:title="@string/settings_read_show_page_interval"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="volume_page"
|
android:key="volume_page"
|
||||||
android:title="@string/settings_read_volume_page"
|
android:title="@string/settings_read_volume_page"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="reading_fullscreen"
|
android:key="reading_fullscreen"
|
||||||
android:title="@string/settings_read_reading_fullscreen"
|
android:title="@string/settings_read_reading_fullscreen"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="custom_screen_lightness"
|
android:key="custom_screen_lightness"
|
||||||
android:title="@string/settings_read_custom_screen_lightness"
|
android:title="@string/settings_read_custom_screen_lightness"
|
||||||
|
|||||||
Reference in new issue
Block a user