ui: fix button group toolbar
This commit is contained in:
@@ -21,8 +21,8 @@ package org.oxycblt.auxio.list.menu
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.view.SupportMenuInflater
|
||||
import androidx.appcompat.view.menu.MenuBuilder
|
||||
import androidx.core.view.children
|
||||
import androidx.navigation.fragment.findNavController
|
||||
@@ -115,7 +115,7 @@ abstract class MenuDialogFragment<M : Menu> :
|
||||
// Since we don't have (and don't want) a dummy view to inflate this menu, just
|
||||
// depend on the AndroidX Toolbar internal API and hope for the best.
|
||||
@SuppressLint("RestrictedApi") val builder = MenuBuilder(requireContext())
|
||||
MenuInflater(requireContext()).inflate(casted.res, builder)
|
||||
SupportMenuInflater(requireContext()).inflate(casted.res, builder)
|
||||
|
||||
// Disable any menu options as specified by the impl
|
||||
val disabledIds = getDisabledItemIds(casted)
|
||||
|
||||
@@ -23,12 +23,12 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.annotation.AttrRes
|
||||
import androidx.annotation.MenuRes
|
||||
import androidx.appcompat.view.SupportMenuInflater
|
||||
import androidx.appcompat.view.menu.MenuBuilder
|
||||
import androidx.appcompat.view.menu.MenuItemImpl
|
||||
import androidx.appcompat.widget.PopupMenu
|
||||
@@ -114,7 +114,7 @@ constructor(
|
||||
// Since we don't have (and don't want) a dummy view to inflate this menu, just
|
||||
// depend on the AndroidX Toolbar internal API and hope for the best.
|
||||
val builder = MenuBuilder(context)
|
||||
MenuInflater(context).inflate(resId, builder)
|
||||
SupportMenuInflater(context).inflate(resId, builder)
|
||||
menuBuilder = builder
|
||||
|
||||
// Separate action items from overflow items based on showAsAction flags.
|
||||
@@ -142,6 +142,7 @@ constructor(
|
||||
LayoutParams.WRAP_CONTENT,
|
||||
Gravity.END or Gravity.CENTER_VERTICAL,
|
||||
)
|
||||
spacing = 0
|
||||
}
|
||||
|
||||
// Create a MaterialButton for each action item.
|
||||
@@ -170,7 +171,7 @@ constructor(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
)
|
||||
setIconResource(R.drawable.ic_more_24)
|
||||
setIconResource(R.drawable.ic_more_vert_24)
|
||||
contentDescription = context.getString(R.string.lbl_more)
|
||||
setOnClickListener { view ->
|
||||
val customListener = overflowClickListener
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M480,800Q447,800 423.5,776.5Q400,753 400,720Q400,687 423.5,663.5Q447,640 480,640Q513,640 536.5,663.5Q560,687 560,720Q560,753 536.5,776.5Q513,800 480,800ZM480,560Q447,560 423.5,536.5Q400,513 400,480Q400,447 423.5,423.5Q447,400 480,400Q513,400 536.5,423.5Q560,447 560,480Q560,513 536.5,536.5Q513,560 480,560ZM480,320Q447,320 423.5,296.5Q400,273 400,240Q400,207 423.5,183.5Q447,160 480,160Q513,160 536.5,183.5Q560,207 560,240Q560,273 536.5,296.5Q513,320 480,320Z"/>
|
||||
</vector>
|
||||
Reference in New Issue
Block a user