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" />