From 7259e5e3150224c84544589f8f121b5bc459d172 Mon Sep 17 00:00:00 2001 From: txyyh Date: Tue, 24 May 2022 23:01:43 +0800 Subject: [PATCH] Use checkbox instead It's clear that button will be too big when switch to m3 button, and radio button is not suitable, so that's it. --- app/src/main/java/com/hippo/ehviewer/widget/SearchLayout.kt | 5 +---- app/src/main/res/layout/search_normal.xml | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/widget/SearchLayout.kt b/app/src/main/java/com/hippo/ehviewer/widget/SearchLayout.kt index a22d2e14f..5c65ee005 100644 --- a/app/src/main/java/com/hippo/ehviewer/widget/SearchLayout.kt +++ b/app/src/main/java/com/hippo/ehviewer/widget/SearchLayout.kt @@ -32,7 +32,6 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.chip.Chip import com.google.android.material.chip.ChipGroup import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.google.android.material.switchmaterial.SwitchMaterial import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout.OnTabSelectedListener import com.hippo.easyrecyclerview.EasyRecyclerView @@ -59,7 +58,7 @@ class SearchLayout @JvmOverloads constructor( private var mNormalView: View private var mNormalSearchMode: RadioGridGroup private var mNormalSearchModeHelp: ImageView - private var mEnableAdvanceSwitch: SwitchMaterial + private var mEnableAdvanceSwitch: CheckBox private var mAdvanceView: View private var mTableAdvanceSearch: AdvanceSearchTable private var mImageView: ImageSearchLayout @@ -118,8 +117,6 @@ class SearchLayout @JvmOverloads constructor( mEnableAdvanceSwitch = mNormalView.findViewById(R.id.search_enable_advance) mNormalSearchModeHelp.setOnClickListener(this) mEnableAdvanceSwitch.setOnCheckedChangeListener(this) - mEnableAdvanceSwitch.switchPadding = - resources.getDimensionPixelSize(R.dimen.switch_padding) // Create advance view mAdvanceView = mInflater.inflate(R.layout.search_advance, null) mTableAdvanceSearch = mAdvanceView.findViewById(R.id.search_advance_search_table) diff --git a/app/src/main/res/layout/search_normal.xml b/app/src/main/res/layout/search_normal.xml index 80a54dac3..170df1f8d 100644 --- a/app/src/main/res/layout/search_normal.xml +++ b/app/src/main/res/layout/search_normal.xml @@ -89,7 +89,7 @@ android:layout_height="wrap_content" android:layout_weight="1" /> -