Remove custom title UIs from dialogs
Replace the custom title TextViews in AccentDialog/BlacklistDialog with the built-in title text.
This commit is contained in:
parent
03aa2d4579
commit
887868ff9c
6 changed files with 23 additions and 56 deletions
|
@ -45,7 +45,6 @@
|
|||
</activity>
|
||||
<service
|
||||
android:name=".playback.system.PlaybackService"
|
||||
android:description="@string/info_service_desc"
|
||||
android:foregroundServiceType="mediaPlayback"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round" />
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.DialogAccentBinding
|
||||
import org.oxycblt.auxio.logD
|
||||
import org.oxycblt.auxio.settings.SettingsManager
|
||||
|
@ -56,6 +57,8 @@ class AccentDialog : LifecycleDialog() {
|
|||
}
|
||||
|
||||
override fun onConfigDialog(builder: AlertDialog.Builder) {
|
||||
builder.setTitle(R.string.setting_accent)
|
||||
|
||||
builder.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||
if (pendingAccent != Accent.get()) {
|
||||
settingsManager.accent = pendingAccent
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.oxycblt.auxio.settings.blacklist
|
||||
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
|
@ -86,14 +85,9 @@ class BlacklistDialog : LifecycleDialog() {
|
|||
return binding.root
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
super.onDismiss(dialog)
|
||||
|
||||
// If we have dismissed the dialog, then just drop any path changes.
|
||||
blacklistModel.loadDatabasePaths()
|
||||
}
|
||||
|
||||
override fun onConfigDialog(builder: AlertDialog.Builder) {
|
||||
builder.setTitle(R.string.setting_content_blacklist)
|
||||
|
||||
// Dont set the click listener here, we do some custom black magic in onCreateView instead.
|
||||
builder.setNeutralButton(R.string.label_add, null)
|
||||
builder.setPositiveButton(R.string.label_save, null)
|
||||
|
@ -101,7 +95,10 @@ class BlacklistDialog : LifecycleDialog() {
|
|||
}
|
||||
|
||||
private fun addDocTreePath(uri: Uri?) {
|
||||
uri ?: return
|
||||
// A null URI means that the user left the file picker without picking a directory
|
||||
if (uri == null) {
|
||||
return
|
||||
}
|
||||
|
||||
val path = parseDocTreePath(uri)
|
||||
|
||||
|
|
|
@ -3,39 +3,17 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/accent_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/background"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/Theme.Neutral">
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="@dimen/margin_medium"
|
||||
android:foregroundGravity="center"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="org.oxycblt.auxio.settings.accent.AutoGridLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@+id/accent_cancel"
|
||||
app:layout_constraintTop_toBottomOf="@+id/accent_header"
|
||||
tools:itemCount="18"
|
||||
tools:listitem="@layout/item_accent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/accent_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/accent_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:foregroundGravity="center"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="org.oxycblt.auxio.settings.accent.AutoGridLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@+id/accent_cancel"
|
||||
app:layout_constraintTop_toBottomOf="@+id/accent_header"
|
||||
tools:itemCount="18"
|
||||
tools:listitem="@layout/item_accent" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
|
@ -9,26 +9,16 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="@color/background"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/margin_medium"
|
||||
android:theme="@style/Theme.Neutral">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/blacklist_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/inter_exbold"
|
||||
android:padding="@dimen/padding_medium"
|
||||
android:text="@string/setting_content_blacklist"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="@dimen/text_size_toolbar_header" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/blacklist_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:overScrollMode="never"
|
||||
android:overScrollMode="always"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/item_blacklist_entry" />
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
<style name="Theme.Base" parent="Theme.Template">
|
||||
<item name="android:windowBackground">@color/background</item>
|
||||
<item name="android:fontFamily">@font/inter</item>
|
||||
<item name="android:textCursorDrawable">@drawable/ui_cursor</item>
|
||||
<item name="android:scrollbars">none</item>
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:textCursorDrawable">@drawable/ui_cursor</item>
|
||||
|
||||
<!-- Interim default values for the accents. -->
|
||||
<item name="colorPrimary">@color/design_default_color_primary</item>
|
||||
|
|
Loading…
Reference in a new issue