Swipe menu for recyclerView. Android 侧滑菜单,可轻松定制各种样式的菜单。
当布局切换成 `RTL` 以后,LEFT 和 RIGHT 会调换位置,所以在布局上已经没什么问题,但实际上此时 rightMenu 在左侧,leftMenu在右侧,故:openXXXMenu() 和 closeXXXMenu() 操作的是相反的 menu, 只需要添加一行判断,如果是 `RTL` 布局就判断 activeMenu 是否是相反的 menu 即可 ```kotlin private val isRtl by lazy { TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_RTL } ``` ```kotlin fun openLeftMenu(animate: Boolean = true) { activeMenu = if(isRtl) rightMenu else leftMenu openActiveMenu(animate) } ``` 同理: ```kotlin fun isLeftMenuOpened(): Boolean { val activeMenu = activeMenu ?: return false return activeMenu == (if(isRtl) rightMenu else leftMenu) && openState and FLAG_IS_OPENED == FLAG_IS_OPENED } fun isRightMenuOpened(): Boolean { val activeMenu = activeMenu ?: return false return activeMenu == (if(isRtl) leftMenu else rightMenu) && openState and FLAG_IS_OPENED == FLAG_IS_OPENED } ```
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by kakarrot and has received 4 comments.