From 9da86a4d371dcee651091377afcef5085a5a7ed4 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 16 Mar 2020 22:42:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/TextActionMenu.kt | 8 ++++---- app/src/main/res/layout/popup_action_menu.xml | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt index af3ee3c75..b64ec996d 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt @@ -49,7 +49,7 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac setOnDismissListener { contentView.apply { iv_menu_more.setImageResource(R.drawable.ic_more_vert) - recycler_view_top.gone() + recycler_view_more.gone() adapter.setItems(menu.visibleItems) recycler_view.visible() } @@ -58,6 +58,7 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac private fun initRecyclerView() = with(contentView) { recycler_view.adapter = adapter + recycler_view_more.adapter = adapter SupportMenuInflater(context).inflate(R.menu.content_select_action, menu) adapter.setItems(menu.visibleItems) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -69,13 +70,12 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac iv_menu_more.onClick { if (recycler_view.isVisible) { iv_menu_more.setImageResource(R.drawable.ic_arrow_back) - recycler_view_top.adapter = adapter adapter.setItems(moreMenu.visibleItems) recycler_view.gone() - recycler_view_top.visible() + recycler_view_more.visible() } else { iv_menu_more.setImageResource(R.drawable.ic_more_vert) - recycler_view_top.gone() + recycler_view_more.gone() adapter.setItems(menu.visibleItems) recycler_view.visible() } diff --git a/app/src/main/res/layout/popup_action_menu.xml b/app/src/main/res/layout/popup_action_menu.xml index a708d9310..547d9bce1 100644 --- a/app/src/main/res/layout/popup_action_menu.xml +++ b/app/src/main/res/layout/popup_action_menu.xml @@ -29,18 +29,18 @@ android:visibility="gone" android:contentDescription="@string/more_menu" android:layout_gravity="center_vertical" - app:layout_constraintRight_toRightOf="parent" - app:layout_constraintTop_toBottomOf="@+id/recycler_view_top" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintRight_toRightOf="parent" />