Skip to content

Commit

Permalink
remember format per template
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Oct 14, 2024
1 parent b409b66 commit 900b987
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ private AlertDialog makeDialog(final File basedir, final boolean allowCreateDir,
templateAdapter.addAll(GsCollectionUtils.map(templates, p -> p.first));
templateSpinner.setAdapter(templateAdapter);

templateSpinner.setOnItemSelectedListener(new GsAndroidSpinnerOnItemSelectedAdapter(pos -> {
final String template = templateAdapter.getItem(pos);
final String fmt = appSettings.getTemplateTitleFormat(template);
formatEdit.setText(fmt);
}));

// Setup type / format spinner and action
// -----------------------------------------------------------------------------------------
final ArrayAdapter<String> typeAdapter = new ArrayAdapter<>(activity, android.R.layout.simple_spinner_dropdown_item);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/new_file_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
android:text="@string/template"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

<Spinner
<view class="net.gsantner.markor.frontend.NewFileDialog$ReselectSpinner"
android:id="@+id/new_file_dialog__template"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down

0 comments on commit 900b987

Please sign in to comment.