Skip to content

Commit 28432da

Browse files
committed
fix build
Signed-off-by: alperozturk <[email protected]>
1 parent 2534348 commit 28432da

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -309,21 +309,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
309309
shareNote();
310310
return false;
311311
} else if (itemId == MENU_ID_PIN) {
312-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
313-
final var context = requireContext();
314-
if (ShortcutManagerCompat.isRequestPinShortcutSupported(context)) {
315-
final var pinShortcutInfo = new ShortcutInfoCompat.Builder(context, String.valueOf(note.getId()))
316-
.setShortLabel(note.getTitle())
317-
.setIcon(IconCompat.createWithResource(context.getApplicationContext(), TRUE.equals(note.getFavorite()) ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_grey_ccc_24dp))
318-
.setIntent(new Intent(getActivity(), EditNoteActivity.class).putExtra(EditNoteActivity.PARAM_NOTE_ID, note.getId()).setAction(ACTION_SHORTCUT))
319-
.build();
320-
321-
ShortcutManagerCompat.requestPinShortcut(context, pinShortcutInfo, PendingIntent.getBroadcast(context, 0, ShortcutManagerCompat.createShortcutResultIntent(context, pinShortcutInfo), pendingIntentFlagCompat(0)).getIntentSender());
322-
} else {
323-
Log.i(TAG, "RequestPinShortcut is not supported");
324-
}
325-
}
326-
312+
pinNoteToHome();
327313
return true;
328314
}
329315
return super.onOptionsItemSelected(item);
@@ -339,7 +325,7 @@ private void pinNoteToHome() {
339325
return;
340326
}
341327

342-
final var iconId = note.getFavorite() ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_border_grey_ccc_24dp;
328+
final var iconId = note.getFavorite() ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_grey_ccc_24dp;
343329
final var icon = IconCompat.createWithResource(requireContext().getApplicationContext(), iconId);
344330
final var intent = new Intent(getActivity(), EditNoteActivity.class)
345331
.putExtra(EditNoteActivity.PARAM_NOTE_ID, note.getRemoteId())

0 commit comments

Comments
 (0)