@Override public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int position, long arg3) { // TODO Auto-generated method stub initTileBar(true); mAdapter.setMultiChoiseMode(true); mAdapter.notifyDataSetChanged(); return true; }
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if (mAdapter != null && mAdapter.getMultiChoiseMode()) { mAdapter.setMultiChoiseMode(false); initTileBar(false); mAdapter.clearSelect(); mAdapter.notifyDataSetChanged(); return true; } } return super.onKeyDown(keyCode, event); }
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == 0 && intent != null && intent.getBooleanExtra("refresh", false)) { LoadVideoAsyncTask task = new LoadVideoAsyncTask(); task.execute(0); mAdapter.notifyDataSetChanged(); } };
@Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.btn_hide: // 确定按钮的事件 mAdapter.getSelectData(); break; case R.id.btn_select_all: if (mSelectAllBtn.getText().equals("全选")) { mSelectAllBtn.setText("全不选"); mAdapter.selectAll(); } else { mSelectAllBtn.setText("全选"); mAdapter.clearSelect(); } mAdapter.notifyDataSetChanged(); break; } }
private void initViews() { initTitleView(); // mHideBtn.setOnClickListener(this); mSelectAllBtn.setOnClickListener(this); mShowHideBtn.setOnClickListener(this); // mCenterTitleText.setText("视频"); mGridView = (GridView) findViewById(R.id.video_gridview); mGridView.setVisibility(View.VISIBLE); mGridView.setOnItemLongClickListener(this); mGridView.setOnItemClickListener(this); mAdapter = new VideoPageAdapter(mContext, mVideoBeans); mGridView.setAdapter(mAdapter); mAdapter.setCallback(this); initTileBar(false); }