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.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.fragment.navArgs
|
||||
import org.oxycblt.auxio.detail.adapters.ArtistDetailAdapter
|
||||
|
@ -60,18 +59,11 @@ class ArtistDetailFragment : DetailFragment() {
|
|||
|
||||
// --- UI SETUP ---
|
||||
|
||||
val imgLauncher = registerForActivityResult(ActivityResultContracts.GetContent()) {
|
||||
}
|
||||
|
||||
binding.lifecycleOwner = this
|
||||
|
||||
setupToolbar()
|
||||
setupRecycler(detailAdapter)
|
||||
|
||||
binding.detailToolbar.setOnClickListener {
|
||||
imgLauncher.launch("image/*")
|
||||
}
|
||||
|
||||
// --- VIEWMODEL SETUP ---
|
||||
|
||||
detailModel.artistSortMode.observe(viewLifecycleOwner) { mode ->
|
||||
|
|
|
@ -7,6 +7,8 @@ import androidx.appcompat.app.AlertDialog
|
|||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import androidx.fragment.app.DialogFragment
|
||||
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
|
||||
|
@ -16,6 +18,10 @@ abstract class LifecycleDialog : AppCompatDialogFragment() {
|
|||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
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)
|
||||
|
||||
return builder.create()
|
||||
|
|
|
@ -93,7 +93,6 @@
|
|||
|
||||
<!-- Custom Dialog EntryNames -->
|
||||
<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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue