Example #1
0
 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) + "*";
 }
Example #2
0
  @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;
  }