Skip to content

Commit 9f6d3e0

Browse files
committed
extract to the function
Signed-off-by: alperozturk <alper_ozturk@proton.me>
1 parent 743dd4c commit 9f6d3e0

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

app/src/main/java/it/niedermann/owncloud/notes/edit/BaseNoteFragment.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,20 +281,21 @@ public boolean onOptionsItemSelected(MenuItem item) {
281281
shareNote();
282282
return false;
283283
} else if (itemId == MENU_ID_PIN) {
284-
return pinNoteToHome();
284+
pinNoteToHome();
285+
return true;
285286
}
286287

287288
return super.onOptionsItemSelected(item);
288289
}
289290

290-
private boolean pinNoteToHome() {
291+
private void pinNoteToHome() {
291292
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
292-
return true;
293+
return;
293294
}
294295

295296
if (!ShortcutManagerCompat.isRequestPinShortcutSupported(requireContext())) {
296297
Log.i(TAG, "RequestPinShortcut is not supported");
297-
return true;
298+
return;
298299
}
299300

300301
final var iconId = note.getFavorite() ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_border_grey_ccc_24dp;
@@ -316,8 +317,6 @@ private boolean pinNoteToHome() {
316317
.getBroadcast(requireContext(), 0, broadcastIntent, intentFlag)
317318
.getIntentSender();
318319
ShortcutManagerCompat.requestPinShortcut(requireContext(), pinShortcutInfo, intentSender);
319-
320-
return true;
321320
}
322321

323322
protected void shareNote() {

0 commit comments

Comments
 (0)