Skip to content

Commit 4444936

Browse files
authored
Merge pull request #2298 from kiwix/release/3.4.0
Release/3.4.0
2 parents 463afdd + 51af5bf commit 4444936

File tree

255 files changed

+5234
-3285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+5234
-3285
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
3.4.0
2+
Beta release of navigation
3+
Full release notes to follow in 3.4.1
4+
15
3.3.4
26
NEW: Updated translations
37
BUGFIX: Fullscreen videos were not displaying

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ If you wish to rebase you should be following the [Golden Rule](https://www.atla
5656

5757
### Design and style
5858

59-
For an overview of how to make design changes to Kiwix Android, check out [DESIGN.md](https://github.com/kiwix/kiwix-android/edit/develop/DESIGN.md).
59+
For an overview of how to make design changes to Kiwix Android, check out [DESIGN.md](https://github.com/kiwix/kiwix-android/blob/develop/DESIGN.md).
6060

6161
### Adding new string resources
6262

63-
To add a new string resource see [STRING_RESOURCES.md](https://github.com/kiwix/kiwix-android/edit/develop/STRING_RESOURCES.md).
63+
To add a new string resource see [STRING_RESOURCES.md](https://github.com/kiwix/kiwix-android/blob/develop/STRING_RESOURCES.md).
6464

6565
### Building
6666

@@ -119,7 +119,7 @@ Code coverage results can be seen under `[module]/build/reports/`
119119
### Continous Integration
120120

121121
All PRs will have all these tests run and a combined coverage report will be attached, if coverage is to go down the PR will be marked failed. On Travis CI the automated tests are run on an emulator. To
122-
learn more about the commands run on the CI please refer to [.travis.yml](https://github.com/kiwix/kiwix-android/blob/master/.travis.yml)
122+
learn more about the commands run on the CI please refer to [.github/workflows](https://github.com/kiwix/kiwix-android/tree/develop/.github/workflows).
123123

124124

125125
_These guidelines are based on [Tools for Government Data Archiving](https://github.com/edgi-govdata-archiving/overview/blob/master/CONTRIBUTING.md)'s._

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ apply(from = rootProject.file("jacoco.gradle"))
1010

1111
ext {
1212
set("versionMajor", 3)
13-
set("versionMinor", 3)
14-
set("versionPatch", 4)
13+
set("versionMinor", 4)
14+
set("versionPatch", 0)
1515
}
1616

1717
fun generateVersionName() = "${ext["versionMajor"]}.${ext["versionMinor"]}.${ext["versionPatch"]}"

app/detekt_baseline.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<ID>EmptyFunctionBlock:SimplePageChangeListener.kt$SimplePageChangeListener${ }</ID>
77
<ID>EmptyFunctionBlock:ZimHostActivity.kt$ZimHostActivity.&lt;no name provided&gt;${}</ID>
88
<ID>ForbiddenComment:KiwixReaderFragment.kt$KiwixReaderFragment$// TODO: Show to user</ID>
9+
<ID>ForbiddenComment:ReaderFragment.kt$ReaderFragment$// TODO: Show to user</ID>
910
<ID>LongParameterList:ZimManageViewModel.kt$ZimManageViewModel$( booksOnFileSystem: List&lt;BookOnDisk&gt;, activeDownloads: List&lt;DownloadModel&gt;, allLanguages: List&lt;Language&gt;, libraryNetworkEntity: LibraryNetworkEntity, filter: String, fileSystemState: FileSystemState )</ID>
1011
<ID>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 )</ID>
1112
<ID>MagicNumber:LibraryListItem.kt$LibraryListItem.LibraryDownloadItem$1000L</ID>
@@ -28,9 +29,11 @@
2829
<ID>PackageNaming:LibraryListItem.kt$package org.kiwix.kiwixmobile.zim_manager.library_view.adapter</ID>
2930
<ID>PackageNaming:LibraryViewHolder.kt$package org.kiwix.kiwixmobile.zim_manager.library_view.adapter</ID>
3031
<ID>PackageNaming:MountFileSystemChecker.kt$package org.kiwix.kiwixmobile.zim_manager</ID>
32+
<ID>PackageNaming:NavigateToDownloads.kt$package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects</ID>
3133
<ID>PackageNaming:NetworkState.kt$package org.kiwix.kiwixmobile.zim_manager</ID>
3234
<ID>PackageNaming:None.kt$package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects</ID>
3335
<ID>PackageNaming:OpenFile.kt$package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects</ID>
36+
<ID>PackageNaming:OpenFileWithNavigation.kt$package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects</ID>
3437
<ID>PackageNaming:SectionsPagerAdapter.kt$package org.kiwix.kiwixmobile.zim_manager</ID>
3538
<ID>PackageNaming:ShareFiles.kt$package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects</ID>
3639
<ID>PackageNaming:SimplePageChangeListener.kt$package org.kiwix.kiwixmobile.zim_manager</ID>
@@ -46,6 +49,7 @@
4649
<ID>ReturnCount:LanguageActivity.kt$LanguageActivity$override fun onOptionsItemSelected(item: MenuItem): Boolean</ID>
4750
<ID>TooGenericExceptionCaught:FileWritingFileSystemChecker.kt$FileWritingFileSystemChecker$e: Exception</ID>
4851
<ID>TooGenericExceptionCaught:KiwixReaderFragment.kt$KiwixReaderFragment$e: Exception</ID>
52+
<ID>TooGenericExceptionCaught:ReaderFragment.kt$ReaderFragment$e: Exception</ID>
4953
<ID>TooGenericExceptionThrown:ActivityExtensions.kt$throw RuntimeException( """ applicationContext is ${applicationContext::class.java.simpleName} application is ${application::class.java.simpleName} """.trimIndent() )</ID>
5054
<ID>TooGenericExceptionThrown:LibraryViewHolder.kt$LibraryViewHolder.LibraryBookViewHolder$throw RuntimeException("impossible invalid state: ${item.fileSystemState}")</ID>
5155
<ID>TooGenericExceptionThrown:ZimManageViewModel.kt$ZimManageViewModel$throw RuntimeException("Impossible state")</ID>

app/src/androidTest/java/org/kiwix/kiwixmobile/DownloadTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import android.util.Log;
2323
import androidx.test.espresso.IdlingPolicies;
2424
import androidx.test.espresso.IdlingRegistry;
25-
import androidx.test.espresso.ViewInteraction;
2625
import androidx.test.ext.junit.runners.AndroidJUnit4;
2726
import androidx.test.filters.LargeTest;
2827
import androidx.test.rule.ActivityTestRule;
@@ -41,15 +40,11 @@
4140
import org.kiwix.kiwixmobile.utils.KiwixIdlingResource;
4241

4342
import static androidx.test.espresso.Espresso.onData;
44-
import static androidx.test.espresso.Espresso.onView;
45-
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
4643
import static androidx.test.espresso.matcher.ViewMatchers.withId;
47-
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
4844
import static com.schibsted.spain.barista.assertion.BaristaVisibilityAssertions.assertDisplayed;
4945
import static com.schibsted.spain.barista.interaction.BaristaClickInteractions.clickOn;
5046
import static com.schibsted.spain.barista.interaction.BaristaSwipeRefreshInteractions.refresh;
5147
import static junit.framework.Assert.fail;
52-
import static org.hamcrest.Matchers.allOf;
5348
import static org.kiwix.kiwixmobile.testutils.TestUtils.TEST_PAUSE_MS;
5449
import static org.kiwix.kiwixmobile.testutils.TestUtils.allowPermissionsIfNeeded;
5550
import static org.kiwix.kiwixmobile.testutils.TestUtils.captureAndSaveScreenshot;
@@ -98,11 +93,6 @@ public void downloadTest() {
9893
clickOn(R.string.remote_zims);
9994

10095
captureAndSaveScreenshot("Before-checking-for-ZimManager-Main-Activity");
101-
ViewInteraction viewPager2 = onView(
102-
allOf(withId(R.id.manageViewPager),
103-
withParent(allOf(withId(R.id.zim_manager_main_activity),
104-
withParent(withId(android.R.id.content)))),
105-
isDisplayed()));
10696
captureAndSaveScreenshot("After-the-check-completed");
10797

10898
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);

app/src/androidTest/java/org/kiwix/kiwixmobile/bookmark/BookmarksActivityTest.java

Lines changed: 0 additions & 47 deletions
This file was deleted.

app/src/androidTest/java/org/kiwix/kiwixmobile/language/LanguageActivityTest.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@
2424
import androidx.test.ext.junit.runners.AndroidJUnit4;
2525
import androidx.test.rule.GrantPermissionRule;
2626
import com.schibsted.spain.barista.interaction.BaristaSleepInteractions;
27-
import com.schibsted.spain.barista.rule.BaristaRule;
2827
import org.junit.After;
2928
import org.junit.Before;
3029
import org.junit.Ignore;
3130
import org.junit.Rule;
3231
import org.junit.Test;
3332
import org.junit.runner.RunWith;
3433
import org.kiwix.kiwixmobile.R;
35-
import org.kiwix.kiwixmobile.zim_manager.ZimManageActivity;
3634

3735
import static androidx.test.espresso.Espresso.onView;
3836
import static androidx.test.espresso.action.ViewActions.click;
@@ -54,9 +52,6 @@
5452
public class LanguageActivityTest {
5553

5654
@Rule
57-
public BaristaRule<ZimManageActivity> activityTestRule =
58-
BaristaRule.create(ZimManageActivity.class);
59-
@Rule
6055
public GrantPermissionRule readPermissionRule =
6156
GrantPermissionRule.grant(Manifest.permission.READ_EXTERNAL_STORAGE);
6257
@Rule
@@ -66,7 +61,6 @@ public class LanguageActivityTest {
6661
@Before
6762
public void setUp() {
6863
Intents.init();
69-
activityTestRule.launchActivity();
7064
}
7165

7266
@Test
@@ -86,7 +80,7 @@ public void testLanguageActivity() {
8680
String language2 = "german";
8781

8882
// References for the checkboxes for the corresponding languages
89-
ViewInteraction checkBox1, checkBox2;
83+
ViewInteraction checkBox1;
9084

9185
// Initialise Test test languages
9286
// Search for a particular language

app/src/androidTest/java/org/kiwix/kiwixmobile/main/MainActivityTest.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import androidx.test.rule.GrantPermissionRule;
2626
import com.schibsted.spain.barista.interaction.BaristaMenuClickInteractions;
2727
import com.schibsted.spain.barista.interaction.BaristaSleepInteractions;
28+
import org.junit.Before;
2829
import org.junit.Rule;
2930
import org.junit.Test;
3031
import org.junit.runner.RunWith;
@@ -34,6 +35,7 @@
3435
import static org.kiwix.kiwixmobile.testutils.TestUtils.TEST_PAUSE_MS;
3536
import static org.kiwix.kiwixmobile.testutils.TestUtils.getResourceString;
3637
import static org.kiwix.kiwixmobile.utils.StandardActions.enterSettings;
38+
import static org.kiwix.kiwixmobile.utils.StandardActions.openDrawer;
3739

3840
@LargeTest
3941
@RunWith(AndroidJUnit4.class)
@@ -48,37 +50,41 @@ public class MainActivityTest {
4850
public GrantPermissionRule writePermissionRule =
4951
GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE);
5052

53+
@Before
54+
public void setup() {
55+
clickOn(R.string.reader);
56+
}
57+
5158
@Test
5259
public void navigateHelp() {
5360
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
54-
BaristaMenuClickInteractions.clickMenu(getResourceString(R.string.menu_help));
61+
openDrawer();
62+
clickOn(R.string.menu_help);
5563
}
5664

5765
@Test
5866
public void navigateSettings() {
5967
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
68+
openDrawer();
6069
enterSettings();
6170
}
6271

6372
@Test
6473
public void navigateBookmarks() {
6574
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
75+
openDrawer();
6676
BaristaMenuClickInteractions.clickMenu(getResourceString(R.string.bookmarks));
6777
}
6878

6979
@Test
7080
public void navigateDeviceContent() {
7181
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
72-
BaristaMenuClickInteractions.clickMenu(getResourceString(R.string.library));
73-
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
74-
clickOn(R.string.local_zims);
82+
clickOn(R.string.library);
7583
}
7684

7785
@Test
7886
public void navigateOnlineContent() {
7987
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
80-
BaristaMenuClickInteractions.clickMenu(getResourceString(R.string.library));
81-
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
82-
clickOn(R.string.remote_zims);
88+
clickOn(R.string.download);
8389
}
8490
}

app/src/androidTest/java/org/kiwix/kiwixmobile/main/MainRobot.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ package org.kiwix.kiwixmobile.main
1919

2020
import org.kiwix.kiwixmobile.BaseRobot
2121
import org.kiwix.kiwixmobile.Findable.ViewId
22-
import org.kiwix.kiwixmobile.core.R.id
22+
import org.kiwix.kiwixmobile.R
2323

2424
fun main(func: MainRobot.() -> Unit) = MainRobot().apply(func)
2525

2626
class MainRobot : BaseRobot() {
2727
init {
28-
isVisible(ViewId(id.activity_main_root))
28+
isVisible(ViewId(R.id.navigation_container))
2929
}
3030
}

app/src/androidTest/java/org/kiwix/kiwixmobile/settings/KiwixSettingsActivityTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,15 @@ public class KiwixSettingsActivityTest {
4646
@Test
4747
public void testToggle() {
4848
clickOn(R.string.pref_back_to_top);
49-
clickOn(R.string.pref_hide_toolbar);
5049
clickOn(R.string.pref_newtab_background_title);
5150
clickOn(R.string.pref_external_link_popup_title);
5251
clickOn(R.string.pref_wifi_only);
5352
}
5453

5554
private void clickOn(@StringRes int... stringIds) {
56-
Matcher<View>[] matchers= new Matcher[stringIds.length];
55+
Matcher<View>[] matchers = new Matcher[stringIds.length];
5756
for (int i = 0; i < stringIds.length; i++) {
58-
matchers[i]= withText(stringIds[i]);
57+
matchers[i] = withText(stringIds[i]);
5958
}
6059
onView(withClassName(is(RecyclerView.class.getName())))
6160
.perform(actionOnItem(hasDescendant(anyOf(matchers)), click()));

0 commit comments

Comments
 (0)