Migrate to material theming
Finally move the app from AppCompat the Material Bridge theme. This does a couple things: - Removes need for runtime styling of material widgets used before - Allows for a better dialog style [But only after a ton of tinkering and weird hacks] - Makes theming slightly easier [After all the dumb migration bugs and technicalities are fixed] I never want to do something like this again. UI styling on android is a nightmare.
This commit is contained in:
parent
f2445e56f2
commit
03aa2d4579
21 changed files with 95 additions and 102 deletions
|
@ -16,7 +16,6 @@ import org.oxycblt.auxio.recycler.DiffCallback
|
|||
import org.oxycblt.auxio.recycler.viewholders.BaseViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.Highlightable
|
||||
import org.oxycblt.auxio.ui.Accent
|
||||
import org.oxycblt.auxio.ui.applyAccents
|
||||
import org.oxycblt.auxio.ui.disable
|
||||
import org.oxycblt.auxio.ui.inflater
|
||||
import org.oxycblt.auxio.ui.setTextColorResource
|
||||
|
@ -116,9 +115,6 @@ class AlbumDetailAdapter(
|
|||
binding.playbackModel = playbackModel
|
||||
binding.lifecycleOwner = lifecycleOwner
|
||||
|
||||
binding.albumShuffleButton.applyAccents(true)
|
||||
binding.albumPlayButton.applyAccents(false)
|
||||
|
||||
if (data.songs.size < 2) {
|
||||
binding.albumSortButton.disable()
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.oxycblt.auxio.recycler.DiffCallback
|
|||
import org.oxycblt.auxio.recycler.viewholders.BaseViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.Highlightable
|
||||
import org.oxycblt.auxio.ui.Accent
|
||||
import org.oxycblt.auxio.ui.applyAccents
|
||||
import org.oxycblt.auxio.ui.disable
|
||||
import org.oxycblt.auxio.ui.inflater
|
||||
import org.oxycblt.auxio.ui.setTextColorResource
|
||||
|
@ -115,9 +114,6 @@ class ArtistDetailAdapter(
|
|||
binding.playbackModel = playbackModel
|
||||
binding.lifecycleOwner = lifecycleOwner
|
||||
|
||||
binding.artistShuffleButton.applyAccents(true)
|
||||
binding.artistPlayButton.applyAccents(false)
|
||||
|
||||
if (data.albums.size < 2) {
|
||||
binding.artistSortButton.disable()
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.oxycblt.auxio.recycler.DiffCallback
|
|||
import org.oxycblt.auxio.recycler.viewholders.BaseViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.Highlightable
|
||||
import org.oxycblt.auxio.ui.Accent
|
||||
import org.oxycblt.auxio.ui.applyAccents
|
||||
import org.oxycblt.auxio.ui.disable
|
||||
import org.oxycblt.auxio.ui.inflater
|
||||
import org.oxycblt.auxio.ui.setTextColorResource
|
||||
|
@ -116,9 +115,6 @@ class GenreDetailAdapter(
|
|||
binding.playbackModel = playbackModel
|
||||
binding.lifecycleOwner = lifecycleOwner
|
||||
|
||||
binding.genreShuffleButton.applyAccents(true)
|
||||
binding.genrePlayButton.applyAccents(false)
|
||||
|
||||
if (data.songs.size < 2) {
|
||||
binding.genreSortButton.disable()
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.oxycblt.auxio.search
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
@ -23,12 +22,9 @@ import org.oxycblt.auxio.music.Genre
|
|||
import org.oxycblt.auxio.music.Header
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.ui.Accent
|
||||
import org.oxycblt.auxio.ui.fixAnimInfoLeak
|
||||
import org.oxycblt.auxio.ui.getSpans
|
||||
import org.oxycblt.auxio.ui.newMenu
|
||||
import org.oxycblt.auxio.ui.toColor
|
||||
import org.oxycblt.auxio.ui.toStateList
|
||||
|
||||
/**
|
||||
* A [Fragment] that allows for the searching of the entire music library.
|
||||
|
@ -51,9 +47,6 @@ class SearchFragment : Fragment() {
|
|||
newMenu(view, data)
|
||||
}
|
||||
|
||||
// Apply the accents manually. Not going through the mess of converting my app's
|
||||
// styling to Material given all the second-and-third-order effects it has.
|
||||
val accent = Accent.get().color.toColor(requireContext())
|
||||
val toolbarParams = binding.searchToolbar.layoutParams as AppBarLayout.LayoutParams
|
||||
val defaultParams = toolbarParams.scrollFlags
|
||||
|
||||
|
@ -73,12 +66,6 @@ class SearchFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
|
||||
binding.searchTextLayout.apply {
|
||||
boxStrokeColor = accent
|
||||
hintTextColor = ColorStateList.valueOf(accent)
|
||||
setEndIconTintList(R.color.control_color.toStateList(context))
|
||||
}
|
||||
|
||||
binding.searchEditText.addTextChangedListener { text ->
|
||||
// Run the search with the updated text as the query
|
||||
searchModel.doSearch(text?.toString() ?: "", requireContext())
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.oxycblt.auxio.settings.ui
|
||||
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import org.oxycblt.auxio.R
|
||||
|
||||
class IntListPrefDialog(private val pref: IntListPreference) : LifecycleDialog() {
|
||||
override fun onConfigDialog(builder: AlertDialog.Builder) {
|
||||
|
|
|
@ -4,16 +4,17 @@ import android.app.Dialog
|
|||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import org.oxycblt.auxio.R
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
||||
/**
|
||||
* A wrapper around [DialogFragment] that allows the usage of the standard Auxio lifecycle
|
||||
* override [onCreateView] and [onDestroyView], but with a proper dialog being created.
|
||||
*/
|
||||
abstract class LifecycleDialog : DialogFragment() {
|
||||
abstract class LifecycleDialog : AppCompatDialogFragment() {
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val builder = AlertDialog.Builder(requireActivity(), R.style.Theme_CustomDialog)
|
||||
val builder = MaterialAlertDialogBuilder(requireActivity(), theme)
|
||||
|
||||
onConfigDialog(builder)
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import androidx.annotation.PluralsRes
|
|||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.logE
|
||||
import kotlin.reflect.KClass
|
||||
|
@ -47,21 +46,6 @@ fun TextView.setTextColorResource(@ColorRes color: Int) {
|
|||
setTextColor(color.toColor(context))
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply accents to a [MaterialButton] manually.
|
||||
* Yes, I could change my theming to Material but that would have so many second-and-third order
|
||||
* effects that I *really* dont want to deal with it. This hack works.
|
||||
* @param highlighted Whether the MaterialButton has an "Unimportant" style or not.
|
||||
* Required because you cant determine a style of a view before API 29
|
||||
*/
|
||||
fun MaterialButton.applyAccents(highlighted: Boolean) {
|
||||
if (highlighted) {
|
||||
backgroundTintList = Accent.get().getStateList(context)
|
||||
} else {
|
||||
setTextColorResource(Accent.get().color)
|
||||
}
|
||||
}
|
||||
|
||||
// --- CONVENIENCE ---
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/selection_color">
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/selection_color" />
|
||||
<solid android:color="?attr/colorControlHighlight" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
|
|
@ -90,19 +90,18 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/album_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_cover"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_cover" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/album_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playAlbum(album, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/album_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/album_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/album_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_song_header"
|
||||
|
|
|
@ -86,19 +86,18 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/artist_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/artist_image"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/artist_image" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/artist_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playArtist(artist, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/artist_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/artist_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/artist_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/artist_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist_album_header"
|
||||
|
|
|
@ -73,19 +73,18 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/genre_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/genre_image"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/genre_image" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/genre_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/genre_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/genre_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/genre_duration"
|
||||
|
|
|
@ -90,19 +90,18 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/album_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_cover"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_cover" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/album_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playAlbum(album, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/album_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/album_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/album_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_song_header"
|
||||
|
|
|
@ -86,19 +86,18 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/artist_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/artist_image"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/artist_image" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/artist_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playArtist(artist, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/artist_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/artist_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/artist_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/artist_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist_album_header"
|
||||
|
|
|
@ -73,19 +73,18 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/genre_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/genre_image"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/genre_image" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/genre_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/genre_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/genre_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/genre_duration"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
android:fontFamily="@font/inter_exbold"
|
||||
android:padding="@dimen/padding_medium"
|
||||
android:text="@string/setting_accent"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="@dimen/text_size_toolbar_header"
|
||||
|
|
|
@ -24,9 +24,10 @@
|
|||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/search_text_layout"
|
||||
style="@style/Theme.MaterialComponents.DayNight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxStrokeWidthFocused="2dp"
|
||||
app:boxStrokeColor="?attr/colorPrimary"
|
||||
app:boxBackgroundMode="filled"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:endIconContentDescription="@string/description_clear_search"
|
||||
|
@ -36,7 +37,6 @@
|
|||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/search_edit_text"
|
||||
style="@style/Widget.AppCompat.EditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
|
|
|
@ -84,19 +84,18 @@
|
|||
android:text="@string/label_play"
|
||||
app:layout_constraintEnd_toStartOf="@+id/album_shuffle_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_details"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_details" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/album_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playAlbum(album, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/album_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/album_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/album_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_song_header"
|
||||
|
|
|
@ -83,19 +83,18 @@
|
|||
android:text="@string/label_play"
|
||||
app:layout_constraintEnd_toStartOf="@+id/artist_shuffle_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/artist_counts"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/artist_counts" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/artist_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playArtist(artist, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/artist_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/artist_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/artist_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/artist_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist_album_header"
|
||||
|
|
|
@ -84,19 +84,18 @@
|
|||
android:text="@string/label_play"
|
||||
app:layout_constraintEnd_toStartOf="@+id/genre_shuffle_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/genre_duration"
|
||||
tools:textColor="@color/control_color" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/genre_duration" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/genre_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/genre_play_button"
|
||||
tools:backgroundTint="@color/control_color" />
|
||||
app:layout_constraintTop_toTopOf="@+id/genre_play_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/genre_song_header"
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:focusable">true</item>
|
||||
<item name="android:theme">@style/Theme.MaterialComponents</item>
|
||||
<item name="rippleColor">@color/selection_color</item>
|
||||
<item name="fontFamily">@font/inter_semibold</item>
|
||||
<item name="textAllCaps">false</item>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Master parent theme based off of Theme.AppCompat.DayNight.NoActionBar -->
|
||||
<style name="Theme.Master" parent="Theme.AppCompat.DayNight.NoActionBar" />
|
||||
<!-- Master parent theme based off of Theme.MaterialComponents.DayNight.NoActionBar.Bridge -->
|
||||
<style name="Theme.Master" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge" />
|
||||
<!-- Template theme that handles edge-to-edge on other styles variants -->
|
||||
<style name="Theme.Template" parent="Theme.Master" />
|
||||
|
||||
|
@ -13,15 +13,28 @@
|
|||
<item name="android:scrollbars">none</item>
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
|
||||
<!-- Interim default values for the accents. -->
|
||||
<item name="colorPrimary">@color/design_default_color_primary</item>
|
||||
<item name="colorSecondary">@color/design_default_color_primary</item>
|
||||
|
||||
<item name="popupMenuStyle">@style/Widget.CustomPopup</item>
|
||||
<item name="colorControlNormal">@color/control_color</item>
|
||||
<item name="alertDialogTheme">@style/Theme.CustomDialog</item>
|
||||
<item name="colorControlHighlight">@color/selection_color</item>
|
||||
<item name="colorControlActivated">?attr/colorPrimary</item>
|
||||
<item name="cornerRadius">0dp</item>
|
||||
<item name="colorSurface">@color/background</item>
|
||||
|
||||
<!--
|
||||
These magic values seem to make the dialogs use the nicer material style. Don't know why.
|
||||
-->
|
||||
<item name="viewInflaterClass">
|
||||
com.google.android.material.theme.MaterialComponentsViewInflater
|
||||
</item>
|
||||
|
||||
<item name="materialAlertDialogTheme">@style/Theme.CustomDialog</item>
|
||||
<item name="alertDialogTheme">@style/ThemeOverlay.MaterialComponents.Dialog.Alert</item>
|
||||
</style>
|
||||
|
||||
|
||||
<!-- Toolbar theme -->
|
||||
<style name="Toolbar.Style" parent="ThemeOverlay.MaterialComponents.ActionBar">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
|
@ -79,28 +92,57 @@
|
|||
</style>
|
||||
|
||||
<!-- Custom Dialog EntryNames -->
|
||||
<style name="Theme.CustomDialog" parent="ThemeOverlay.AppCompat.Dialog.Alert">
|
||||
<item name="android:windowTitleStyle">@style/TextAppearance.Dialog.Title</item>
|
||||
<style name="Theme.CustomDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
|
||||
<item name="android:background">@color/background</item>
|
||||
<item name="android:colorControlHighlight">@color/selection_color</item>
|
||||
<item name="android:checkedTextViewStyle">@style/Widget.CheckedTextView.Dialog</item>
|
||||
|
||||
<item name="materialAlertDialogTitleTextStyle">@style/Widget.TextView.Dialog.Title</item>
|
||||
<item name="colorBackgroundFloating">@color/background</item>
|
||||
<item name="buttonBarButtonStyle">@style/Widget.Button.Dialog</item>
|
||||
<item name="dialogCornerRadius">0dp</item>
|
||||
<item name="colorControlHighlight">@color/selection_color</item>
|
||||
<item name="alertDialogStyle">@style/MaterialAlertDialog.App</item>
|
||||
|
||||
<item name="buttonBarPositiveButtonStyle">@style/Widget.Button.Dialog</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/Widget.Button.Dialog</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/Widget.Button.Dialog.Neutral</item>
|
||||
</style>
|
||||
|
||||
<!-- Baseline dialog style -->
|
||||
<style name="MaterialAlertDialog.App" parent="MaterialAlertDialog.MaterialComponents">
|
||||
<item name="shapeAppearanceOverlay">@style/ShapeAppearance.Angular</item>
|
||||
</style>
|
||||
|
||||
<!-- Dialog shape with no rounded corners -->
|
||||
<style name="ShapeAppearance.Angular" parent="ShapeAppearance.MaterialComponents.MediumComponent">
|
||||
<item name="cornerFamily">cut</item>
|
||||
<item name="cornerRadius">0dp</item>
|
||||
</style>
|
||||
|
||||
<!-- Custom dialog title theme -->
|
||||
<style name="TextAppearance.Dialog.Title" parent="@android:style/TextAppearance.Material.Title">
|
||||
<style name="Widget.TextView.Dialog.Title" parent="MaterialAlertDialog.MaterialComponents.Title.Text">
|
||||
<item name="android:fontFamily">@font/inter_exbold</item>
|
||||
<item name="android:textSize">@dimen/text_size_toolbar_header</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the checked text view in the custom dialog -->
|
||||
<style name="Widget.CheckedTextView.Dialog" parent="Widget.MaterialComponents.CheckedTextView">
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:background">@null</item>
|
||||
</style>
|
||||
|
||||
<!-- Style for dialog buttons -->
|
||||
<style name="Widget.Button.Dialog" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
|
||||
<item name="android:layout_height">@dimen/height_dialog_button</item>
|
||||
<style name="Widget.Button.Dialog" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:paddingStart">@dimen/padding_mid_small</item>
|
||||
<item name="android:paddingEnd">@dimen/padding_mid_small</item>
|
||||
<item name="android:minWidth">@dimen/width_dialog_button_min</item>
|
||||
<item name="android:textColor">?attr/colorPrimary</item>
|
||||
<item name="android:fontFamily">@font/inter_semibold</item>
|
||||
<item name="android:textAppearance">?android:attr/textAppearanceButton</item>
|
||||
<item name="rippleColor">@color/selection_color</item>
|
||||
<item name="cornerRadius">0dp</item>
|
||||
</style>
|
||||
|
||||
<!-- Custom button style that eliminates the weird margin that the neutral button has -->
|
||||
<style name="Widget.Button.Dialog.Neutral" parent="Widget.Button.Dialog">
|
||||
<item name="android:layout_marginStart">0dp</item>
|
||||
</style>
|
||||
|
||||
<!-- Style for the general item background -->
|
||||
|
@ -179,7 +221,6 @@
|
|||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:focusable">true</item>
|
||||
<item name="android:theme">@style/Theme.MaterialComponents.DayNight</item>
|
||||
<item name="rippleColor">@color/selection_color</item>
|
||||
<item name="fontFamily">@font/inter_semibold</item>
|
||||
<item name="textAllCaps">false</item>
|
||||
|
|
Loading…
Reference in a new issue