Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions app/src/main/java/com/akapps/dailynote/activity/CategoryScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private void initializeLayout() {
pinned.setText(pinned.getText());

if (editingRegularNote) {
title.setText("Current:\n" + getSelectedNotes().get(0).getCategory());
title.setText(getString(R.string.msg_current_category, getSelectedNotes().get(0).getCategory()));
if (getSelectedNotes().get(0).getCategory().equals("none"))
unselectCategories.setVisibility(View.GONE);

Expand All @@ -222,14 +222,14 @@ private void initializeLayout() {
noCategoryNotesSize += uncategorizedNotes.size();
allSelected += getSelectedNotes().size();

showAllNotes.setText("All Notes");
showAllNotes.setText(getString(R.string.all_notes));

noCategory.setText("Folderless Notes");
noCategory.setText(getString(R.string.msg_folderless_notes));

if (allSelected == 0)
unselectCategories.setVisibility(View.GONE);
else
title.setText(allSelected + " Selected");
title.setText(getString(R.string.msg_n_selected, allSelected));

// make padding shorter since there isn't a folder opened
title.setPadding(0, 20, 0, 0);
Expand All @@ -241,9 +241,9 @@ private void initializeLayout() {
trash.setVisibility(View.GONE);
archived.setVisibility(View.VISIBLE);
unpinned.setVisibility(View.VISIBLE);
showAllNotes.setText("Archive");
noCategory.setText("Un-Archive");
archived.setText("Pin");
showAllNotes.setText(getString(R.string.msg_archive));
noCategory.setText(getString(R.string.msg_unarchive));
archived.setText(getString(R.string.msg_pin));
archived.setTextColor(textColor);
showAllNotes.setTextColor(textColor);
noCategory.setTextColor(textColor);
Expand Down Expand Up @@ -401,8 +401,8 @@ public void onItemRangeRemoved(int positionStart, int itemCount) {
selections.setVisibility(View.GONE);
edit.setVisibility(View.GONE);
titleBefore = title.getText().toString();
title.setText("Editing");
Helper.showMessage(this, "Editing", "Click on item to edit", MotionToast.TOAST_SUCCESS);
title.setText(getString(R.string.msg_editing));
Helper.showMessage(this, getString(R.string.msg_editing), getString(R.string.msg_click_item_to_edit), MotionToast.TOAST_SUCCESS);
info.setImageDrawable(getDrawable(R.drawable.cancel));
});

Expand Down Expand Up @@ -537,17 +537,15 @@ public void lockFolder(int folderId, int pin, String securityWord, boolean finge
// user is locking folder for the first time
RealmHelper.lockNotesInsideFolder(this, context, folderId);
categoriesAdapter.notifyDataSetChanged();
Helper.showMessage(this, "Folder Locked", "Folder and notes inside have been " +
"locked", MotionToast.TOAST_SUCCESS);
Helper.showMessage(this, getString(R.string.msg_folder_locked), getString(R.string.msg_folder_and_notes_locked), MotionToast.TOAST_SUCCESS);
}

private void showErrorMessage() {
Helper.showMessage(this, "Select Folder", "You need to select a folder" +
" to put all the notes you selected", MotionToast.TOAST_ERROR);
Helper.showMessage(this, getString(R.string.msg_select_folder), getString(R.string.msg_need_select_folder), MotionToast.TOAST_ERROR);
}

private void showEmptyMessage() {
Helper.showMessage(this, "Empty", "Cannot open empty folder", MotionToast.TOAST_ERROR);
Helper.showMessage(this, getString(R.string.msg_empty), getString(R.string.msg_cannot_open_empty_folder), MotionToast.TOAST_ERROR);
}

private void checkEmpty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ private void unLockApp() {
RealmHelper.getUser(this, "home").setSecurityWord("");
RealmHelper.getUser(this, "home").setFingerprint(false);
RealmSingleton.get(this).commitTransaction();
Helper.showMessage(this, "App un-Locked", "App lock has " +
"been removed", MotionToast.TOAST_SUCCESS);
Helper.showMessage(this, getString(R.string.msg_app_unlocked), getString(R.string.msg_app_lock_removed), MotionToast.TOAST_SUCCESS);
}

@Override
Expand Down
195 changes: 93 additions & 102 deletions app/src/main/java/com/akapps/dailynote/activity/NoteEdit.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationRes
@Override
public void onAuthenticationFailed() {
super.onAuthenticationFailed();
Helper.showMessage(NoteLockScreen.this, "Fingerprint Error",
"Fingerprint not read, try again!",
Helper.showMessage(NoteLockScreen.this, getString(R.string.msg_fingerprint_error),
getString(R.string.msg_fingerprint_not_read),
MotionToast.TOAST_ERROR);
}
});
Expand Down Expand Up @@ -206,8 +206,8 @@ private void forgotPasswordDialog() {
// shows fingerprint dialog for user to use fingerprint
private void fingerprintDialog() {
promptInfo = new BiometricPrompt.PromptInfo.Builder()
.setTitle("Biometric login for note")
.setNegativeButtonText("Use pin instead")
.setTitle(getString(R.string.msg_biometric_login_note))
.setNegativeButtonText(getString(R.string.msg_use_pin_instead))
.build();
biometricPrompt.authenticate(promptInfo);
}
Expand Down
33 changes: 15 additions & 18 deletions app/src/main/java/com/akapps/dailynote/activity/SettingsScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private void initializeLayout() {
if (mAuth.getCurrentUser() != null) {
if (mAuth.getCurrentUser().isEmailVerified()) {
signUp.setVisibility(View.GONE);
logIn.setText("Log Out");
logIn.setText(getString(R.string.msg_log_out));
syncLayout.setVisibility(View.VISIBLE);
accountInfo.setVisibility(View.VISIBLE);
accountInfo.setText(mAuth.getCurrentUser().getEmail());
Expand Down Expand Up @@ -448,7 +448,7 @@ private void initializeButtonListeners() {

addButtonShortcut.setOnClickListener(view -> {
List<IconPowerMenuItem> options = new ArrayList<>();
options.add(new IconPowerMenuItem(null, "Note + Checklist (Default)"));
options.add(new IconPowerMenuItem(null, getString(R.string.msg_note_checklist_default)));
options.add(new IconPowerMenuItem(null, "Note"));
options.add(new IconPowerMenuItem(null, "Checklist"));
isEditingButtonShortcut = true;
Expand Down Expand Up @@ -561,7 +561,7 @@ else if (checkedId == R.id.light_mode)
InfoSheet info = new InfoSheet(1, unUsedFiles);
info.show(getSupportFragmentManager(), info.getTag());
} else {
Helper.showMessage(this, "No Broken Links Found", "No further action needed", MotionToast.TOAST_SUCCESS);
Helper.showMessage(this, getString(R.string.msg_no_broken_links), getString(R.string.msg_no_further_action), MotionToast.TOAST_SUCCESS);
}
});

Expand Down Expand Up @@ -861,8 +861,8 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
if (grantResults[0] == PackageManager.PERMISSION_GRANTED)
continueWithBackup();
else
Helper.showMessage(this, "Permission Denied",
"Permission [Required] to Backup + Restore", MotionToast.TOAST_ERROR);
Helper.showMessage(this, getString(R.string.msg_permission_denied),
getString(R.string.msg_permission_required_backup_restore), MotionToast.TOAST_ERROR);
}
}

Expand All @@ -872,8 +872,7 @@ public void lockApp(int pin, String securityWord, boolean fingerprint) {
getUser().setSecurityWord(securityWord);
getUser().setFingerprint(fingerprint);
RealmSingleton.get(this).commitTransaction();
Helper.showMessage(this, "App Locked", "App has been " +
"locked", MotionToast.TOAST_SUCCESS);
Helper.showMessage(this, getString(R.string.msg_app_locked), getString(R.string.msg_app_has_been_locked), MotionToast.TOAST_SUCCESS);
lockApp.setImageDrawable(getDrawable(R.drawable.lock_icon));
lockApp.setColorFilter(UiHelper.getColorFromTheme(this, R.attr.primaryIconTintColor));
}
Expand All @@ -884,8 +883,7 @@ public void unLockNote() {
getUser().setSecurityWord("");
getUser().setFingerprint(false);
RealmSingleton.get(this).commitTransaction();
Helper.showMessage(this, "App un-Locked", "App has been " +
"un-locked", MotionToast.TOAST_SUCCESS);
Helper.showMessage(this, getString(R.string.msg_app_unlocked), getString(R.string.msg_app_lock_removed), MotionToast.TOAST_SUCCESS);
lockApp.setImageDrawable(getDrawable(R.drawable.unlock_icon));
lockApp.setColorFilter(UiHelper.getColorFromTheme(this, R.attr.primaryIconTintColor));
}
Expand All @@ -905,12 +903,11 @@ private void backUpDataAndImages() {
if (backupPath != null) {
backupHelper.shareFile(new File(backupPath));
} else {
Helper.showMessage(this, "Backup Failed", "Could not create backup file.", MotionToast.TOAST_ERROR);
Helper.showMessage(this, getString(R.string.msg_backup_failed), getString(R.string.msg_could_not_create_backup), MotionToast.TOAST_ERROR);
}
}
} else
Helper.showMessage(this, "Backup Failed", "\uD83D\uDE10No " +
"data to backup\uD83D\uDE10", MotionToast.TOAST_ERROR);
Helper.showMessage(this, getString(R.string.msg_backup_failed), getString(R.string.msg_no_data_to_backup), MotionToast.TOAST_ERROR);
}

private void showBackupRestoreInfo(int selection) {
Expand Down Expand Up @@ -942,20 +939,20 @@ public void onActivityResult(int requestCode, int resultCode, @Nullable Intent d
try {
List<String> missingFiles = FileHelper.zip(context, getAllAppFiles, data.getData());
if (missingFiles.isEmpty()) {
Helper.showMessage(this, "Backup", "" +
"All your notes and associated files successfully backed up!", MotionToast.TOAST_SUCCESS);
Helper.showMessage(this, getString(R.string.backup),
getString(R.string.msg_backup_success), MotionToast.TOAST_SUCCESS);
} else {
StringBuilder missingFilesString = new StringBuilder();
for (int i = 0; i < missingFiles.size(); i++) {
missingFilesString.append(i + 1).append(". ").append(missingFiles.get(i)).append("\n");
}
String message = "Backup completed with warnings. The following " + missingFiles.size() + " files were not found and were skipped:\n\n" + missingFilesString.toString();
GenericInfoSheet infoSheet = new GenericInfoSheet("Backup Warning", message, "OK", 2);
String message = getString(R.string.msg_backup_completed_warnings, missingFiles.size(), missingFilesString.toString());
GenericInfoSheet infoSheet = new GenericInfoSheet(getString(R.string.msg_backup_warning), message, getString(R.string.ok), 2);
infoSheet.show(getSupportFragmentManager(), infoSheet.getTag());
}
} catch (IOException e) {
Log.e("SettingsScreen", "Error backing up notes", e);
Helper.showMessage(this, "Backup Failed", "Error: " + e.getMessage(), MotionToast.TOAST_ERROR);
Helper.showMessage(this, getString(R.string.msg_backup_failed), getString(R.string.msg_error_prefix, e.getMessage()), MotionToast.TOAST_ERROR);
}
}
}
Expand Down Expand Up @@ -1063,7 +1060,7 @@ private String getAddButtonActionText(int id) {
} else if (id == 2) {
return "Checklist";
}
return "Note + Checklist";
return getString(R.string.msg_note_checklist);
}

private void updateSelectedLines(int position) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public RemoteViews getViewAt(int position) {
remoteView.setViewVisibility(R.id.sublist_spacing, View.GONE);

if (currentItem.contains("♬")) {
currentItem = currentItem.equals("♬") ? "[Audio]" : currentItem.replace("♬", "");
currentItem = currentItem.equals("♬") ? getString(R.string.msg_audio_placeholder) : currentItem.replace("♬", "");
remoteView.setViewVisibility(R.id.widget_check_status, View.GONE);
remoteView.setViewVisibility(R.id.audio, View.VISIBLE);
} else {
Expand All @@ -109,7 +109,7 @@ public RemoteViews getViewAt(int position) {
}

String checklistItemText = currentItem.replace("~~", "").replace("-Note-", "");
checklistItemText += checklistItemText.isEmpty() ? "[Audio]" : "";
checklistItemText += checklistItemText.isEmpty() ? getString(R.string.msg_audio_placeholder) : "";

remoteView.setTextViewText(R.id.checklist_text, Html.fromHtml(checklistItemText, Html.FROM_HTML_MODE_COMPACT));
remoteView.setTextViewTextSize(R.id.checklist_text, COMPLEX_UNIT_SP, textSize);
Expand Down
Loading