Skip to content

Commit

Permalink
Update open recent, open dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
billthefarmer committed Nov 27, 2022
1 parent ae83a51 commit 2ea1dbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<activity
android:name="Editor"
android:exported="true"
tools:ignore="UnusedAttribute"
android:documentLaunchMode="always"
android:windowSoftInputMode="stateHidden|adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
19 changes: 8 additions & 11 deletions src/main/java/org/billthefarmer/editor/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -1463,17 +1463,22 @@ private void openRecent(MenuItem item)
{
case DialogInterface.BUTTON_POSITIVE:
saveFile();
readFile(uri);
startActivity(new Intent(Intent.ACTION_EDIT, uri,
this, Editor.class));
break;

case DialogInterface.BUTTON_NEGATIVE:
changed = false;
readFile(uri);
startActivity(new Intent(Intent.ACTION_EDIT, uri,
this, Editor.class));
break;
}
});

else
readFile(uri);
// New instance
startActivity(new Intent(Intent.ACTION_EDIT, uri,
this, Editor.class));
}
}

Expand Down Expand Up @@ -2035,14 +2040,6 @@ private List<File> getList(File dir)
Arrays.sort(files);
// Create a list
list = new ArrayList<File>(Arrays.asList(files));
// Remove hidden files
Iterator<File> iterator = list.iterator();
while (iterator.hasNext())
{
File item = iterator.next();
if (item.getName().startsWith("."))
iterator.remove();
}

// Add parent folder
if (dir.getParentFile() == null)
Expand Down

0 comments on commit 2ea1dbf

Please sign in to comment.