Skip to content

Commit

Permalink
Merge pull request #2631 from gouri-panda/release/3.4.4
Browse files Browse the repository at this point in the history
Release/3.4.4
  • Loading branch information
kelson42 authored Apr 28, 2021
2 parents 97b51a1 + 8fb1798 commit e288e58
Show file tree
Hide file tree
Showing 75 changed files with 435 additions and 304 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
fetch-depth: 1

- name: create instrumentation coverage
uses: ReactiveCircus/android-emulator-runner@v2.12.0
uses: ReactiveCircus/android-emulator-runner@v2.14.3
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
ndk: 21.3.6528147
ndk: 21.4.7075529
script: bash contrib/instrumentation.sh

- name: Upload screenshot result
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
fetch-depth: 1

- name: run instrumentation tests
uses: ReactiveCircus/android-emulator-runner@v2.12.0
uses: ReactiveCircus/android-emulator-runner@v2.14.3
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
ndk: 21.3.6528147
ndk: 21.4.7075529
script: bash contrib/instrumentation_nightly.sh

- name: Upload screenshot result
Expand All @@ -36,14 +36,17 @@ jobs:
path: screencap.png

unit_test_and_release:
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
steps:

- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;22.0.7026061" --sdk_root=${ANDROID_SDK_ROOT}

- name: run unit tests
run: ./gradlew testDebugUnitTest testCustomExampleDebugUnitTest

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:

staticAnalysis:

runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1
Expand All @@ -27,13 +27,16 @@ jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;22.0.7026061" --sdk_root=${ANDROID_SDK_ROOT}

- name: Build all configurations
run: ./gradlew assemble

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
publish:

runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
3.4.4
NEW: The Download of Zim in now more stable
NEW: Updated translations
BUGFIX: In Search menu item recreates multiple times
BUGFIX: Clicking the search result doesn't go anywhere
BUGFIX: Search text don't appear in the search field
BUGFIX: Back Press doesn't work in SearchFragment
BUGFIX: Memory leaks patched

3.4.3
NEW: Updated translations
BUGFIX: Video seek was not working
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply(from = rootProject.file("jacoco.gradle"))
ext {
set("versionMajor", 3)
set("versionMinor", 4)
set("versionPatch", 3)
set("versionPatch", 4)
}

fun generateVersionName() = "${ext["versionMajor"]}.${ext["versionMinor"]}.${ext["versionPatch"]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class HelpFragmentTest : BaseActivityTest() {
clickOnWhereIsContent()
assertWhereIsContentIsExpanded()
clickOnWhereIsContent()
clickOnHowToUpdateContent()
assertHowToUpdateContentIsExpanded()
clickOnHowToUpdateContent()
clickOnSendFeedback()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ class HelpRobot : BaseRobot() {
)
}

fun clickOnHowToUpdateContent() {
clickOn(TextId(string.how_to_update_content))
}

fun assertHowToUpdateContentIsExpanded() {
isVisible(TextId(string.update_content_description))
}

