Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Aug 25, 2024
1 parent 4631024 commit 1ca5698
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1016,4 +1016,4 @@ public static void baseConf(Activity activity, DialogOptions dopt) {
dopt.highlightColor = ContextCompat.getColor(activity, R.color.accent);
dopt.dialogStyle = R.style.Theme_AppCompat_DayNight_Dialog_Rounded;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private TextViewUtils() {

public static int getLineStart(final CharSequence s, final int sel) {
int i = sel;
if (GsTextUtils.isValidIndex(s, i)) {
if (GsTextUtils.isValidSelection(s, i)) {
for (; i > 0; i--) {
if (s.charAt(i - 1) == '\n') {
break;
Expand All @@ -63,7 +63,7 @@ public static int getLineStart(final CharSequence s, final int sel) {

public static int getLineEnd(final CharSequence s, final int sel) {
int i = sel;
if (GsTextUtils.isValidIndex(s, i)) {
if (GsTextUtils.isValidSelection(s, i)) {
for (; i < s.length(); i++) {
if (s.charAt(i) == '\n') {
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ public static void showMultiChoiceDialogWithSearchFilterUI(final Activity activi
} else {
win.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
win.setDecorFitsSystemWindows(true);
}
}

win.setLayout(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,7 @@ public boolean onOptionsItemSelected(final MenuItem item) {
if (confirmed) {
Runnable deleter = () -> {
WrMarkorSingleton.getInstance().deleteSelectedItems(currentSelection, getContext());
_recyclerList.post(() -> {
_filesystemViewerAdapter.reloadCurrentFolder();
});
_recyclerList.post(() -> _filesystemViewerAdapter.reloadCurrentFolder());
};
new Thread(deleter).start();
}
Expand Down Expand Up @@ -551,13 +549,13 @@ public void clearSelection() {
///////////////
public void askForDeletingFilesRecursive(WrConfirmDialog.ConfirmDialogCallback confirmCallback) {
final ArrayList<File> itemsToDelete = new ArrayList<>(_filesystemViewerAdapter.getCurrentSelection());
StringBuilder message = new StringBuilder(String.format(getString(R.string.do_you_really_want_to_delete_this_witharg), getResources().getQuantityString(R.plurals.documents, itemsToDelete.size())) + "\n\n");
final StringBuilder message = new StringBuilder(String.format(getString(R.string.do_you_really_want_to_delete_this_witharg), getResources().getQuantityString(R.plurals.documents, itemsToDelete.size())) + "\n\n");

for (File f : itemsToDelete) {
message.append("\n").append(f.getAbsolutePath());
for (final File f : itemsToDelete) {
message.append("\n").append(f.getName());
}

WrConfirmDialog confirmDialog = WrConfirmDialog.newInstance(getString(R.string.confirm_delete), message.toString(), itemsToDelete, confirmCallback);
final WrConfirmDialog confirmDialog = WrConfirmDialog.newInstance(getString(R.string.confirm_delete), message.toString(), itemsToDelete, confirmCallback);
confirmDialog.show(getChildFragmentManager(), WrConfirmDialog.FRAGMENT_TAG);
}

Expand Down

0 comments on commit 1ca5698

Please sign in to comment.