Add height for ListPopupWindow
This commit is contained in:
parent
fb7af911e6
commit
46382bf3de
3 changed files with 7 additions and 0 deletions
|
@ -64,6 +64,8 @@
|
|||
<dimen name="title_letter_spacing" format="float">-0.03</dimen>
|
||||
|
||||
<dimen name="bottom_sheet_peek_height">300dp</dimen>
|
||||
|
||||
<dimen name="list_popup_window_height">300dp</dimen>
|
||||
|
||||
<!-- Text sizes -->
|
||||
|
||||
|
|
|
@ -141,6 +141,7 @@ class SettingsDialogFragment : BaseDialogFragment() {
|
|||
isModal = true
|
||||
anchorView = valueView
|
||||
setContentWidth(AndroidUtils.getPopupMenuWidth(ctx, menuList))
|
||||
height = AndroidUtils.getPopupMenuHeight(ctx)
|
||||
setDropDownGravity(Gravity.END or Gravity.TOP)
|
||||
setAdapter(ArrayAdapter(ctx, R.layout.popup_list_text_item, menuList))
|
||||
setOnItemClickListener { _, _, position, _ ->
|
||||
|
|
|
@ -116,6 +116,10 @@ object AndroidUtils {
|
|||
return 0
|
||||
}
|
||||
|
||||
fun getPopupMenuHeight(ctx: Context): Int {
|
||||
return ctx.resources.getDimensionPixelSize(R.dimen.list_popup_window_height)
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
fun getAttrColor(ctx: Context, @AttrRes attrId: Int, @ColorInt defaultColor: Int = 0): Int {
|
||||
val ta = ctx.theme.obtainStyledAttributes(intArrayOf(attrId))
|
||||
|
|
Loading…
Reference in a new issue