Skip to content
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

关于单选点击取消设置不生效的问题 #3

Open
ghost opened this issue May 8, 2017 · 3 comments
Open

关于单选点击取消设置不生效的问题 #3

ghost opened this issue May 8, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented May 8, 2017

ItemClickListener中,设置当前单选点击不生效,修改如下
if (entity.getStatus()==0){
entity.setStatus(1);//添加已经选择的对象
currentAdapter.setCurrentSelectedItem(entity);
}else if(entity.getStatus()==1){
mUiData.getSelectedEntities().remove(currentAdapter.getCurrentSelectedItem());
entity.setStatus(0);
}

@FeiMAndroid
Copy link

应该这么写吧

@FeiMAndroid
Copy link

if (entity.getStatus() == 0) {//未选中->选中
entity.setStatus(1);
//添加已经选择的对象
currentAdapter.setCurrentSelectedItem(entity);
} else if (entity.getStatus() == 1) {//选中->未选中
entity.setStatus(0);
//移除已经选择的对象
currentAdapter.setCurrentSelectedItem(null);
}

@yangxz95
Copy link

    //屏蔽不可点击
    if (currentAdapter.getAttributeMembersEntities().get(position).getStatus() == 2) {
        return;
    }
    //再次点击已经选中的
    if (currentAdapter.getAttributeMembersEntities().get(position).getStatus() == 1) {
        currentAdapter.setCurrentSelectedItem(null);
        mUiData.getSelectedEntities().remove(currentAdapter.getAttributeMembersEntities().get(position));
    } else {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants