private String getPostButtonText() { if (!postButton.isEnabled()) { return res.getString(R.string.log_post_not_possible); } if (typeSelected != LogType.FOUND_IT || !Settings.isGCvoteLogin() || !cache.supportsGCVote()) { return res.getString(R.string.log_post); } if (rating == 0) { return res.getString(R.string.log_post_no_rate); } return res.getString(R.string.log_post_rate) + " " + ratingTextValue(rating) + "*"; }
@Override public boolean onPrepareOptionsMenu(Menu menu) { final boolean signatureAvailable = Settings.getSignature() != null; menu.findItem(MENU_SIGNATURE).setVisible(signatureAvailable); final boolean voteAvailable = Settings.isGCvoteLogin() && typeSelected == LogType.LOG_FOUND_IT && StringUtils.isNotBlank(cache.getGuid()); menu.findItem(SUBMENU_VOTE).setVisible(voteAvailable); return true; }
@Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); final boolean voteAvailable = Settings.isGCvoteLogin() && (typeSelected == LogType.FOUND_IT || typeSelected == LogType.ATTENDED || typeSelected == LogType.WEBCAM_PHOTO_TAKEN) && StringUtils.isNotBlank(cache.getGuid()) && cache.supportsGCVote(); menu.findItem(SUBMENU_VOTE).setVisible(voteAvailable); return true; }
private void updatePostButtonText() { if (postButton.isEnabled()) { if (typeSelected == LogType.LOG_FOUND_IT && Settings.isGCvoteLogin()) { if (rating == 0) { postButton.setText(res.getString(R.string.log_post_no_rate)); } else { postButton.setText( res.getString(R.string.log_post_rate) + " " + ratingTextValue(rating) + "*"); } } else { postButton.setText(res.getString(R.string.log_post)); } } else { postButton.setText(res.getString(R.string.log_post_not_possible)); } }
public StatusCode postLogFn(String log) { try { final StatusCode status = cgBase.postLog( geocode, cacheid, viewstates, typeSelected, date.get(Calendar.YEAR), (date.get(Calendar.MONTH) + 1), date.get(Calendar.DATE), log, trackables); if (status == StatusCode.NO_ERROR) { final cgLog logNow = new cgLog(); logNow.author = Settings.getUsername(); logNow.date = date.getTimeInMillis(); logNow.type = typeSelected; logNow.log = log; if (cache != null) { cache.prependLog(logNow); } app.addLog(geocode, logNow); if (typeSelected == LogType.LOG_FOUND_IT) { app.markFound(geocode); if (cache != null) { cache.setFound(true); } } if (cache != null) { app.saveCache(cache, EnumSet.of(SaveFlag.SAVE_CACHE)); } else { app.removeCache(geocode, EnumSet.of(RemoveFlag.REMOVE_CACHE)); } } if (status == StatusCode.NO_ERROR) { app.clearLogOffline(geocode); } if (status == StatusCode.NO_ERROR && typeSelected == LogType.LOG_FOUND_IT && Settings.isUseTwitter() && Settings.isTwitterLoginValid() && tweetCheck.isChecked() && tweetBox.getVisibility() == View.VISIBLE) { Twitter.postTweetCache(geocode); } if (status == StatusCode.NO_ERROR && typeSelected == LogType.LOG_FOUND_IT && Settings.isGCvoteLogin()) { GCVote.setRating(cache, rating); } return status; } catch (Exception e) { Log.e("cgeovisit.postLogFn: " + e.toString()); } return StatusCode.LOG_POST_ERROR; }