Skip to content

Commit

Permalink
Fix notebook directory not being created, fix NewFileDialog when no l…
Browse files Browse the repository at this point in the history
…ast used type, by @gsantner closes #2360
  • Loading branch information
gsantner committed Jul 22, 2024
1 parent 5de71d5 commit be11d3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ public class MainActivity extends MarkorBaseActivity implements GsFileBrowserFra
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
IS_DEBUG_ENABLED |= BuildConfig.IS_TEST_BUILD;

try {
//noinspection ResultOfMethodCallIgnored
_appSettings.getNotebookDirectory().mkdirs();
} catch (Exception ignored) {
}


_cu = new MarkorContextUtils(this);
setContentView(R.layout.main__activity);
_bottomNav = findViewById(R.id.bottom_navigation_bar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {

// Initial creation - loop through and set type
final int lastUsedType = appSettings.getNewFileDialogLastUsedType();
typeSpinner.setSelection(GsCollectionUtils.indices(formats, f -> f.format == lastUsedType).get(0));
final List<Integer> indices = GsCollectionUtils.indices(formats, f -> f.format == lastUsedType);
typeSpinner.setSelection(indices.isEmpty() ? 0 : indices.get(0));

titleEdit.requestFocus();

Expand Down

0 comments on commit be11d3d

Please sign in to comment.