diff --git a/omniNotes/src/main/java/it/feio/android/omninotes/DetailFragment.java b/omniNotes/src/main/java/it/feio/android/omninotes/DetailFragment.java index f5c4b08a6..238ea6741 100644 --- a/omniNotes/src/main/java/it/feio/android/omninotes/DetailFragment.java +++ b/omniNotes/src/main/java/it/feio/android/omninotes/DetailFragment.java @@ -66,6 +66,7 @@ import static java.lang.Long.parseLong; import android.Manifest; +import android.Manifest.permission; import android.annotation.SuppressLint; import android.app.Activity; import android.app.PendingIntent; @@ -109,6 +110,7 @@ import android.widget.CheckBox; import android.widget.ImageView; import android.widget.Toast; +import androidx.activity.result.contract.ActivityResultContracts.RequestPermission; import androidx.core.util.Pair; import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.FragmentTransaction; @@ -126,6 +128,7 @@ import it.feio.android.checklistview.models.ChecklistManager; import it.feio.android.omninotes.async.AttachmentTask; import it.feio.android.omninotes.async.bus.NotesUpdatedEvent; +import it.feio.android.omninotes.async.bus.NotificationsGrantedEvent; import it.feio.android.omninotes.async.bus.PushbulletReplyEvent; import it.feio.android.omninotes.async.bus.SwitchFragmentEvent; import it.feio.android.omninotes.async.notes.NoteProcessorDelete; @@ -1864,6 +1867,11 @@ public void onAnimationEnd(Animation animation) { * Pin note as ongoing notifications */ private void pinNote() { + if (!new NotificationsHelper(getAppContext()).checkNotificationsEnabled(getAppContext())) { + mainActivity.showToast(getText(R.string.denied_notifications_permission), Toast.LENGTH_LONG); + return; + } + PendingIntent notifyIntent = IntentHelper .getNotePendingIntent(getContext(), SnoozeActivity.class, ACTION_PINNED, note); diff --git a/omniNotes/src/main/res/raw/changelog.xml b/omniNotes/src/main/res/raw/changelog.xml index 275b990bd..7941f5c6a 100644 --- a/omniNotes/src/main/res/raw/changelog.xml +++ b/omniNotes/src/main/res/raw/changelog.xml @@ -20,6 +20,8 @@ changeDate="Mar 8, 2024" versionName="6.3.2"> [b]Happy Women Day!![/b] + [i]Improved![/i] When trying to pin a note without notifications permissions enabled a message will be shown + [i]Improved![/i] Updated Gradle build tools to 8.3.0 [u]Fix[/u] Protected notes are no more searchable nor their tags (from content) will appear anywhere content's secrecy (thanks to [a href='https://github.com/XYIheng']Yiheng Xiong[/a])