private void addAdapterListeners() { adapter.setListViewModeListener( new ListViewModeListener() { @Override public void onModeChanged(boolean mode) { if (mode == MODE_VIEW) { exitDeleteMode(); mViewDeleteContact.setVisibility(View.VISIBLE); } else { enterDeleteMode(); mViewDeleteContact.setVisibility(View.GONE); } } }); adapter.setOnCheckedItemChangedListener( new OnCheckedItemChangedListener() { @Override public void onCheckedItemChanged(int checked) { if (adapter.isDeleteMode()) { /* * View view = getView(); TextView tv_title = (TextView) * view.findViewById(R.id.contact_tv_title); * tv_title.setText("删除已选("+checked+")"); */ if (checked <= 0) { mTextView.setEnabled(false); } else { mTextView.setEnabled(true); } } } }); }
public synchronized void notifyData() { list = ZyContactApp.getInstance().getGlobalContactList(); if (list == null) return; adapter.setContactList(list); isContactChanged = false; }
@OnClick(R.id.tv_hintdeletecontact) public void actionEnterDeleteMode(View mView) { adapter.requestEnterDeleteMode(); }