ui: completely migrate to material
Drop the Bridge theme and completely migrate to material. This is for two reasons: - To make Material You less painful - Improve coloring [Dark mode, other colors, etc]. Most of the previous UI elements were kept [no rounded corners], but did come at the cost of removing the hint tagline from the search bar since there was simply no good way to integrate it. There are also some other miscellanious issues [Weird selection menus, dividers are not migrated still], but those will be fixed in future commits.
This commit is contained in:
parent
74d55ba59e
commit
23e3c0241d
15 changed files with 44 additions and 22 deletions
|
@ -51,7 +51,6 @@ import org.oxycblt.auxio.util.makeScrollingViewFade
|
||||||
* TODO: Re-add sorting (but new and improved)
|
* TODO: Re-add sorting (but new and improved)
|
||||||
* It will require a new SortMode to be made simply for compat. Migrate the old SortMode
|
* It will require a new SortMode to be made simply for compat. Migrate the old SortMode
|
||||||
* eventually.
|
* eventually.
|
||||||
* TODO: Add lift-on-scroll eventually [when I can file a bug report or hack it into working]
|
|
||||||
* @author OxygenCobalt
|
* @author OxygenCobalt
|
||||||
*/
|
*/
|
||||||
class HomeFragment : Fragment() {
|
class HomeFragment : Fragment() {
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.oxycblt.auxio.ui.DisplayMode
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The [ViewModel] for the search functionality
|
* The [ViewModel] for the search functionality
|
||||||
|
* TODO: Try to find adjacent characters [e.g accented o == o]
|
||||||
* @author OxygenCobalt
|
* @author OxygenCobalt
|
||||||
*/
|
*/
|
||||||
class SearchViewModel : ViewModel() {
|
class SearchViewModel : ViewModel() {
|
||||||
|
|
|
@ -26,8 +26,6 @@ import android.view.ViewTreeObserver
|
||||||
import androidx.annotation.StyleRes
|
import androidx.annotation.StyleRes
|
||||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.core.view.children
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
import com.google.android.material.appbar.AppBarLayout
|
import com.google.android.material.appbar.AppBarLayout
|
||||||
import org.oxycblt.auxio.util.logE
|
import org.oxycblt.auxio.util.logE
|
||||||
|
|
||||||
|
|
4
app/src/main/res/color-night/color_popup_overlay.xml
Normal file
4
app/src/main/res/color-night/color_popup_overlay.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:alpha="0.12" android:color="?attr/colorOnSurface" />
|
||||||
|
</selector>
|
4
app/src/main/res/color/color_popup_overlay.xml
Normal file
4
app/src/main/res/color/color_popup_overlay.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:alpha="0.0" android:color="?attr/colorOnSurface" />
|
||||||
|
</selector>
|
4
app/src/main/res/color/color_selection.xml
Normal file
4
app/src/main/res/color/color_selection.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="?attr/colorOnSurface" android:alpha="0.16" />
|
||||||
|
</selector>
|
13
app/src/main/res/drawable/ui_popup_bg.xml
Normal file
13
app/src/main/res/drawable/ui_popup_bg.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<solid android:color="?attr/colorSurface" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<solid android:color="@color/color_popup_overlay" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
|
@ -3,7 +3,7 @@
|
||||||
android:color="?attr/colorControlHighlight">
|
android:color="?attr/colorControlHighlight">
|
||||||
<item android:id="@android:id/mask">
|
<item android:id="@android:id/mask">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<solid android:color="?attr/colorControlHighlight" />
|
<solid android:color="@android:color/white" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
</ripple>
|
</ripple>
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
app:tabContentStart="@dimen/spacing_medium"
|
app:tabContentStart="@dimen/spacing_medium"
|
||||||
app:tabIndicatorColor="?attr/colorAccent"
|
app:tabIndicatorColor="?attr/colorAccent"
|
||||||
app:tabMode="scrollable"
|
app:tabMode="scrollable"
|
||||||
app:tabRippleColor="?attr/colorControlHighlight"
|
|
||||||
app:tabTextAppearance="@style/TextAppearance.TabLayout.Label"
|
app:tabTextAppearance="@style/TextAppearance.TabLayout.Label"
|
||||||
app:tabTextColor="?android:attr/textColorPrimary"
|
app:tabTextColor="?android:attr/textColorPrimary"
|
||||||
app:tabUnboundedRipple="true" />
|
app:tabUnboundedRipple="true" />
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
android:id="@+id/search_text_layout"
|
android:id="@+id/search_text_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
app:hintEnabled="false"
|
||||||
app:boxBackgroundMode="filled"
|
app:boxBackgroundMode="filled"
|
||||||
app:boxStrokeColor="?attr/colorAccent"
|
app:boxStrokeColor="?attr/colorAccent"
|
||||||
app:boxStrokeWidth="0dp"
|
app:boxStrokeWidth="0dp"
|
||||||
|
@ -42,9 +43,9 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:hint="@string/hint_search_library"
|
android:hint="@string/hint_search_library"
|
||||||
|
android:padding="@dimen/spacing_medium"
|
||||||
android:imeOptions="actionSearch|flagNoExtractUi"
|
android:imeOptions="actionSearch|flagNoExtractUi"
|
||||||
android:inputType="textFilter"
|
android:inputType="textFilter"
|
||||||
android:padding="@dimen/spacing_medium"
|
|
||||||
android:textCursorDrawable="@drawable/ui_cursor" />
|
android:textCursorDrawable="@drawable/ui_cursor" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
<color name="surface">@color/surface_night</color>
|
<color name="surface">@color/surface_night</color>
|
||||||
<color name="divider">#3b3c3f</color>
|
<color name="divider">#3b3c3f</color>
|
||||||
<color name="selection">#484848</color>
|
<color name="selection">#686868</color>
|
||||||
<color name="inactive">#404040</color>
|
<color name="inactive">#404040</color>
|
||||||
<color name="control">#ffffff</color>
|
<color name="control">#ffffff</color>
|
||||||
<color name="nav_bar">#01151515</color>
|
<color name="nav_bar">#01151515</color>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<color name="surface_black">@android:color/black</color>
|
<color name="surface_black">@android:color/black</color>
|
||||||
|
|
||||||
<color name="surface">@color/surface_day</color>
|
<color name="surface">@color/surface_day</color>
|
||||||
<color name="selection">#cbcbcb</color>
|
<color name="selection">#ababab</color>
|
||||||
<color name="control">#202020</color>
|
<color name="control">#202020</color>
|
||||||
<color name="divider">#cbcbcb</color>
|
<color name="divider">#cbcbcb</color>
|
||||||
<color name="inactive">#c4c4c4</color>
|
<color name="inactive">#c4c4c4</color>
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<!-- ANDROID COMPONENT-SPECIFIC STYLES. MOSTLY HACKS -->
|
<!-- ANDROID COMPONENT-SPECIFIC STYLES. MOSTLY HACKS -->
|
||||||
|
|
||||||
<!-- Custom popup menu theme -->
|
<!-- Custom popup menu theme -->
|
||||||
<style name="Widget.CustomPopup" parent="Widget.AppCompat.PopupMenu">
|
<style name="Widget.CustomPopup" parent="Widget.MaterialComponents.PopupMenu.ContextMenu">
|
||||||
<item name="android:popupBackground">?attr/colorSurface</item>
|
<item name="android:popupBackground">@drawable/ui_popup_bg</item>
|
||||||
<item name="colorControlHighlight">?attr/colorControlHighlight</item>
|
<item name="colorControlHighlight">?attr/colorControlHighlight</item>
|
||||||
<item name="cornerRadius">0dp</item>
|
<item name="cornerRadius">0dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Master parent theme based off of Theme.MaterialComponents.DayNight.NoActionBar.Bridge -->
|
<!-- Master parent theme based off of Theme.MaterialComponents.DayNight.NoActionBar.Bridge -->
|
||||||
<style name="Theme.Master" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge" />
|
<style name="Theme.Master" parent="Theme.MaterialComponents.DayNight.NoActionBar" />
|
||||||
<!-- Template theme that handles edge-to-edge on other styles variants -->
|
<!-- Template theme that handles edge-to-edge on other styles variants -->
|
||||||
<style name="Theme.Edge" parent="Theme.Master" />
|
<style name="Theme.Edge" parent="Theme.Master" />
|
||||||
<!-- Android 12 Splashscreen config -->
|
<!-- Android 12 Splashscreen config -->
|
||||||
|
@ -14,9 +14,13 @@
|
||||||
<item name="colorAccent">@color/design_default_color_primary</item>
|
<item name="colorAccent">@color/design_default_color_primary</item>
|
||||||
|
|
||||||
<item name="colorPrimary">?attr/colorAccent</item>
|
<item name="colorPrimary">?attr/colorAccent</item>
|
||||||
|
<item name="colorOnPrimary">?attr/colorSurface</item>
|
||||||
|
|
||||||
<item name="colorSecondary">?attr/colorAccent</item>
|
<item name="colorSecondary">?attr/colorAccent</item>
|
||||||
|
<item name="colorOnSecondary">?attr/colorSurface</item>
|
||||||
|
|
||||||
<item name="colorControlNormal">@color/control</item>
|
<item name="colorControlNormal">@color/control</item>
|
||||||
<item name="colorControlHighlight">@color/selection</item>
|
<item name="colorControlHighlight">@color/color_selection</item>
|
||||||
<item name="colorControlActivated">?attr/colorAccent</item>
|
<item name="colorControlActivated">?attr/colorAccent</item>
|
||||||
|
|
||||||
<!-- Appearance -->
|
<!-- Appearance -->
|
||||||
|
@ -30,17 +34,11 @@
|
||||||
<!-- System-specific magic -->
|
<!-- System-specific magic -->
|
||||||
<item name="android:scrollbars">none</item>
|
<item name="android:scrollbars">none</item>
|
||||||
<item name="android:windowIsFloating">false</item>
|
<item name="android:windowIsFloating">false</item>
|
||||||
<item name="popupMenuStyle">@style/Widget.CustomPopup</item>
|
<item name="popupMenuBackground">@drawable/ui_popup_bg</item>
|
||||||
|
|
||||||
<!--
|
<!-- Material stuff -->
|
||||||
These exact flags, in this exact order, in this exact formatting somehow make
|
<item name="textInputStyle">@null</item>
|
||||||
the dialogs use the nicer material style. Please do not touch this or format it.
|
|
||||||
-->
|
|
||||||
<!-- @formatter:off -->
|
|
||||||
<item name="viewInflaterClass">com.google.android.material.theme.MaterialComponentsViewInflater</item>
|
|
||||||
<item name="alertDialogTheme">@style/ThemeOverlay.MaterialComponents.Dialog.Alert</item>
|
|
||||||
<item name="materialAlertDialogTheme">@style/Theme.CustomDialog</item>
|
<item name="materialAlertDialogTheme">@style/Theme.CustomDialog</item>
|
||||||
<!-- @formatter:on -->
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- The basic black theme derived in all black accents. -->
|
<!-- The basic black theme derived in all black accents. -->
|
||||||
|
|
|
@ -202,7 +202,6 @@
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:clickable">true</item>
|
<item name="android:clickable">true</item>
|
||||||
<item name="android:focusable">true</item>
|
<item name="android:focusable">true</item>
|
||||||
<item name="rippleColor">?attr/colorControlHighlight</item>
|
|
||||||
<item name="fontFamily">@font/inter_semibold</item>
|
<item name="fontFamily">@font/inter_semibold</item>
|
||||||
<item name="android:textSize">@dimen/text_size_small</item>
|
<item name="android:textSize">@dimen/text_size_small</item>
|
||||||
<item name="textAllCaps">false</item>
|
<item name="textAllCaps">false</item>
|
||||||
|
@ -212,10 +211,12 @@
|
||||||
<style name="Widget.Button.Vibrant.Primary" parent="@style/Widget.Button.Vibrant.Base">
|
<style name="Widget.Button.Vibrant.Primary" parent="@style/Widget.Button.Vibrant.Base">
|
||||||
<item name="android:textColor">?attr/colorSurface</item>
|
<item name="android:textColor">?attr/colorSurface</item>
|
||||||
<item name="backgroundTint">?attr/colorAccent</item>
|
<item name="backgroundTint">?attr/colorAccent</item>
|
||||||
|
<item name="rippleColor">@color/mtrl_btn_ripple_color</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Button.Vibrant.Secondary" parent="@style/Widget.Button.Vibrant.Base">
|
<style name="Widget.Button.Vibrant.Secondary" parent="@style/Widget.Button.Vibrant.Base">
|
||||||
<item name="strokeColor">@color/divider</item>
|
<item name="strokeColor">@color/divider</item>
|
||||||
<item name="strokeWidth">@dimen/size_stroke_small</item>
|
<item name="strokeWidth">@dimen/size_stroke_small</item>
|
||||||
|
<item name="rippleColor">?attr/colorControlHighlight</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in a new issue