Centered CheckBox in popup menu

This commit is contained in:
Prathamesh More 2022-02-19 12:19:32 +05:30
parent cda7af4420
commit 6c159297dc
3 changed files with 13 additions and 5 deletions

View file

@ -8,10 +8,11 @@
<code.name.monkey.retromusic.views.TopAppBarLayout <code.name.monkey.retromusic.views.TopAppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
style="?appBarLayoutStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="?appBarLayoutStyle" android:fitsSystemWindows="true"
android:fitsSystemWindows="true" /> android:theme="@style/CenteredCheckBoxTheme" />
<code.name.monkey.retromusic.views.insets.InsetsRecyclerView <code.name.monkey.retromusic.views.insets.InsetsRecyclerView
android:id="@+id/recycler_view" android:id="@+id/recycler_view"

View file

@ -28,8 +28,9 @@
<com.google.android.material.checkbox.MaterialCheckBox <com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/checkbox" android:id="@+id/checkbox"
style="@style/Widget.Material3.CompoundButton.CheckBox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:background="@null" android:background="@null"
android:clickable="false" android:clickable="false"
android:focusable="false" android:focusable="false"

View file

@ -125,7 +125,6 @@
<item name="cornerSize">0dp</item> <item name="cornerSize">0dp</item>
</style> </style>
<style name="SplashTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> <style name="SplashTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@drawable/splash</item> <item name="android:windowBackground">@drawable/splash</item>
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
@ -134,6 +133,14 @@
<style name="MaterialPopupMenuStyle" parent="Widget.Material3.PopupMenu"> <style name="MaterialPopupMenuStyle" parent="Widget.Material3.PopupMenu">
<item name="android:popupBackground">@drawable/popup_background</item> <item name="android:popupBackground">@drawable/popup_background</item>
</style> </style>
<style name="CenteredCheckBoxTheme">
<item name="checkboxStyle">@style/CheckBoxStyle</item>
</style>
<style name="CheckBoxStyle" parent="@style/Widget.AppCompat.CompoundButton.CheckBox">
<item name="android:gravity">center_vertical|end</item>
</style>
<style name="MaterialAlertDialogTheme" parent="ThemeOverlay.Material3.MaterialAlertDialog"> <style name="MaterialAlertDialogTheme" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="materialAlertDialogBodyTextStyle"> <item name="materialAlertDialogBodyTextStyle">
@ -180,7 +187,6 @@
<item name="android:paddingBottom">@dimen/button_padding_vertical</item> <item name="android:paddingBottom">@dimen/button_padding_vertical</item>
</style> </style>
<style name="BottomSheetStyle" parent="Widget.Material3.BottomSheet"> <style name="BottomSheetStyle" parent="Widget.Material3.BottomSheet">
<item name="android:maxWidth">@empty</item> <item name="android:maxWidth">@empty</item>
</style> </style>