Skip to content

Commit 86b2440

Browse files
committed
Add favorite file option Info dialog, closes #2086, by @gsantner
1 parent 93da8e0 commit 86b2440

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app/src/main/java/net/gsantner/markor/frontend/FileInfoDialog.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ private AlertDialog.Builder setUpDialog(final File file, LayoutInflater inflater
123123
checkHideInRecents.setChecked(appSettings.listFileInRecents(file));
124124
checkHideInRecents.setOnCheckedChangeListener((buttonView, isChecked) -> appSettings.setListFileInRecents(file, isChecked));
125125

126+
127+
CheckBox checkFavorite = root.findViewById(R.id.ui__fileinfodialog__favorite);
128+
checkFavorite.setChecked(appSettings.getFavouriteFiles().contains(file));
129+
checkFavorite.setOnCheckedChangeListener((buttonView, isChecked) -> appSettings.toggleFavouriteFile(file));
130+
126131
return dialogBuilder;
127132
}
128133

app/src/main/res/layout/file_info_dialog.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@
202202
android:layout_gravity="center_vertical"
203203
android:text="@string/list_in_recent_files" />
204204

205+
<CheckBox
206+
android:id="@+id/ui__fileinfodialog__favorite"
207+
android:layout_width="wrap_content"
208+
android:layout_height="48dp"
209+
android:text="@string/favourite" />
210+
205211
<TextView
206212
android:layout_width="wrap_content"
207213
android:layout_height="wrap_content"

0 commit comments

Comments
 (0)