Fix tooltip display bug
Fix a problem where tooltips in dialogs would have a non-transparent background.
This commit is contained in:
parent
2d4ddc0460
commit
64d4b90870
3 changed files with 6 additions and 9 deletions
|
@ -4,7 +4,6 @@ import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
|
||||||
import androidx.navigation.fragment.findNavController
|
import androidx.navigation.fragment.findNavController
|
||||||
import androidx.navigation.fragment.navArgs
|
import androidx.navigation.fragment.navArgs
|
||||||
import org.oxycblt.auxio.detail.adapters.ArtistDetailAdapter
|
import org.oxycblt.auxio.detail.adapters.ArtistDetailAdapter
|
||||||
|
@ -60,18 +59,11 @@ class ArtistDetailFragment : DetailFragment() {
|
||||||
|
|
||||||
// --- UI SETUP ---
|
// --- UI SETUP ---
|
||||||
|
|
||||||
val imgLauncher = registerForActivityResult(ActivityResultContracts.GetContent()) {
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.lifecycleOwner = this
|
binding.lifecycleOwner = this
|
||||||
|
|
||||||
setupToolbar()
|
setupToolbar()
|
||||||
setupRecycler(detailAdapter)
|
setupRecycler(detailAdapter)
|
||||||
|
|
||||||
binding.detailToolbar.setOnClickListener {
|
|
||||||
imgLauncher.launch("image/*")
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- VIEWMODEL SETUP ---
|
// --- VIEWMODEL SETUP ---
|
||||||
|
|
||||||
detailModel.artistSortMode.observe(viewLifecycleOwner) { mode ->
|
detailModel.artistSortMode.observe(viewLifecycleOwner) { mode ->
|
||||||
|
|
|
@ -7,6 +7,8 @@ import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.appcompat.app.AppCompatDialogFragment
|
import androidx.appcompat.app.AppCompatDialogFragment
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
|
import org.oxycblt.auxio.R
|
||||||
|
import org.oxycblt.auxio.ui.toDrawable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper around [DialogFragment] that allows the usage of the standard Auxio lifecycle
|
* A wrapper around [DialogFragment] that allows the usage of the standard Auxio lifecycle
|
||||||
|
@ -16,6 +18,10 @@ abstract class LifecycleDialog : AppCompatDialogFragment() {
|
||||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||||
val builder = MaterialAlertDialogBuilder(requireActivity(), theme)
|
val builder = MaterialAlertDialogBuilder(requireActivity(), theme)
|
||||||
|
|
||||||
|
// Setting the background in XML will also apply it to the tooltip for some inane reason
|
||||||
|
// so we have to do it programmatically instead.
|
||||||
|
builder.background = R.color.background.toDrawable(requireContext())
|
||||||
|
|
||||||
onConfigDialog(builder)
|
onConfigDialog(builder)
|
||||||
|
|
||||||
return builder.create()
|
return builder.create()
|
||||||
|
|
|
@ -93,7 +93,6 @@
|
||||||
|
|
||||||
<!-- Custom Dialog EntryNames -->
|
<!-- Custom Dialog EntryNames -->
|
||||||
<style name="Theme.CustomDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
|
<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:colorControlHighlight">@color/selection_color</item>
|
||||||
<item name="android:checkedTextViewStyle">@style/Widget.CheckedTextView.Dialog</item>
|
<item name="android:checkedTextViewStyle">@style/Widget.CheckedTextView.Dialog</item>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue