private Uri photoUri() { if (photoHelper.photoExistsLocally(currentNote)) { File file = new File(currentNote.getPhotoPath()); return Uri.fromFile(file); } else { return Uri.parse(currentNote.getPhotoPath()); } }
public void noteClicked(int index) { int total = sessionManager.getNoteCount(); if (total == 0) return; index = ((index % total) + total) % total; currentNote = sessionManager.getNote(index); showNoteViewer(); String title = FormatHelper.dateTime(currentNote.getDate()).toString(); noteDate.setText(title); noteText.setText(currentNote.getText()); noteNumber.setText(numberFormat.format(index + 1) + "/" + numberFormat.format(total)); viewPhoto.setVisibility(photoHelper.photoExists(currentNote) ? View.VISIBLE : View.GONE); noteIndex = index; noteTotal = total; }