diff --git a/CHANGELOG b/CHANGELOG index 119e0125e..c66373510 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,15 @@ +3.3.2 +NEW: Better flow for hosting books +NEW: Control text zoom for zim files +NEW: Bookmarks/History internals rewrite +NEW: Updated translations +BUGFIX: Search results were inaccurate when typing too quickly +BUGFIX: new zim scheme for addressing content +BUGFIX: Native memory leaks fixed +BUGFIX: fix crash on returning to webview from search result +BUGFIX: some zim files could not be found after downloading ++ Lots More + 3.3.1 NEW: Send Diagnostic Reports BUGFIX: Loading older zim files could fail diff --git a/app/build.gradle.kts b/app/build.gradle.kts index db68557da..715f08481 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -12,7 +12,7 @@ apply(from = rootProject.file("jacoco.gradle")) ext { set("versionMajor", 3) set("versionMinor", 3) - set("versionPatch", 1) + set("versionPatch", 3) } fun generateVersionName() = "${ext["versionMajor"]}.${ext["versionMinor"]}.${ext["versionPatch"]}" diff --git a/app/detekt_baseline.xml b/app/detekt_baseline.xml index cbf158908..f8790219c 100644 --- a/app/detekt_baseline.xml +++ b/app/detekt_baseline.xml @@ -8,6 +8,7 @@ ForbiddenComment:KiwixReaderFragment.kt$KiwixReaderFragment$// TODO: Show to user ForbiddenComment:ReaderFragment.kt$ReaderFragment$// TODO: Show to user LongParameterList:ZimManageViewModel.kt$ZimManageViewModel$( booksOnFileSystem: List<BookOnDisk>, activeDownloads: List<DownloadModel>, allLanguages: List<Language>, libraryNetworkEntity: LibraryNetworkEntity, filter: String, fileSystemState: FileSystemState ) + LongParameterList:ZimManageViewModel.kt$ZimManageViewModel$( private val downloadDao: FetchDownloadDao, private val bookDao: NewBookDao, private val languageDao: NewLanguagesDao, private val storageObserver: StorageObserver, private val kiwixService: KiwixService, private val context: Application, private val connectivityBroadcastReceiver: ConnectivityBroadcastReceiver, private val bookUtils: BookUtils, private val fat32Checker: Fat32Checker, private val defaultLanguageProvider: DefaultLanguageProvider, private val dataSource: DataSource ) MagicNumber:LibraryListItem.kt$LibraryListItem.LibraryDownloadItem$1000L MagicNumber:ShareFiles.kt$ShareFiles$24 MagicNumber:ZimManageViewModel.kt$ZimManageViewModel$5 diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index de3e9fa56..d0297337d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -16,7 +16,7 @@ dependencies { implementation("com.hiya:jacoco-android:0.2") implementation("org.jlleitschuh.gradle:ktlint-gradle:9.2.1") implementation("com.google.apis:google-api-services-androidpublisher:v3-rev129-1.25.0") - implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.5.1") + implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.9.1") implementation(gradleApi()) implementation(localGroovy()) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index ec208dca8..a45edb67e 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -11,13 +11,13 @@ import org.gradle.plugin.use.PluginDependencySpec * YOU are responsible for updating manually the dependency version. */ object Versions { - const val androidx_test_espresso: String = "3.1.1" // available: "3.2.0" + const val androidx_test_espresso: String = "3.2.0" const val com_squareup_retrofit2: String = "2.5.0" // available: "2.9.0" const val org_jetbrains_kotlin: String = "1.3.72" - const val com_google_dagger: String = "2.26" // available: "2.28" + const val com_google_dagger: String = "2.26" // available: "2.28.1" const val com_yahoo_squidb: String = "2.0.0" // available: "3.2.3" @@ -25,11 +25,11 @@ object Versions { const val androidx_test: String = "1.2.0" - const val io_objectbox: String = "2.3.4" // available: "2.6.0" + const val io_objectbox: String = "2.6.0" const val org_jacoco: String = "0.7.9" - const val io_mockk: String = "1.9.2" // available: "1.10.0" + const val io_mockk: String = "1.10.0" const val android_arch_lifecycle_extensions: String = "1.1.1" @@ -37,17 +37,17 @@ object Versions { const val de_fayard_buildsrcversions_gradle_plugin: String = "0.7.0" - const val com_github_triplet_play_gradle_plugin: String = "2.6.2" // available: "2.8.0" + const val com_github_triplet_play_gradle_plugin: String = "2.8.0" const val multidex_instrumentation: String = "2.0.0" const val javax_annotation_api: String = "1.3.2" - const val logging_interceptor: String = "3.12.1" // available: "4.7.2" + const val logging_interceptor: String = "3.6.0" // available: "4.7.2" const val ink_page_indicator: String = "1.3.0" - const val leakcanary_android: String = "2.2" // available: "2.3" + const val leakcanary_android: String = "2.4" const val constraintlayout: String = "1.1.3" @@ -55,23 +55,23 @@ object Versions { const val preference_ktx: String = "1.1.1" - const val junit_jupiter: String = "5.4.2" // available: "5.6.2" + const val junit_jupiter: String = "5.6.2" const val mockwebserver: String = "3.6.0" // available: "4.7.2" const val xfetch2okhttp: String = "3.1.4" - const val assertj_core: String = "3.11.1" // available: "3.16.1" + const val assertj_core: String = "3.16.1" const val core_testing: String = "2.1.0" - const val fragment_ktx: String = "1.2.1" // available: "1.2.4" + const val fragment_ktx: String = "1.2.5" const val lint_gradle: String = "27.0.0" - const val testing_ktx: String = "1.1.1" // available: "1.1.2" + const val testing_ktx: String = "1.1.2" - const val threetenabp: String = "1.1.1" // available: "1.2.4" + const val threetenabp: String = "1.2.4" const val uiautomator: String = "2.2.0" @@ -81,13 +81,13 @@ object Versions { const val appcompat: String = "1.1.0" - const val rxandroid: String = "2.1.0" // available: "2.1.1" + const val rxandroid: String = "2.1.1" - const val core_ktx: String = "1.2.0" // available: "1.3.0" + const val core_ktx: String = "1.3.0" - const val kiwixlib: String = "9.1.2" + const val kiwixlib: String = "9.2.3" - const val material: String = "1.1.0-beta02" // available: "1.1.0" + const val material: String = "1.1.0" const val multidex: String = "2.0.1" @@ -97,11 +97,11 @@ object Versions { const val jsr305: String = "3.0.2" - const val ktlint: String = "0.36.0" // available: "0.37.1" + const val ktlint: String = "0.36.0" // available: "0.37.2" - const val okhttp: String = "3.12.1" // available: "4.7.2" + const val okhttp: String = "3.6.0" // available: "4.7.2" - const val rxjava: String = "2.2.5" // available: "2.2.19" + const val rxjava: String = "2.2.19" const val aapt2: String = "4.0.0-6051327" @@ -110,11 +110,11 @@ object Versions { const val navigation: String = "2.3.0" /** - * Current version: "5.6.1" + * Current version: "6.1.1" * See issue 19: How to update Gradle itself? * https://github.com/jmfayard/buildSrcVersions/issues/19 */ - const val gradleLatestVersion: String = "6.5" + const val gradleLatestVersion: String = "6.5.1" } /** diff --git a/core/detekt_baseline.xml b/core/detekt_baseline.xml index b277f6610..a3499b20b 100644 --- a/core/detekt_baseline.xml +++ b/core/detekt_baseline.xml @@ -5,7 +5,10 @@ EmptyFunctionBlock:BooksOnDiskViewHolder.kt$BookOnDiskViewHolder.BookViewHolder${ } EmptyFunctionBlock:FetchDownloadMonitor.kt$FetchDownloadMonitor.<no name provided>${} ForbiddenComment:JNIInitialiser.kt$JNIInitialiser$// TODO: Consider surfacing to user + LongParameterList:KiwixDialog.kt$KiwixDialog$( val title: Int?, val message: Int?, val positiveMessage: Int, val negativeMessage: Int?, val cancelable: Boolean = true, val icon: Int? = null, val neutralMessage: Int? = null, val getView: (() -> View)? = null ) + LongParameterList:MainMenu.kt$MainMenu$( private val activity: Activity, zimFileReader: ZimFileReader?, menu: Menu, webViews: MutableList<KiwixWebView>, urlIsValid: Boolean, disableReadAloud: Boolean = false, disableTabs: Boolean = false, private val menuClickListener: MenuClickListener ) LongParameterList:MainMenu.kt$MainMenu.Factory$( menu: Menu, webViews: MutableList<KiwixWebView>, urlIsValid: Boolean, menuClickListener: MenuClickListener, disableReadAloud: Boolean, disableTabs: Boolean ) + LongParameterList:Repository.kt$Repository$( @param:IO private val io: Scheduler, @param:MainThread private val mainThread: Scheduler, private val bookDao: NewBookDao, private val bookmarksDao: NewBookmarksDao, private val historyDao: HistoryDao, private val languageDao: NewLanguagesDao, private val recentSearchDao: NewRecentSearchDao, private val zimReaderContainer: ZimReaderContainer ) MagicNumber:ArticleCount.kt$ArticleCount$1000.0 MagicNumber:ArticleCount.kt$ArticleCount$3 MagicNumber:CoreSplashActivity.kt$CoreSplashActivity$10 diff --git a/core/objectbox-models/default.json b/core/objectbox-models/default.json index 5d2e402e8..b1fa17d21 100644 --- a/core/objectbox-models/default.json +++ b/core/objectbox-models/default.json @@ -10,67 +10,84 @@ "properties": [ { "id": "1:4248832782795400383", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:2644395282642821815", - "name": "file" + "name": "file", + "type": 9 }, { "id": "4:3145196313443812205", - "name": "bookId" + "name": "bookId", + "type": 9 }, { "id": "5:597997298666253723", - "name": "title" + "name": "title", + "type": 9 }, { "id": "6:8028706022307902131", - "name": "description" + "name": "description", + "type": 9 }, { "id": "7:4257578632233656657", - "name": "language" + "name": "language", + "type": 9 }, { "id": "8:7771231471515752814", - "name": "creator" + "name": "creator", + "type": 9 }, { "id": "9:892859866782486178", - "name": "publisher" + "name": "publisher", + "type": 9 }, { "id": "10:1925365063061602631", - "name": "date" + "name": "date", + "type": 9 }, { "id": "11:1111395522977944209", - "name": "url" + "name": "url", + "type": 9 }, { "id": "12:3765116904492031525", - "name": "articleCount" + "name": "articleCount", + "type": 9 }, { "id": "13:5901922417972273396", - "name": "mediaCount" + "name": "mediaCount", + "type": 9 }, { "id": "14:1229023184984372602", - "name": "size" + "name": "size", + "type": 9 }, { "id": "15:6851856791814492874", - "name": "name" + "name": "name", + "type": 9 }, { "id": "16:6142333908132117423", - "name": "favIcon" + "name": "favIcon", + "type": 9 }, { "id": "17:2701677664876214591", - "name": "tags" + "name": "tags", + "type": 9 } ], "relations": [] @@ -82,19 +99,26 @@ "properties": [ { "id": "1:7795244654012809404", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:9116495537035444904", - "name": "locale" + "name": "locale", + "type": 9 }, { "id": "3:452531964346972307", - "name": "active" + "name": "active", + "type": 1, + "flags": 4 }, { "id": "4:8812214350305159407", - "name": "occurencesOfLanguage" + "name": "occurencesOfLanguage", + "type": 5, + "flags": 4 } ], "relations": [] @@ -106,39 +130,50 @@ "properties": [ { "id": "1:4390013783965661495", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:6814436941523306636", - "name": "zimId" + "name": "zimId", + "type": 9 }, { "id": "3:3445023139891930306", - "name": "zimName" + "name": "zimName", + "type": 9 }, { "id": "4:1707638909668210783", - "name": "zimFilePath" + "name": "zimFilePath", + "type": 9 }, { "id": "5:7291321834337975178", - "name": "favicon" + "name": "favicon", + "type": 9 }, { "id": "6:8790316103579116510", - "name": "historyUrl" + "name": "historyUrl", + "type": 9 }, { "id": "7:6718164131929659510", - "name": "historyTitle" + "name": "historyTitle", + "type": 9 }, { "id": "9:6094002746638656105", - "name": "timeStamp" + "name": "timeStamp", + "type": 6, + "flags": 4 }, { "id": "10:8395372122440621469", - "name": "dateString" + "name": "dateString", + "type": 9 } ], "relations": [] @@ -150,31 +185,39 @@ "properties": [ { "id": "1:6627309171741917147", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:6862771806221961183", - "name": "zimId" + "name": "zimId", + "type": 9 }, { "id": "3:4312769031500860715", - "name": "zimName" + "name": "zimName", + "type": 9 }, { "id": "4:8187716343071473669", - "name": "zimFilePath" + "name": "zimFilePath", + "type": 9 }, { "id": "5:5652763871458286201", - "name": "bookmarkUrl" + "name": "bookmarkUrl", + "type": 9 }, { "id": "6:4537799665712767375", - "name": "bookmarkTitle" + "name": "bookmarkTitle", + "type": 9 }, { "id": "7:3805929017981932900", - "name": "favicon" + "name": "favicon", + "type": 9 } ], "relations": [] @@ -186,15 +229,19 @@ "properties": [ { "id": "1:7759655437795315973", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:3924214186055484853", - "name": "searchTerm" + "name": "searchTerm", + "type": 9 }, { "id": "3:3320858395373055542", - "name": "zimId" + "name": "zimId", + "type": 9 } ], "relations": [] @@ -206,95 +253,126 @@ "properties": [ { "id": "1:7366957113003324901", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "3:3174500111130052488", - "name": "bookId" + "name": "bookId", + "type": 9 }, { "id": "4:3949362784963767166", - "name": "title" + "name": "title", + "type": 9 }, { "id": "5:812546090900770347", - "name": "description" + "name": "description", + "type": 9 }, { "id": "6:3129463483413863468", - "name": "language" + "name": "language", + "type": 9 }, { "id": "7:3402286918039853548", - "name": "creator" + "name": "creator", + "type": 9 }, { "id": "8:4732753967507809221", - "name": "publisher" + "name": "publisher", + "type": 9 }, { "id": "9:3239042532048399134", - "name": "date" + "name": "date", + "type": 9 }, { "id": "10:1136584919149973914", - "name": "url" + "name": "url", + "type": 9 }, { "id": "11:4252749008345744598", - "name": "articleCount" + "name": "articleCount", + "type": 9 }, { "id": "12:8625493380854102341", - "name": "mediaCount" + "name": "mediaCount", + "type": 9 }, { "id": "13:2787210837560254021", - "name": "size" + "name": "size", + "type": 9 }, { "id": "14:2052022387195277817", - "name": "name" + "name": "name", + "type": 9 }, { "id": "15:1976493094677983679", - "name": "favIcon" + "name": "favIcon", + "type": 9 }, { "id": "16:217454020763036675", - "name": "etaInMilliSeconds" + "name": "etaInMilliSeconds", + "type": 6, + "flags": 4 }, { "id": "17:1136630637198901642", - "name": "bytesDownloaded" + "name": "bytesDownloaded", + "type": 6, + "flags": 4 }, { "id": "18:8939019296899137627", - "name": "totalSizeOfDownload" + "name": "totalSizeOfDownload", + "type": 6, + "flags": 4 }, { "id": "19:3378789699620971394", - "name": "status" + "name": "status", + "type": 5, + "flags": 2 }, { "id": "20:6867355950440828062", - "name": "error" + "name": "error", + "type": 5, + "flags": 2 }, { "id": "21:5555873126720275555", - "name": "file" + "name": "file", + "type": 9 }, { "id": "22:2724607601244650879", - "name": "downloadId" + "name": "downloadId", + "type": 6, + "flags": 4 }, { "id": "23:5485468735259326535", - "name": "progress" + "name": "progress", + "type": 5, + "flags": 4 }, { "id": "24:4272820830206771469", - "name": "tags" + "name": "tags", + "type": 9 } ], "relations": [] @@ -304,8 +382,8 @@ "lastIndexId": "4:4868787482832538530", "lastRelationId": "0:0", "lastSequenceId": "0:0", - "modelVersion": 4, - "modelVersionParserMinimum": 4, + "modelVersion": 5, + "modelVersionParserMinimum": 5, "retiredEntityUids": [ 349148274283701276, 7257718270326155947 diff --git a/core/objectbox-models/default.json.bak b/core/objectbox-models/default.json.bak index 5d2e402e8..b1fa17d21 100644 --- a/core/objectbox-models/default.json.bak +++ b/core/objectbox-models/default.json.bak @@ -10,67 +10,84 @@ "properties": [ { "id": "1:4248832782795400383", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:2644395282642821815", - "name": "file" + "name": "file", + "type": 9 }, { "id": "4:3145196313443812205", - "name": "bookId" + "name": "bookId", + "type": 9 }, { "id": "5:597997298666253723", - "name": "title" + "name": "title", + "type": 9 }, { "id": "6:8028706022307902131", - "name": "description" + "name": "description", + "type": 9 }, { "id": "7:4257578632233656657", - "name": "language" + "name": "language", + "type": 9 }, { "id": "8:7771231471515752814", - "name": "creator" + "name": "creator", + "type": 9 }, { "id": "9:892859866782486178", - "name": "publisher" + "name": "publisher", + "type": 9 }, { "id": "10:1925365063061602631", - "name": "date" + "name": "date", + "type": 9 }, { "id": "11:1111395522977944209", - "name": "url" + "name": "url", + "type": 9 }, { "id": "12:3765116904492031525", - "name": "articleCount" + "name": "articleCount", + "type": 9 }, { "id": "13:5901922417972273396", - "name": "mediaCount" + "name": "mediaCount", + "type": 9 }, { "id": "14:1229023184984372602", - "name": "size" + "name": "size", + "type": 9 }, { "id": "15:6851856791814492874", - "name": "name" + "name": "name", + "type": 9 }, { "id": "16:6142333908132117423", - "name": "favIcon" + "name": "favIcon", + "type": 9 }, { "id": "17:2701677664876214591", - "name": "tags" + "name": "tags", + "type": 9 } ], "relations": [] @@ -82,19 +99,26 @@ "properties": [ { "id": "1:7795244654012809404", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:9116495537035444904", - "name": "locale" + "name": "locale", + "type": 9 }, { "id": "3:452531964346972307", - "name": "active" + "name": "active", + "type": 1, + "flags": 4 }, { "id": "4:8812214350305159407", - "name": "occurencesOfLanguage" + "name": "occurencesOfLanguage", + "type": 5, + "flags": 4 } ], "relations": [] @@ -106,39 +130,50 @@ "properties": [ { "id": "1:4390013783965661495", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:6814436941523306636", - "name": "zimId" + "name": "zimId", + "type": 9 }, { "id": "3:3445023139891930306", - "name": "zimName" + "name": "zimName", + "type": 9 }, { "id": "4:1707638909668210783", - "name": "zimFilePath" + "name": "zimFilePath", + "type": 9 }, { "id": "5:7291321834337975178", - "name": "favicon" + "name": "favicon", + "type": 9 }, { "id": "6:8790316103579116510", - "name": "historyUrl" + "name": "historyUrl", + "type": 9 }, { "id": "7:6718164131929659510", - "name": "historyTitle" + "name": "historyTitle", + "type": 9 }, { "id": "9:6094002746638656105", - "name": "timeStamp" + "name": "timeStamp", + "type": 6, + "flags": 4 }, { "id": "10:8395372122440621469", - "name": "dateString" + "name": "dateString", + "type": 9 } ], "relations": [] @@ -150,31 +185,39 @@ "properties": [ { "id": "1:6627309171741917147", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:6862771806221961183", - "name": "zimId" + "name": "zimId", + "type": 9 }, { "id": "3:4312769031500860715", - "name": "zimName" + "name": "zimName", + "type": 9 }, { "id": "4:8187716343071473669", - "name": "zimFilePath" + "name": "zimFilePath", + "type": 9 }, { "id": "5:5652763871458286201", - "name": "bookmarkUrl" + "name": "bookmarkUrl", + "type": 9 }, { "id": "6:4537799665712767375", - "name": "bookmarkTitle" + "name": "bookmarkTitle", + "type": 9 }, { "id": "7:3805929017981932900", - "name": "favicon" + "name": "favicon", + "type": 9 } ], "relations": [] @@ -186,15 +229,19 @@ "properties": [ { "id": "1:7759655437795315973", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "2:3924214186055484853", - "name": "searchTerm" + "name": "searchTerm", + "type": 9 }, { "id": "3:3320858395373055542", - "name": "zimId" + "name": "zimId", + "type": 9 } ], "relations": [] @@ -206,95 +253,126 @@ "properties": [ { "id": "1:7366957113003324901", - "name": "id" + "name": "id", + "type": 6, + "flags": 1 }, { "id": "3:3174500111130052488", - "name": "bookId" + "name": "bookId", + "type": 9 }, { "id": "4:3949362784963767166", - "name": "title" + "name": "title", + "type": 9 }, { "id": "5:812546090900770347", - "name": "description" + "name": "description", + "type": 9 }, { "id": "6:3129463483413863468", - "name": "language" + "name": "language", + "type": 9 }, { "id": "7:3402286918039853548", - "name": "creator" + "name": "creator", + "type": 9 }, { "id": "8:4732753967507809221", - "name": "publisher" + "name": "publisher", + "type": 9 }, { "id": "9:3239042532048399134", - "name": "date" + "name": "date", + "type": 9 }, { "id": "10:1136584919149973914", - "name": "url" + "name": "url", + "type": 9 }, { "id": "11:4252749008345744598", - "name": "articleCount" + "name": "articleCount", + "type": 9 }, { "id": "12:8625493380854102341", - "name": "mediaCount" + "name": "mediaCount", + "type": 9 }, { "id": "13:2787210837560254021", - "name": "size" + "name": "size", + "type": 9 }, { "id": "14:2052022387195277817", - "name": "name" + "name": "name", + "type": 9 }, { "id": "15:1976493094677983679", - "name": "favIcon" + "name": "favIcon", + "type": 9 }, { "id": "16:217454020763036675", - "name": "etaInMilliSeconds" + "name": "etaInMilliSeconds", + "type": 6, + "flags": 4 }, { "id": "17:1136630637198901642", - "name": "bytesDownloaded" + "name": "bytesDownloaded", + "type": 6, + "flags": 4 }, { "id": "18:8939019296899137627", - "name": "totalSizeOfDownload" + "name": "totalSizeOfDownload", + "type": 6, + "flags": 4 }, { "id": "19:3378789699620971394", - "name": "status" + "name": "status", + "type": 5, + "flags": 2 }, { "id": "20:6867355950440828062", - "name": "error" + "name": "error", + "type": 5, + "flags": 2 }, { "id": "21:5555873126720275555", - "name": "file" + "name": "file", + "type": 9 }, { "id": "22:2724607601244650879", - "name": "downloadId" + "name": "downloadId", + "type": 6, + "flags": 4 }, { "id": "23:5485468735259326535", - "name": "progress" + "name": "progress", + "type": 5, + "flags": 4 }, { "id": "24:4272820830206771469", - "name": "tags" + "name": "tags", + "type": 9 } ], "relations": [] @@ -304,8 +382,8 @@ "lastIndexId": "4:4868787482832538530", "lastRelationId": "0:0", "lastSequenceId": "0:0", - "modelVersion": 4, - "modelVersionParserMinimum": 4, + "modelVersion": 5, + "modelVersionParserMinimum": 5, "retiredEntityUids": [ 349148274283701276, 7257718270326155947 diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.java index de81cf353..cc40a9175 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.java @@ -434,12 +434,12 @@ public abstract class CoreReaderFragment extends BaseFragment ButterKnife.bind(this, root); return root; } - //End of onCreate private void handleIntentExtras(Intent intent) { if (intent.hasExtra(TAG_FILE_SEARCHED)) { - searchForTitle(intent.getStringExtra(TAG_FILE_SEARCHED), mainMenu.isInTabSwitcher()); + searchForTitle(intent.getStringExtra(TAG_FILE_SEARCHED), + isInTabSwitcher()); selectTab(webViewList.size() - 1); } if (intent.hasExtra(EXTRA_CHOSE_X_URL)) { @@ -453,6 +453,10 @@ public abstract class CoreReaderFragment extends BaseFragment handleNotificationIntent(intent); } + private boolean isInTabSwitcher() { + return mainMenu != null && mainMenu.isInTabSwitcher(); + } + private void handleNotificationIntent(Intent intent) { if (intent.hasExtra(DOWNLOAD_NOTIFICATION_TITLE)) { new Handler().postDelayed(() -> { @@ -470,21 +474,23 @@ public abstract class CoreReaderFragment extends BaseFragment documentParser = new DocumentParser(new DocumentParser.SectionsListener() { @Override public void sectionsLoaded(String title, List sections) { - for (TableDrawerAdapter.DocumentSection section : sections) { - if (section.title.contains("REPLACE_")) { - section.title = - getResourceString(activity.getBaseContext(), section.title); + if (isAdded()) { + for (TableDrawerAdapter.DocumentSection section : sections) { + if (section.title.contains("REPLACE_")) { + section.title = + getResourceString(activity.getBaseContext(), section.title); + } } + documentSections.addAll(sections); + if (title.contains("REPLACE_")) { + tableDrawerAdapter.setTitle( + getResourceString(activity.getBaseContext(), title)); + } else { + tableDrawerAdapter.setTitle(title); + } + tableDrawerAdapter.setSections(documentSections); + tableDrawerAdapter.notifyDataSetChanged(); } - documentSections.addAll(sections); - if (title.contains("REPLACE_")) { - tableDrawerAdapter.setTitle( - getResourceString(activity.getBaseContext(), title)); - } else { - tableDrawerAdapter.setTitle(title); - } - tableDrawerAdapter.setSections(documentSections); - tableDrawerAdapter.notifyDataSetChanged(); } @Override @@ -718,13 +724,14 @@ public abstract class CoreReaderFragment extends BaseFragment try { startActivity(goToMarket); } catch (ActivityNotFoundException e) { - startActivity(new Intent(Intent.ACTION_VIEW, - kiwixBrowserMarketUri)); + startActivity(new Intent(Intent.ACTION_VIEW, kiwixBrowserMarketUri)); } } private void updateTitle() { - actionBar.setTitle(getValidTitle(zimReaderContainer.getZimFileTitle())); + if (isAdded()) { + actionBar.setTitle(getValidTitle(zimReaderContainer.getZimFileTitle())); + } } private String getValidTitle(String zimFileTitle) { @@ -1532,7 +1539,7 @@ public abstract class CoreReaderFragment extends BaseFragment switch (requestCode) { case MainMenuKt.REQUEST_FILE_SEARCH: if (resultCode == RESULT_OK) { - boolean wasFromTabSwitcher = mainMenu != null && mainMenu.isInTabSwitcher(); + boolean wasFromTabSwitcher = isInTabSwitcher(); hideTabSwitcher(); String title = data.getStringExtra(TAG_FILE_SEARCHED).replace("", "").replace("", ""); diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1df15321f..9ec52ade7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip