Ejemplo n.º 1
0
 @Override
 public void onClick(View view) {
   if (view.equals(btLoad)) {
     Intent intent = new Intent();
     intent.setType("image/*");
     intent.setAction(Intent.ACTION_PICK);
     String title = getResources().getString(R.string.choose_image);
     Intent chooser = Intent.createChooser(intent, title);
     startActivityForResult(chooser, REQ_PICK_IMAGE);
   } else if (view.equals(btClear)) {
     mvImage.clear();
     mvImage.setErase(false);
   } else if (view.equals(btSave)) {
     boolean succced = mvImage.save();
     String text = "save image " + (succced ? " succeed" : " failed");
     Toast.makeText(view.getContext(), text, Toast.LENGTH_SHORT).show();
   } else if (view.equals(btEffect)) {
     initEffectList();
     effectList.show(btEffect);
   } else if (view.equals(btMode)) {
     initModeList();
     modeList.show(btMode);
   } else if (view.equals(btErase)) {
     mvImage.setErase(true);
   }
 }
Ejemplo n.º 2
0
 private void initModeList() {
   if (modeList != null) {
     return;
   }
   modeList = new PopMenuList(this);
   List<MenuItem> items = new LinkedList<MenuItem>();
   items.add(new MenuItem(null, getResources().getString(R.string.mode_path)));
   items.add(new MenuItem(null, getResources().getString(R.string.mode_grid)));
   modeList.setItems(items);
   modeList.setListMenuListener(ml);
 }
Ejemplo n.º 3
0
 private void initEffectList() {
   if (effectList != null) {
     return;
   }
   effectList = new PopMenuList(this);
   List<MenuItem> items = new LinkedList<MenuItem>();
   items.add(new MenuItem(null, getResources().getString(R.string.effect_grid)));
   items.add(new MenuItem(null, getResources().getString(R.string.effect_blur)));
   items.add(new MenuItem(null, getResources().getString(R.string.effect_color)));
   effectList.setItems(items);
   effectList.setListMenuListener(el);
 }