@Override protected void onResume() { super.onResume(); if (uexImageUtil.getCheckedItems().size() > 0) { btnRightTitle.setText( "完成(" + uexImageUtil.getCheckedItems().size() + "/" + EUEXImageConfig.getInstance().getMaxImageCount() + ")"); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); finder = ResoureFinder.getInstance(this); setContentView(finder.getLayoutId("plugin_uex_image_activity_album_list")); uexImageUtil = UEXImageUtil.getInstance(); ivLeftTitle = (ImageView) findViewById(finder.getId("iv_left_on_title")); btnRightTitle = (Button) findViewById(finder.getId("btn_finish_title")); ivProgressBar = (ImageView) findViewById(finder.getId("iv_progress_bar")); lvAlbumList = (ListView) findViewById(finder.getId("local_album_list")); Animation animation = AnimationUtils.loadAnimation(this, finder.getAnimId("plugin_uex_image_rotate_loading")); ivProgressBar.startAnimation(animation); initData(); ivLeftTitle.setOnClickListener(commonClickListener); btnRightTitle.setOnClickListener(commonClickListener); lvAlbumList.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { Intent intent = new Intent(AlbumListActivity.this, PictureGridActivity.class); intent.putExtra(Constants.EXTRA_FOLDER_PATH, pictureFolders.get(i).getFolderPath()); startActivityForResult(intent, EUExImage.REQUEST_IMAGE_PICKER); } }); }
@Override public void onClick(View v) { if (v.getId() == finder.getId("iv_left_on_title")) { setResult(Constants.OPERATION_CANCELLED, null); finish(); } else if (v.getId() == finder.getId("btn_finish_title")) { // 如果选择的图片小于最小数目,给一个提示 if (uexImageUtil.getCheckedItems().size() < EUEXImageConfig.getInstance().getMinImageCount()) { Toast.makeText( AlbumListActivity.this, String.format( finder.getString("plugin_uex_image_at_least_choose"), EUEXImageConfig.getInstance().getMinImageCount()), Toast.LENGTH_SHORT) .show(); } else { setResult(RESULT_OK, null); finish(); } } }