ui: vendor bottom sheet dialog w/fixes

Vendor BottomSheetDialog(Fragment) with the inset fix that prior used
reflection.

Apparently said reflection breaks down and crashes the release build
somehow. So now I just have to hastily patch BackportBottomSheetBehavior
and vendor another 1000 lines of MDC code.

Really considering making a PHP sadness-like blog solely for android
at this point.
This commit is contained in:
Alexander Capehart
2023-08-16 17:12:56 -06:00
parent b43e4695c0
commit 70a5bab921
6 changed files with 753 additions and 75 deletions
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<View
android:id="@+id/touch_outside"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="false"
android:importantForAccessibility="no"
android:soundEffectsEnabled="false"
tools:ignore="UnusedAttribute"/>
<FrameLayout
android:id="@+id/design_bottom_sheet"
style="?attr/bottomSheetStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
app:layout_behavior="com.google.android.material.bottomsheet.BackportBottomSheetBehavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</FrameLayout>
+8
View File
@@ -32,11 +32,19 @@
</style>
<style name="Widget.Auxio.BottomSheet" parent="Widget.Material3.BottomSheet">
<item name="marginLeftSystemWindowInsets">false</item>
<item name="marginRightSystemWindowInsets">false</item>
<item name="paddingBottomSystemWindowInsets">false</item>
<item name="paddingTopSystemWindowInsets">false</item>
<item name="shapeAppearance">@style/ShapeAppearance.Material3.Corner.None</item>
<item name="shouldRemoveExpandedCorners">true</item>
</style>
<style name="Widget.Auxio.BottomSheet.Modal" parent="Widget.Material3.BottomSheet.Modal">
<item name="marginLeftSystemWindowInsets">false</item>
<item name="marginRightSystemWindowInsets">false</item>
<item name="paddingBottomSystemWindowInsets">false</item>
<item name="paddingTopSystemWindowInsets">false</item>
<item name="shapeAppearance">@style/ShapeAppearance.Material3.Corner.None</item>
<item name="shouldRemoveExpandedCorners">true</item>
</style>