Improved the message of Warning dialog to show user where they can verify the ZIM chunks are copied/moved properly.

This commit is contained in:
MohitMaliFtechiz 2025-01-09 18:54:28 +05:30 committed by Kelson
parent c69efb1523
commit 4fe022c6a2
3 changed files with 3 additions and 27 deletions

View File

@ -44,7 +44,6 @@ import androidx.appcompat.widget.Toolbar
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import androidx.core.net.toUri
import androidx.core.view.MenuHost
import androidx.core.view.MenuProvider
@ -709,28 +708,6 @@ class LocalLibraryFragment : BaseFragment(), CopyMoveFileHandler.FileCopyMoveCal
}
private fun showWarningDialogForSplittedZimFile() {
dialogShower.show(
KiwixDialog.ShowWarningAboutSplittedZimFile,
::openCopiedMovedDirectory
)
}
private fun openCopiedMovedDirectory() {
val downloadedDirectoryPath = FileProvider.getUriForFile(
requireActivity(),
requireActivity().applicationContext.packageName + ".fileprovider",
File(sharedPreferenceUtil.prefStorage)
)
val intent = Intent(Intent.ACTION_VIEW).apply {
setDataAndType(downloadedDirectoryPath, "*/*")
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
try {
requireActivity().startActivity(intent)
} catch (ignore: Exception) {
// TODO change the message
activity.toast(org.kiwix.kiwixmobile.core.R.string.no_reader_application_installed)
}
dialogShower.show(KiwixDialog.ShowWarningAboutSplittedZimFile)
}
}

View File

@ -121,8 +121,8 @@ sealed class KiwixDialog(
data object ShowWarningAboutSplittedZimFile : KiwixDialog(
R.string.verify_zim_chunk_dialog_title,
R.string.verify_zim_chunks_dialog_message,
R.string.view,
android.R.string.ok,
null,
cancelable = false
)

View File

@ -335,8 +335,7 @@
<string name="copy_move_files_dialog_description">Kiwix requires the ZIM file to be in its own data directory. Do you want to copy or move it there?</string>
<string name="copy_file_error_message">Error in copying the ZIM file: %s.</string>
<string name="verify_zim_chunk_dialog_title">Be cautious: Ensure all ZIM chunks have been properly moved/copied!</string>
<string name="verify_zim_chunks_dialog_message">You can verify them by clicking the “View” button. Once done, refresh the library screen by swiping down. The split ZIM file will then appear in your library.</string>
<string name="view">View</string>
<string name="verify_zim_chunks_dialog_message">You can verify them inside “Android/media/org.kiwix…/” folder.\nOnce done, refresh the library screen by swiping down. The split ZIM file will then appear in your library.</string>
<string name="why_copy_move_files_to_app_directory">Why copy/move files to app public directory?</string>
<string name="copy_move_files_to_app_directory_description">Due to Google Play policies on Android 11 and above, our app can no longer directly access files stored elsewhere on your device. To let you view your selected files, we need to move or copy them into a special folder within our application directory. This allows us to access and open the files.</string>
<string name="choose_storage_to_copy_move_zim_file">Choose storage to copy/move ZIM file</string>