fun clickOnSendFeedback() {
clickOn(ViewId(id.activity_help_feedback_text_view))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class TopLevelDestinationRobot : BaseRobot() {

fun clickHostBooksOnSideNav(func: ZimHostRobot.() -> Unit) {
inNavDrawer {
clickOn(TextId(R.string.menu_host_books))
clickOn(TextId(R.string.menu_wifi_hotspot))
zimHost(func)
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.kiwix.kiwixmobile.core.main
package org.kiwix.kiwixmobile.search

import android.content.Context
import java.io.BufferedReader
import java.io.IOException
import androidx.test.internal.runner.junit4.statement.UiThreadStatement
import com.schibsted.spain.barista.assertion.BaristaVisibilityAssertions.assertDisplayed
import org.junit.Before
import org.junit.Test
import org.kiwix.kiwixmobile.BaseActivityTest
import org.kiwix.kiwixmobile.R

class FileReader {
fun readFile(filePath: String, context: Context): String = try {
context.assets.open(filePath)
.bufferedReader()
.use(BufferedReader::readText)
} catch (e: IOException) {
"".also { e.printStackTrace() }
class SearchFragmentTest : BaseActivityTest() {
@Before fun setUp() {
UiThreadStatement.runOnUiThread { activityRule.activity.navigate(R.id.searchFragment) }
}

@Test fun searchFragmentSimple() {
assertDisplayed(R.string.menu_search_in_text)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fun zimHost(func: ZimHostRobot.() -> Unit) = ZimHostRobot().applyWithViewHierarc

class ZimHostRobot : BaseRobot() {
init {
isVisible(TextId(R.string.menu_host_books))
isVisible(TextId(R.string.menu_wifi_hotspot))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import org.kiwix.kiwixmobile.core.base.FragmentActivityExtensions
import org.kiwix.kiwixmobile.core.di.components.CoreComponent
import org.kiwix.kiwixmobile.core.main.CoreMainActivity
import org.kiwix.kiwixmobile.kiwixActivityComponent
import org.kiwix.kiwixmobile.nav.destination.library.LocalLibraryFragmentDirections
import org.kiwix.kiwixmobile.nav.destination.reader.KiwixReaderFragmentDirections

const val NAVIGATE_TO_ZIM_HOST_FRAGMENT = "navigate_to_zim_host_fragment"

Expand Down Expand Up @@ -95,7 +95,7 @@ class KiwixMainActivity : CoreMainActivity() {
}
}
if (sharedPreferenceUtil.showIntro()) {
navigate(LocalLibraryFragmentDirections.actionLibraryFragmentToIntrofragment())
navigate(KiwixReaderFragmentDirections.actionReaderFragmentToIntroFragment())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class KiwixReaderFragment : CoreReaderFragment() {

private fun openPageInBookFromNavigationArguments() {
val args = KiwixReaderFragmentArgs.fromBundle(requireArguments())

if (args.pageUrl.isNotEmpty()) {
if (args.zimFileUri.isNotEmpty()) {
tryOpeningZimFile(args.zimFileUri)
Expand Down Expand Up @@ -250,9 +251,13 @@ class KiwixReaderFragment : CoreReaderFragment() {
val settings = requireActivity().getSharedPreferences(SharedPreferenceUtil.PREF_KIWIX_MOBILE, 0)
val zimFile = settings.getString(TAG_CURRENT_FILE, null)

if (zimFile != null) {
if (zimFile != null && File(zimFile).exists()) {
if (zimReaderContainer.zimFile == null) {
openZimFile(File(zimFile))
Log.d(
TAG_KIWIX,
"Kiwix normal start, Opened last used zimFile: -> $zimFile"
)
}
} else {
getCurrentWebView().snack(R.string.zim_not_opened)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,11 @@ class ZimHostFragment : BaseFragment(), ZimHostCallbacks, ZimHostContract.View {
private fun setUpToolbar(view: View) {
val activity = requireActivity() as AppCompatActivity
activity.setSupportActionBar(view.findViewById(R.id.toolbar))
activity.supportActionBar!!.title = getString(R.string.menu_host_books)
activity.supportActionBar!!.setHomeButtonEnabled(true)
activity.supportActionBar!!.setDisplayHomeAsUpEnabled(true)
activity.supportActionBar?.apply {
title = getString(R.string.menu_wifi_hotspot)
setHomeButtonEnabled(true)
setDisplayHomeAsUpEnabled(true)
}
}

// Advice user to turn on hotspot manually for API<26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ class ConnectivityBroadcastReceiver @Inject constructor(
) {
_networkStates.onNext(connectivityManager.networkState)
}

fun stopNetworkState() {
_networkStates.onComplete()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ class ZimManageViewModel @Inject constructor(
val requestDownloadLibrary = BehaviorProcessor.createDefault(Unit)
val requestFiltering = BehaviorProcessor.createDefault("")

private val compositeDisposable = CompositeDisposable()
private var compositeDisposable: CompositeDisposable? = CompositeDisposable()

init {
compositeDisposable.addAll(*disposables())
compositeDisposable?.addAll(*disposables())
context.registerReceiver(connectivityBroadcastReceiver)
}

Expand All @@ -129,8 +129,13 @@ class ZimManageViewModel @Inject constructor(
}

override fun onCleared() {
compositeDisposable.clear()
compositeDisposable?.clear()
context.unregisterReceiver(connectivityBroadcastReceiver)
connectivityBroadcastReceiver.stopNetworkState()
requestFileSystemCheck.onComplete()
fileSelectActions.onComplete()
requestDownloadLibrary.onComplete()
compositeDisposable = null
super.onCleared()
}

Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/navigation/kiwix_nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
app:startDestination="@id/libraryFragment">
app:startDestination="@id/readerFragment">
<fragment
android:id="@+id/readerFragment"
android:name="org.kiwix.kiwixmobile.nav.destination.reader.KiwixReaderFragment"
Expand Down Expand Up @@ -52,6 +52,11 @@
<action
android:id="@+id/action_readerFragment_to_searchFragment"
app:destination="@id/searchFragment" />
<action
android:id="@+id/action_readerFragment_to_introFragment"
app:destination="@id/introFragment"
app:popUpTo="@id/readerFragment"
app:popUpToInclusive="true" />
</fragment>

<fragment
Expand All @@ -69,11 +74,6 @@
<action
android:id="@+id/action_libraryFragment_to_localFileTransferFragment"
app:destination="@id/localFileTransferFragment" />
<action
android:id="@+id/action_libraryFragment_to_introfragment"
app:destination="@id/introFragment"
app:popUpTo="@id/libraryFragment"
app:popUpToInclusive="true" />
</fragment>

<fragment
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/values-eo/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Authors:
* Jakub Fabijan
-->
<resources>
<string name="send_files_title">Sendado de Dosierojn</string>
<string name="receive_files_title">Ricevado de Dosierojn</string>
</resources>
3 changes: 2 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
<!-- Authors:
* Gomoko
* Thibaut120094
* Verdy p
-->
<resources>
<string name="file_system_does_not_support_4gb">Votre système de fichiers ne prend pas en charge les fichiers de 4 Go ou plus.</string>
<string name="detecting_file_system">Détecte si le système de fichiers peut créer des fichiers de 4 Go ou plus</string>
<string name="cannot_open_file">Échec de l\'ouverture du fichier\nEssayez de chercher ce fichier dans l\'onglet Appareils de votre Bibliothèque</string>
<string name="cannot_open_file">Échec de louverture du fichier.\nEssayez de chercher ce fichier dans longlet Appareils de votre Bibliothèque.</string>
<string name="send_files_title">Envoyer des fichiers</string>
<string name="receive_files_title">Recevoir des fichiers</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-qq/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="all">
<string name="send_files_title">The title of an activity used for sending files.</string>
<string name="receive_files_title">The titles of an activity used for receiving files.</string>
</resources>
Loading

0 comments on commit e288e58

Please sign in to comment.