Glimpse: Move no permissions message to resources

Also sync it with Aperture.

Change-Id: Id0e2cf1e1183079f93f733c5c2710781872bf905
This commit is contained in:
LuK1337 2023-08-08 15:44:55 +02:00
parent 395b012086
commit a99d51f75c
4 changed files with 6 additions and 3 deletions

View File

@ -60,7 +60,7 @@ class AlbumFragment : Fragment(R.layout.fragment_album), LoaderManager.LoaderCal
if (it.isNotEmpty()) { if (it.isNotEmpty()) {
if (!permissionsUtils.mainPermissionsGranted()) { if (!permissionsUtils.mainPermissionsGranted()) {
Toast.makeText( Toast.makeText(
requireContext(), "No main permissions", Toast.LENGTH_SHORT requireContext(), R.string.app_permissions_toast, Toast.LENGTH_SHORT
).show() ).show()
requireActivity().finish() requireActivity().finish()
} else { } else {

View File

@ -75,7 +75,7 @@ class MediaViewerFragment : Fragment(
if (it.isNotEmpty()) { if (it.isNotEmpty()) {
if (!permissionsUtils.mainPermissionsGranted()) { if (!permissionsUtils.mainPermissionsGranted()) {
Toast.makeText( Toast.makeText(
requireContext(), "No main permissions", Toast.LENGTH_SHORT requireContext(), R.string.app_permissions_toast, Toast.LENGTH_SHORT
).show() ).show()
requireActivity().finish() requireActivity().finish()
} else { } else {

View File

@ -55,7 +55,7 @@ class ReelsFragment : Fragment(R.layout.fragment_reels), LoaderManager.LoaderCal
if (it.isNotEmpty()) { if (it.isNotEmpty()) {
if (!permissionsUtils.mainPermissionsGranted()) { if (!permissionsUtils.mainPermissionsGranted()) {
Toast.makeText( Toast.makeText(
requireContext(), "No main permissions", Toast.LENGTH_SHORT requireContext(), R.string.app_permissions_toast, Toast.LENGTH_SHORT
).show() ).show()
requireActivity().finish() requireActivity().finish()
} else { } else {

View File

@ -6,6 +6,9 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">Gallery</string> <string name="app_name">Gallery</string>
<!-- Toast messages -->
<string name="app_permissions_toast">Permissions not granted by the user.</string>
<!-- Top app bar --> <!-- Top app bar -->
<string name="top_app_bar_edit">Edit</string> <string name="top_app_bar_edit">Edit</string>
<string name="top_app_bar_more">More</string> <string name="top_app_bar_more">More</string>