From c4d8f1b2eade0ea05d713d403921bcba93f40763 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Fri, 20 Sep 2024 15:53:09 +0530 Subject: [PATCH 1/3] Fixed: The UI showing incorrect colors in night mode. --- app/src/main/res/layout/fragment_destination_download.xml | 5 +++-- core/src/main/res/layout/layout_donation_bottom_sheet.xml | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/layout/fragment_destination_download.xml b/app/src/main/res/layout/fragment_destination_download.xml index 1d8b7c9aea..11a6e442f0 100644 --- a/app/src/main/res/layout/fragment_destination_download.xml +++ b/app/src/main/res/layout/fragment_destination_download.xml @@ -68,10 +68,11 @@ diff --git a/core/src/main/res/layout/layout_donation_bottom_sheet.xml b/core/src/main/res/layout/layout_donation_bottom_sheet.xml index 529a12e763..c89f59cd35 100644 --- a/core/src/main/res/layout/layout_donation_bottom_sheet.xml +++ b/core/src/main/res/layout/layout_donation_bottom_sheet.xml @@ -18,6 +18,7 @@ @@ -69,7 +69,7 @@ android:layout_height="wrap_content" android:padding="@dimen/activity_horizontal_margin" android:text="@string/rate_dialog_neutral" - android:textColor="@color/denim_blue800" + android:textColor="?attr/colorPrimary" app:layout_constraintEnd_toStartOf="@+id/donateButton" app:layout_constraintTop_toBottomOf="@id/descriptionText" /> @@ -79,7 +79,7 @@ android:layout_height="wrap_content" android:padding="@dimen/activity_horizontal_margin" android:text="@string/make_donation" - android:textColor="@color/denim_blue800" + android:textColor="?attr/colorPrimary" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/descriptionText" /> From a1bad811c6373c461cd745ba57db415e1dbd52b5 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 1 Oct 2024 12:38:52 +0530 Subject: [PATCH 2/3] Setting the default visibility to gone of progressBarLayout. --- app/src/main/res/layout/fragment_destination_download.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_destination_download.xml b/app/src/main/res/layout/fragment_destination_download.xml index 11a6e442f0..f07c90f284 100644 --- a/app/src/main/res/layout/fragment_destination_download.xml +++ b/app/src/main/res/layout/fragment_destination_download.xml @@ -72,7 +72,7 @@ android:layout_width="140dp" android:layout_height="100dp" android:layout_margin="16dp" - android:visibility="visible" + android:visibility="gone" app:cardCornerRadius="8dp" app:cardElevation="4dp" app:layout_constraintBottom_toBottomOf="parent" From 2b796b0847630abf80a169700521c032edc7e89c Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 1 Oct 2024 18:09:22 +0530 Subject: [PATCH 3/3] Fixed an issue where the CI was sometimes failing due to an unknown reason related to the OverflowMenuButton (the three-dot default Android button) width. --- .../kiwixmobile/deeplinks/DeepLinksTest.kt | 15 ++++++++++++++- .../kiwixmobile/main/DarkModeViewPainterTest.kt | 17 ++++++++++++++++- .../kiwixmobile/main/TopLevelDestinationTest.kt | 17 ++++++++++++++++- .../kiwix/kiwixmobile/note/NoteFragmentTest.kt | 15 ++++++++++++--- .../page/bookmarks/LibkiwixBookmarkTest.kt | 17 ++++++++++++++++- .../page/history/NavigationHistoryTest.kt | 17 ++++++++++++++++- .../reader/KiwixReaderFragmentTest.kt | 17 ++++++++++++++++- .../ZimFileReaderWithSplittedZimFileTest.kt | 17 ++++++++++++++++- .../kiwixmobile/search/SearchFragmentTest.kt | 16 +++++++++++++--- 9 files changed, 135 insertions(+), 13 deletions(-) diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/deeplinks/DeepLinksTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/deeplinks/DeepLinksTest.kt index 2e027717f9..70f31cd55a 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/deeplinks/DeepLinksTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/deeplinks/DeepLinksTest.kt @@ -26,9 +26,14 @@ import androidx.test.core.app.ActivityScenario import androidx.test.espresso.Espresso.onView import androidx.test.espresso.accessibility.AccessibilityChecks import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesCheck +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews +import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck +import org.hamcrest.Matchers.allOf import org.junit.After import org.junit.Before import org.junit.Rule @@ -54,7 +59,15 @@ class DeepLinksTest : BaseActivityTest() { private lateinit var sharedPreferenceUtil: SharedPreferenceUtil init { - AccessibilityChecks.enable().setRunChecksFromRootView(true) + AccessibilityChecks.enable().apply { + setRunChecksFromRootView(true) + setSuppressingResultMatcher( + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews(withContentDescription("More options")) + ) + ) + } } @Before diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/main/DarkModeViewPainterTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/main/DarkModeViewPainterTest.kt index 6f1e0a676d..451aa00a79 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/main/DarkModeViewPainterTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/main/DarkModeViewPainterTest.kt @@ -26,9 +26,14 @@ import androidx.navigation.fragment.NavHostFragment import androidx.preference.PreferenceManager import androidx.test.core.app.ActivityScenario import androidx.test.espresso.accessibility.AccessibilityChecks +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.internal.runner.junit4.statement.UiThreadStatement import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesCheck +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews +import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck +import org.hamcrest.Matchers.allOf import org.junit.After import org.junit.Before import org.junit.Rule @@ -84,7 +89,17 @@ class DarkModeViewPainterTest : BaseActivityTest() { } init { - AccessibilityChecks.enable().setRunChecksFromRootView(true) + AccessibilityChecks.enable().apply { + setRunChecksFromRootView(true) + setSuppressingResultMatcher( + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews( + withContentDescription("More options") + ) + ) + ) + } } @Test diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationTest.kt index 89dc86a71d..e01566a44a 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/main/TopLevelDestinationTest.kt @@ -22,9 +22,14 @@ import androidx.lifecycle.Lifecycle import androidx.preference.PreferenceManager import androidx.test.core.app.ActivityScenario import androidx.test.espresso.accessibility.AccessibilityChecks +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesCheck +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews +import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck import leakcanary.LeakAssertions +import org.hamcrest.Matchers.allOf import org.junit.Before import org.junit.Rule import org.junit.Test @@ -81,7 +86,17 @@ class TopLevelDestinationTest : BaseActivityTest() { } init { - AccessibilityChecks.enable().setRunChecksFromRootView(true) + AccessibilityChecks.enable().apply { + setRunChecksFromRootView(true) + setSuppressingResultMatcher( + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews( + withContentDescription("More options") + ) + ) + ) + } } @Test diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/note/NoteFragmentTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/note/NoteFragmentTest.kt index c8a745b382..8c9d9ec197 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/note/NoteFragmentTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/note/NoteFragmentTest.kt @@ -26,14 +26,17 @@ import androidx.preference.PreferenceManager import androidx.test.core.app.ActivityScenario import androidx.test.espresso.accessibility.AccessibilityChecks import androidx.test.espresso.matcher.ViewMatchers +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.internal.runner.junit4.statement.UiThreadStatement import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesCheck import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews import com.google.android.apps.common.testing.accessibility.framework.checks.DuplicateClickableBoundsCheck +import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck import leakcanary.LeakAssertions import org.hamcrest.Matchers.allOf +import org.hamcrest.Matchers.anyOf import org.junit.After import org.junit.Before import org.junit.Rule @@ -96,9 +99,15 @@ class NoteFragmentTest : BaseActivityTest() { AccessibilityChecks.enable().apply { setRunChecksFromRootView(true) setSuppressingResultMatcher( - allOf( - matchesCheck(DuplicateClickableBoundsCheck::class.java), - matchesViews(ViewMatchers.withId(R.id.get_zim_nearby_device)) + anyOf( + allOf( + matchesCheck(DuplicateClickableBoundsCheck::class.java), + matchesViews(ViewMatchers.withId(R.id.get_zim_nearby_device)) + ), + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews(withContentDescription("More options")) + ) ) ) } diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/page/bookmarks/LibkiwixBookmarkTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/page/bookmarks/LibkiwixBookmarkTest.kt index a34defb3ea..13e10d39fb 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/page/bookmarks/LibkiwixBookmarkTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/page/bookmarks/LibkiwixBookmarkTest.kt @@ -26,8 +26,13 @@ import androidx.navigation.fragment.NavHostFragment import androidx.preference.PreferenceManager import androidx.test.core.app.ActivityScenario import androidx.test.espresso.accessibility.AccessibilityChecks +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesCheck +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews +import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck +import org.hamcrest.Matchers.allOf import org.junit.Before import org.junit.Rule import org.junit.Test @@ -87,7 +92,17 @@ class LibkiwixBookmarkTest : BaseActivityTest() { } init { - AccessibilityChecks.enable().setRunChecksFromRootView(true) + AccessibilityChecks.enable().apply { + setRunChecksFromRootView(true) + setSuppressingResultMatcher( + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews( + withContentDescription("More options") + ) + ) + ) + } } @Test diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/page/history/NavigationHistoryTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/page/history/NavigationHistoryTest.kt index 4fc23b75c1..cc0869ae37 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/page/history/NavigationHistoryTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/page/history/NavigationHistoryTest.kt @@ -25,10 +25,15 @@ import androidx.lifecycle.Lifecycle import androidx.preference.PreferenceManager import androidx.test.core.app.ActivityScenario import androidx.test.espresso.accessibility.AccessibilityChecks +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.internal.runner.junit4.statement.UiThreadStatement import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesCheck +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews +import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck import leakcanary.LeakAssertions +import org.hamcrest.Matchers.allOf import org.junit.After import org.junit.Before import org.junit.Rule @@ -87,7 +92,17 @@ class NavigationHistoryTest : BaseActivityTest() { } init { - AccessibilityChecks.enable().setRunChecksFromRootView(true) + AccessibilityChecks.enable().apply { + setRunChecksFromRootView(true) + setSuppressingResultMatcher( + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews( + withContentDescription("More options") + ) + ) + ) + } } @Test diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/KiwixReaderFragmentTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/KiwixReaderFragmentTest.kt index 0186d7e9e1..d2d1ae3b3b 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/KiwixReaderFragmentTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/KiwixReaderFragmentTest.kt @@ -25,13 +25,18 @@ import androidx.lifecycle.Lifecycle import androidx.preference.PreferenceManager import androidx.test.core.app.ActivityScenario import androidx.test.espresso.accessibility.AccessibilityChecks +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.internal.runner.junit4.statement.UiThreadStatement import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesCheck +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews +import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck import leakcanary.LeakAssertions import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.ResponseBody +import org.hamcrest.Matchers.allOf import org.junit.After import org.junit.Before import org.junit.Rule @@ -85,7 +90,17 @@ class KiwixReaderFragmentTest : BaseActivityTest() { } init { - AccessibilityChecks.enable().setRunChecksFromRootView(true) + AccessibilityChecks.enable().apply { + setRunChecksFromRootView(true) + setSuppressingResultMatcher( + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews( + withContentDescription("More options") + ) + ) + ) + } } @Test diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/ZimFileReaderWithSplittedZimFileTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/ZimFileReaderWithSplittedZimFileTest.kt index 38d31ed4d5..e1f6a80c00 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/ZimFileReaderWithSplittedZimFileTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/ZimFileReaderWithSplittedZimFileTest.kt @@ -25,9 +25,14 @@ import androidx.lifecycle.Lifecycle import androidx.preference.PreferenceManager import androidx.test.core.app.ActivityScenario import androidx.test.espresso.accessibility.AccessibilityChecks +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.internal.runner.junit4.statement.UiThreadStatement import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesCheck +import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews +import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck +import org.hamcrest.Matchers.allOf import org.junit.After import org.junit.Assert import org.junit.Before @@ -86,7 +91,17 @@ class ZimFileReaderWithSplittedZimFileTest : BaseActivityTest() { } init { - AccessibilityChecks.enable().setRunChecksFromRootView(true) + AccessibilityChecks.enable().apply { + setRunChecksFromRootView(true) + setSuppressingResultMatcher( + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews( + withContentDescription("More options") + ) + ) + ) + } } @Test diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/search/SearchFragmentTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/search/SearchFragmentTest.kt index 90a35f2fff..32f9d77b68 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/search/SearchFragmentTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/search/SearchFragmentTest.kt @@ -26,6 +26,7 @@ import androidx.preference.PreferenceManager import androidx.test.core.app.ActivityScenario import androidx.test.espresso.accessibility.AccessibilityChecks import androidx.test.espresso.matcher.ViewMatchers +import androidx.test.espresso.matcher.ViewMatchers.withContentDescription import androidx.test.internal.runner.junit4.statement.UiThreadStatement import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice @@ -39,6 +40,7 @@ import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.ResponseBody import org.hamcrest.Matchers.allOf +import org.hamcrest.Matchers.anyOf import org.junit.After import org.junit.Before import org.junit.Rule @@ -109,9 +111,17 @@ class SearchFragmentTest : BaseActivityTest() { AccessibilityChecks.enable().apply { setRunChecksFromRootView(true) setSuppressingResultMatcher( - allOf( - matchesCheck(TouchTargetSizeCheck::class.java), - matchesViews(ViewMatchers.withId(id.menu_searchintext)) + anyOf( + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews(ViewMatchers.withId(id.menu_searchintext)) + ), + allOf( + matchesCheck(TouchTargetSizeCheck::class.java), + matchesViews( + withContentDescription("More options") + ) + ) ) ) }