-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
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
菜单子项 设置 点击无效 #318
Comments
可以是可以的。参见我fork后修改的版本: 我增加了侧滑菜单展开/收起的回调通知: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();
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可不可以,菜单子项设置 成 不可点击 状态
The text was updated successfully, but these errors were encountered: