Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void setItemChecked(int position, boolean value)
- public boolean performItemClick(View view, int position, long id)
- public class CustomGridView extends GridView {
- public CustomGridView(Context context) {
- super(context);
- }
- @Override
- public void setItemChecked(int position, boolean value) {
- Log.i(BuildConfig.LOGTAG, "CustomGridView:setItemChecked");
- super.setItemChecked(position, value);
- }
- @Override
- public boolean performItemClick(View view, int position, long id) {
- Log.i(BuildConfig.LOGTAG, "CustomGridView:performItemClick");
- return super.performItemClick(view, position, id);
- }
- }
- protected class ActionBarCallback implements GridView.MultiChoiceModeListener {
- @Override
- public void onItemCheckedStateChanged(ActionMode actionMode, int position, long id, boolean checked) {
- if (checked) {
- mAdapter.addPosition(position, true);
- mAdapter.addId(id, true);
- } else {
- mAdapter.removePosition(position);
- mAdapter.removeId(id);
- }
- int selectCount = mGridView.getCheckedItemCount();
- String title = getResources().getQuantityString(R.plurals.pictures_selected, selectCount, selectCount);
- actionMode.setTitle(title);
- }
- @Override
- public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
- MenuInflater inflater = actionMode.getMenuInflater();
- inflater.inflate( R.menu.picture_context, menu);
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement