From 01df6fe822d20bc257dd0fa9a42508c39aa53d83 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Mon, 31 Mar 2025 17:29:00 +0530 Subject: [PATCH] Fixed: The `DownloadTest`, and `InitialDownloadTest` sometimes failing on Android 16. * Removed some unused code from project. --- .../kiwixmobile/download/DownloadRobot.kt | 4 +- .../initial/download/InitialDownloadRobot.kt | 4 +- .../main/res/anim/nav_default_enter_anim.xml | 25 ---- .../main/res/anim/nav_default_exit_anim.xml | 25 ---- .../res/anim/nav_default_pop_enter_anim.xml | 25 ---- .../res/anim/nav_default_pop_exit_anim.xml | 25 ---- .../kotlin/plugin/AllProjectConfigurer.kt | 1 + .../core/utils/SimpleTextWatcher.kt | 38 ----- core/src/main/res/drawable/ic_qr_code.xml | 5 - core/src/main/res/layout/header_language.xml | 17 --- core/src/main/res/layout/item_book.xml | 130 ------------------ .../main/res/menu/menu_add_note_dialog.xml | 23 ---- lintConfig.xml | 1 - 13 files changed, 7 insertions(+), 316 deletions(-) delete mode 100644 app/src/main/res/anim/nav_default_enter_anim.xml delete mode 100644 app/src/main/res/anim/nav_default_exit_anim.xml delete mode 100644 app/src/main/res/anim/nav_default_pop_enter_anim.xml delete mode 100644 app/src/main/res/anim/nav_default_pop_exit_anim.xml delete mode 100644 core/src/main/java/org/kiwix/kiwixmobile/core/utils/SimpleTextWatcher.kt delete mode 100644 core/src/main/res/drawable/ic_qr_code.xml delete mode 100644 core/src/main/res/layout/header_language.xml delete mode 100644 core/src/main/res/layout/item_book.xml delete mode 100644 core/src/main/res/menu/menu_add_note_dialog.xml diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt index 21e4a7955..d1b728d75 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/download/DownloadRobot.kt @@ -68,7 +68,9 @@ class DownloadRobot : BaseRobot() { clickOn(ViewId(R.id.downloadsFragment)) } - fun waitForDataToLoad(retryCountForDataToLoad: Int = 10) { + // Increasing the default timeout for data loading because, on the Android 16 Emulator, + // the internet connection is slow, and the library download takes longer. + fun waitForDataToLoad(retryCountForDataToLoad: Int = 20) { try { isVisible(TextId(string.your_languages)) } catch (e: RuntimeException) { diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/initial/download/InitialDownloadRobot.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/initial/download/InitialDownloadRobot.kt index a059eac8d..41706d817 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/initial/download/InitialDownloadRobot.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/initial/download/InitialDownloadRobot.kt @@ -56,7 +56,9 @@ class InitialDownloadRobot : BaseRobot() { refresh(R.id.librarySwipeRefresh) } - fun waitForDataToLoad(retryCountForDataToLoad: Int = 10) { + // Increasing the default timeout for data loading because, on the Android 16 Emulator, + // the internet connection is slow, and the library download takes longer. + fun waitForDataToLoad(retryCountForDataToLoad: Int = 20) { try { isVisible(TextId(string.your_languages)) } catch (e: RuntimeException) { diff --git a/app/src/main/res/anim/nav_default_enter_anim.xml b/app/src/main/res/anim/nav_default_enter_anim.xml deleted file mode 100644 index f35ce95a0..000000000 --- a/app/src/main/res/anim/nav_default_enter_anim.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/app/src/main/res/anim/nav_default_exit_anim.xml b/app/src/main/res/anim/nav_default_exit_anim.xml deleted file mode 100644 index 6aef5554f..000000000 --- a/app/src/main/res/anim/nav_default_exit_anim.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/app/src/main/res/anim/nav_default_pop_enter_anim.xml b/app/src/main/res/anim/nav_default_pop_enter_anim.xml deleted file mode 100644 index f35ce95a0..000000000 --- a/app/src/main/res/anim/nav_default_pop_enter_anim.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/app/src/main/res/anim/nav_default_pop_exit_anim.xml b/app/src/main/res/anim/nav_default_pop_exit_anim.xml deleted file mode 100644 index 6aef5554f..000000000 --- a/app/src/main/res/anim/nav_default_pop_exit_anim.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt b/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt index c4286c9ea..d5796ecb7 100644 --- a/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt +++ b/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt @@ -164,6 +164,7 @@ class AllProjectConfigurer { add("NotifyDataSetChanged") add("Aligned16KB") // TODO Remove when properly migrated to Android 16. add("AndroidGradlePluginVersion") + add("MemberExtensionConflict") } lintConfig = target.rootProject.file("lintConfig.xml") } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SimpleTextWatcher.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SimpleTextWatcher.kt deleted file mode 100644 index c401569d7..000000000 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SimpleTextWatcher.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Kiwix Android - * Copyright (c) 2020 Kiwix - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package org.kiwix.kiwixmobile.core.utils - -import android.text.Editable -import android.text.TextWatcher - -class SimpleTextWatcher( - private val onTextWatcherChangeAction: (CharSequence?, Int, Int, Int) -> Unit -) : TextWatcher { - @SuppressWarnings("EmptyFunctionBlock") - override fun afterTextChanged(p0: Editable?) { - } - - @SuppressWarnings("EmptyFunctionBlock") - override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { - } - - override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { - onTextWatcherChangeAction.invoke(s, start, before, count) - } -} diff --git a/core/src/main/res/drawable/ic_qr_code.xml b/core/src/main/res/drawable/ic_qr_code.xml deleted file mode 100644 index b3de5671c..000000000 --- a/core/src/main/res/drawable/ic_qr_code.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/core/src/main/res/layout/header_language.xml b/core/src/main/res/layout/header_language.xml deleted file mode 100644 index 0b003c81e..000000000 --- a/core/src/main/res/layout/header_language.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - diff --git a/core/src/main/res/layout/item_book.xml b/core/src/main/res/layout/item_book.xml deleted file mode 100644 index c64cbfcf0..000000000 --- a/core/src/main/res/layout/item_book.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/src/main/res/menu/menu_add_note_dialog.xml b/core/src/main/res/menu/menu_add_note_dialog.xml deleted file mode 100644 index 911016178..000000000 --- a/core/src/main/res/menu/menu_add_note_dialog.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - diff --git a/lintConfig.xml b/lintConfig.xml index 218443479..44af8acfc 100644 --- a/lintConfig.xml +++ b/lintConfig.xml @@ -52,5 +52,4 @@ -