mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Fixed note saving with FileDescriptor
.
* Now we are using fileDescriptor for custom apps to read zim file from asset folder, so we have improved our notes saving functionality according to this change.
This commit is contained in:
parent
f31535966b
commit
b6d718f287
@ -117,7 +117,7 @@ class AddNoteDialog : DialogFragment() {
|
||||
.inject(this)
|
||||
|
||||
// Returns name of the form ".../Kiwix/granbluefantasy_en_all_all_nopic_2018-10.zim"
|
||||
zimFileName = zimReaderContainer.zimCanonicalPath
|
||||
zimFileName = zimReaderContainer.zimCanonicalPath ?: zimReaderContainer.name
|
||||
if (zimFileName != null) { // No zim file currently opened
|
||||
zimFileTitle = zimReaderContainer.zimFileTitle
|
||||
zimId = zimReaderContainer.id.orEmpty()
|
||||
|
@ -45,8 +45,13 @@ data class ShowOpenNoteDialog(
|
||||
{ effects.offer(OpenPage(page, zimReaderContainer)) },
|
||||
{
|
||||
val item = page as NoteListItem
|
||||
val file = File(item.zimFilePath.orEmpty())
|
||||
zimReaderContainer.setZimFile(file)
|
||||
// Check if zimFilePath is not null, and then set it in zimReaderContainer.
|
||||
// For custom apps, we are currently using fileDescriptor, and they only have a single file in them,
|
||||
// which is already set in zimReaderContainer, so there's no need to set it again.
|
||||
item.zimFilePath?.let {
|
||||
val file = File(it)
|
||||
zimReaderContainer.setZimFile(file)
|
||||
}
|
||||
effects.offer(OpenNote(item.noteFilePath, item.zimUrl, item.title))
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user