Example #1
0
 public void onClick(View v) {
   Editable editor = mStatusText.getText();
   String update = editor.toString();
   if (update.length() != 0) {
     editor.clear();
     Helpers.sendToFeed(getActivity(), StatusObj.from(update), mFeedUri);
   }
   InputMethodManager imm =
       (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
   imm.hideSoftInputFromWindow(mStatusText.getWindowToken(), 0);
 }
Example #2
0
 public void onChange(boolean selfChange) {
   if (mSharePhotos) {
     try {
       Uri photo = getLatestCameraPhoto();
       if (photo == null || photo.equals(mLastShared)) {
         return;
       }
       mLastShared = photo;
       DbObject obj = PictureObj.from(mmContext, photo);
       for (Uri uri : getFeedsWithPresence()) {
         Helpers.sendToFeed(mmContext, obj, uri);
       }
     } catch (IOException e) {
     }
   }
 };
Example #3
0
 @Override
 public void onAct(Context context, DbEntryHandler objType, DbObj obj) {
   DBHelper dbh = DBHelper.getGlobal(context);
   try {
     // TODO: do with content provider... this method ignore the
     // feed uri for now
     long hash = obj.getHash();
     Uri feedUri = obj.getContainingFeed().getUri();
     if (hash == 0) {
       Toast.makeText(context, "Message not yet sent.", Toast.LENGTH_SHORT).show();
       return;
     }
     Helpers.sendToFeeds(context, DeleteObj.TYPE, DeleteObj.json(hash), new Uri[] {feedUri});
     dbh.deleteObjByHash(feedUri, hash);
   } finally {
     dbh.close();
   }
 }