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>
|
</activity>
|
||||||
<service
|
<service
|
||||||
android:name=".playback.system.PlaybackService"
|
android:name=".playback.system.PlaybackService"
|
||||||
android:description="@string/info_service_desc"
|
|
||||||
android:foregroundServiceType="mediaPlayback"
|
android:foregroundServiceType="mediaPlayback"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round" />
|
android:roundIcon="@mipmap/ic_launcher_round" />
|
||||||
|
|
|
@ -5,6 +5,7 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import org.oxycblt.auxio.R
|
||||||
import org.oxycblt.auxio.databinding.DialogAccentBinding
|
import org.oxycblt.auxio.databinding.DialogAccentBinding
|
||||||
import org.oxycblt.auxio.logD
|
import org.oxycblt.auxio.logD
|
||||||
import org.oxycblt.auxio.settings.SettingsManager
|
import org.oxycblt.auxio.settings.SettingsManager
|
||||||
|
@ -56,6 +57,8 @@ class AccentDialog : LifecycleDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onConfigDialog(builder: AlertDialog.Builder) {
|
override fun onConfigDialog(builder: AlertDialog.Builder) {
|
||||||
|
builder.setTitle(R.string.setting_accent)
|
||||||
|
|
||||||
builder.setPositiveButton(android.R.string.ok) { _, _ ->
|
builder.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||||
if (pendingAccent != Accent.get()) {
|
if (pendingAccent != Accent.get()) {
|
||||||
settingsManager.accent = pendingAccent
|
settingsManager.accent = pendingAccent
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.oxycblt.auxio.settings.blacklist
|
package org.oxycblt.auxio.settings.blacklist
|
||||||
|
|
||||||
import android.content.DialogInterface
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
@ -86,14 +85,9 @@ class BlacklistDialog : LifecycleDialog() {
|
||||||
return binding.root
|
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) {
|
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.
|
// Dont set the click listener here, we do some custom black magic in onCreateView instead.
|
||||||
builder.setNeutralButton(R.string.label_add, null)
|
builder.setNeutralButton(R.string.label_add, null)
|
||||||
builder.setPositiveButton(R.string.label_save, null)
|
builder.setPositiveButton(R.string.label_save, null)
|
||||||
|
@ -101,7 +95,10 @@ class BlacklistDialog : LifecycleDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addDocTreePath(uri: Uri?) {
|
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)
|
val path = parseDocTreePath(uri)
|
||||||
|
|
||||||
|
|
|
@ -3,32 +3,11 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@color/background"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:theme="@style/Theme.Neutral">
|
|
||||||
|
|
||||||
<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
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/accent_recycler"
|
android:id="@+id/accent_recycler"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:paddingTop="@dimen/margin_medium"
|
||||||
android:foregroundGravity="center"
|
android:foregroundGravity="center"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
app:layoutManager="org.oxycblt.auxio.settings.accent.AutoGridLayoutManager"
|
app:layoutManager="org.oxycblt.auxio.settings.accent.AutoGridLayoutManager"
|
||||||
|
@ -37,5 +16,4 @@
|
||||||
tools:itemCount="18"
|
tools:itemCount="18"
|
||||||
tools:listitem="@layout/item_accent" />
|
tools:listitem="@layout/item_accent" />
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</layout>
|
</layout>
|
|
@ -9,26 +9,16 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/background"
|
android:background="@color/background"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="@dimen/margin_medium"
|
||||||
android:theme="@style/Theme.Neutral">
|
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
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/blacklist_recycler"
|
android:id="@+id/blacklist_recycler"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="always"
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
tools:itemCount="1"
|
tools:itemCount="1"
|
||||||
tools:listitem="@layout/item_blacklist_entry" />
|
tools:listitem="@layout/item_blacklist_entry" />
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
<style name="Theme.Base" parent="Theme.Template">
|
<style name="Theme.Base" parent="Theme.Template">
|
||||||
<item name="android:windowBackground">@color/background</item>
|
<item name="android:windowBackground">@color/background</item>
|
||||||
<item name="android:fontFamily">@font/inter</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:scrollbars">none</item>
|
||||||
<item name="android:windowIsFloating">false</item>
|
<item name="android:windowIsFloating">false</item>
|
||||||
|
<item name="android:textCursorDrawable">@drawable/ui_cursor</item>
|
||||||
|
|
||||||
<!-- Interim default values for the accents. -->
|
<!-- Interim default values for the accents. -->
|
||||||
<item name="colorPrimary">@color/design_default_color_primary</item>
|
<item name="colorPrimary">@color/design_default_color_primary</item>
|
||||||
|
|
Loading…
Reference in a new issue