We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
可不可以,菜单子项设置 成 不可点击 状态
The text was updated successfully, but these errors were encountered:
可以是可以的。参见我fork后修改的版本: https://github.com/luqiming666/SwipeRecyclerView
我增加了侧滑菜单展开/收起的回调通知:OnItemMenuStateListener,然后在收到菜单展开通知时这么处理:
public void onMenuState(RecyclerView.ViewHolder viewHolder, int menuState) { MainAdapter.ViewHolder vh = (MainAdapter.ViewHolder) viewHolder; if (menuState == OPEN) { vh.setHiddenView(true); // 尝试修改菜单项的状态 SwipeMenuLayout menuLayout = (SwipeMenuLayout) vh.itemView; if (menuLayout.hasRightMenu()) { SwipeMenuView rightMenuView = (SwipeMenuView) menuLayout.getChildAt(2); View view1 = rightMenuView.getChildAt(0); // 第一个menu item view1.setEnabled(false); } Toast.makeText(DefineActivity.this, "菜单已展开,位置:" + viewHolder.getAdapterPosition(), Toast.LENGTH_SHORT).show(); } else { vh.setHiddenView(false); Toast.makeText(DefineActivity.this, "菜单已收起,位置:" + viewHolder.getAdapterPosition(), Toast.LENGTH_SHORT).show(); } }
Sorry, something went wrong.
No branches or pull requests
可不可以,菜单子项设置 成 不可点击 状态
The text was updated successfully, but these errors were encountered: