示例#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 onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
   if (parent == tagList.getAdapterView()) {
     Log.d(TAG, "Long click: " + tags.size());
     tag = tagManager.get(position);
     showDialog(DIALOG_EDIT_TAG);
     return true;
   }
   return false;
 }
示例#3
0
 @Override
 protected void onResume() {
   super.onResume();
   Book book = Bookshelf.getCurrentBook();
   tagManager = book.getTagManager();
   tagManager.sort();
   tags = Bookshelf.getCurrentBook().currentPage().tags;
   tagList.setTagSet(tags);
   tagCloud.setTagSet(tags);
   updateStatusBar();
 }
示例#4
0
 public boolean onKey(View v, int keyCode, KeyEvent event) {
   // If the event is a key-down event on the "enter" button
   Log.v(TAG, "onKey " + keyCode);
   EditText text = (EditText) v;
   if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
     Tag t = tagManager.newTag(text.getText().toString());
     tags.add(t);
     tagsChanged(false);
     return true;
   }
   return false;
 }