From 782adc9a9fdb514f9e0a3d6fc9648f064bf824a2 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 29 Aug 2020 21:42:05 -0700 Subject: [PATCH] Cleanup some styles --- .../magisk/databinding/DataBindingAdapters.kt | 23 ------------------- .../main/res/drawable-v21/bg_selectable.xml | 10 -------- .../drawable-v21/bg_selectable_borderless.xml | 3 --- app/src/main/res/drawable/bg_selectable.xml | 14 ----------- .../res/drawable/bg_selectable_borderless.xml | 14 ----------- .../main/res/layout/fragment_install_md2.xml | 7 ------ app/src/main/res/values/styles_md2.xml | 17 +++----------- app/src/main/res/values/styles_md2_impl.xml | 16 ------------- 8 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 app/src/main/res/drawable-v21/bg_selectable.xml delete mode 100644 app/src/main/res/drawable-v21/bg_selectable_borderless.xml delete mode 100644 app/src/main/res/drawable/bg_selectable.xml delete mode 100644 app/src/main/res/drawable/bg_selectable_borderless.xml diff --git a/app/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt b/app/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt index 0bb098b3a..84a7de70d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt +++ b/app/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt @@ -255,29 +255,6 @@ fun TextView.setStrikeThroughEnabled(useStrikeThrough: Boolean) { } } -interface OnPopupMenuItemClickListener { - fun onMenuItemClick(itemId: Int) -} - -@BindingAdapter("popupMenu", "popupMenuOnClickListener", requireAll = false) -fun View.setPopupMenu(popupMenu: Int, listener: OnPopupMenuItemClickListener) { - val menu = tag as? PopupMenu ?: let { - val themeWrapper = ContextThemeWrapper(context, R.style.Foundation_PopupMenu) - PopupMenu(themeWrapper, this) - } - tag = menu.apply { - this.menu.clear() - menuInflater.inflate(popupMenu, this.menu) - setOnMenuItemClickListener { - listener.onMenuItemClick(it.itemId) - true - } - } - setOnClickListener { - (tag as PopupMenu).show() - } -} - @BindingAdapter("spanCount") fun RecyclerView.setSpanCount(count: Int) { when (val lama = layoutManager) { diff --git a/app/src/main/res/drawable-v21/bg_selectable.xml b/app/src/main/res/drawable-v21/bg_selectable.xml deleted file mode 100644 index 3fbf0d437..000000000 --- a/app/src/main/res/drawable-v21/bg_selectable.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/bg_selectable_borderless.xml b/app/src/main/res/drawable-v21/bg_selectable_borderless.xml deleted file mode 100644 index 32bb31128..000000000 --- a/app/src/main/res/drawable-v21/bg_selectable_borderless.xml +++ /dev/null @@ -1,3 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_selectable.xml b/app/src/main/res/drawable/bg_selectable.xml deleted file mode 100644 index b626ec142..000000000 --- a/app/src/main/res/drawable/bg_selectable.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/bg_selectable_borderless.xml b/app/src/main/res/drawable/bg_selectable_borderless.xml deleted file mode 100644 index b626ec142..000000000 --- a/app/src/main/res/drawable/bg_selectable_borderless.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_install_md2.xml b/app/src/main/res/layout/fragment_install_md2.xml index 5ff2fda5e..5556bd990 100644 --- a/app/src/main/res/layout/fragment_install_md2.xml +++ b/app/src/main/res/layout/fragment_install_md2.xml @@ -95,7 +95,6 @@ - @@ -24,29 +24,18 @@ - - - - - - - -