示例#1
0
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   Tag t = tagManager.get(position);
   if (tags.contains(t)) tags.remove(t);
   else tags.add(t);
   Log.d(TAG, "Click: " + tags.size());
   tagsChanged(true);
 }
示例#2
0
 @Override
 public boolean onTouch(View view, MotionEvent event) {
   if (view.getId() == R.id.tag_cloud_view) {
     Log.d(TAG, "onTouch");
     float x = event.getX();
     float y = event.getY();
     Tag t = tagCloud.findTagAt(x, y);
     if (t != null) {
       if (tags.contains(t)) tags.remove(t);
       else tags.add(t);
       tagsChanged(true);
     }
   }
   return false;
 }