Skip to content

Commit

Permalink
Merge pull request #2527 from kiwix/release/3.4.2
Browse files Browse the repository at this point in the history
Release/3.4.2
  • Loading branch information
macgills authored Nov 30, 2020
2 parents 2153809 + 7f4dde7 commit f003379
Show file tree
Hide file tree
Showing 123 changed files with 2,498 additions and 1,705 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
coverageReport:
strategy:
matrix:
api-level: [21, 21]
api-level: [21, 21]
fail-fast: false
runs-on: macOS-latest
steps:
Expand All @@ -25,7 +25,7 @@ jobs:
fetch-depth: 1

- name: create instrumentation coverage
uses: ReactiveCircus/android-emulator-runner@v2.8.0
uses: ReactiveCircus/android-emulator-runner@v2.12.0
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
Expand All @@ -44,4 +44,12 @@ jobs:

- name: Upload coverage to Codecov
run: |
bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
bash <(curl -s https://codecov.io/bash)
- name: Upload Coverage to GH-Actions
uses: actions/[email protected]
if: ${{ always() }}
with:
name: Tests Coverage Report
path: |
**/reports/
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-depth: 1

- name: run instrumentation tests
uses: ReactiveCircus/android-emulator-runner@v2.8.0
uses: ReactiveCircus/android-emulator-runner@v2.12.0
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
chmod 600 ssh_key
- name: Set date variable
run: echo ::set-env name=DATE::$(echo $(date +%Y-%m-%d))
run: echo "DATE=$(echo $(date +%Y-%m-%d))" >> $GITHUB_ENV

- name: release debug to kiwix.download.org
env:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ jobs:
- name: Static Analysis
run: ./gradlew ktlintCheck detekt app:lintDebug custom:lintCustomexampleDebug

- name: Upload Static Analysis Report
uses: actions/[email protected]
if: ${{ always() }}
with:
name: Static Analysis Report
path: |
**/reports/
build:

runs-on: ubuntu-latest
Expand All @@ -27,3 +36,10 @@ jobs:

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

- name: Upload APK as Artifacts
uses: actions/[email protected]
with:
name: kiwix-android
path: |
**/*.apk
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
chmod 600 ssh_key
- name: Set tag variable
run: echo ::set-env name=TAG::$(echo ${GITHUB_REF:10})
run: echo "TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV

- name: Publish app to play store
env:
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
3.4.2
NEW: Service worker support for war2c zim files
NEW: Updated translations
NEW: Online Library won't be downloaded on mobile data when wifi only preference is set
BUGFIX: Text to Speech continues in background
BUGFIX: Video player became became unresponsive post backgrounding
BUGFIX: Bookmarks/History weren't displaying their title
BUGFIX: Memory leaks patched
BUGFIX: Table of contents accessible from non Reader screens

3.4.1
NEW: Overhauled navigation
NEW: Updated translations
NEW: Support resizing Kiwix
NEW: Open search in ne wtab
NEW: Open search in new tab
BUGFIX: Search speed increased and loading state added
BUGFIX: Memory leaks patched
BUGFIX: More consistent labelling drives internal/external
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ To generate coverage reports for your automated tests run:

Code coverage results can be seen under `[module]/build/reports/`

### Continous Integration
### Continuous Integration

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
learn more about the commands run on the CI please refer to [.github/workflows](https://github.com/kiwix/kiwix-android/tree/develop/.github/workflows).
Expand Down
2 changes: 1 addition & 1 deletion DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Text should contrast well, use the correct weight and size to present content as

Views using the same style often use different text style. Therefore text styles, and view styles are seperated and can be used simultaneously. To keep an android application consistent in style, thirteen text style attributes should be defined. These style attributes can be generated ([Material Design type scale generator](https://material.io/design/typography/the-type-system.html#type-scale)), or defined by editing `core/../values/type.xml`.

All text should have a text style to simplifiy appearance changes. To set a text style, simply set the `textAppearance` property using one of the thirteen text style attributes from `core/../values/type.xml`. Text can also be grouped if they are related and uses the same text style. This grouping can be done by creating a style that inherits, or sets a specific text appearance. E.x. `<style name="no_content_text" parent="TextAppearance.KiwixTheme.Headline5" />`.
All text should have a text style to simplify appearance changes. To set a text style, simply set the `textAppearance` property using one of the thirteen text style attributes from `core/../values/type.xml`. Text can also be grouped if they are related and uses the same text style. This grouping can be done by creating a style that inherits, or sets a specific text appearance. E.x. `<style name="no_content_text" parent="TextAppearance.KiwixTheme.Headline5" />`.

Additional reading can be found at [Material Design - Type System](https://material.io/design/typography/the-type-system.html#type-scale).

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", 1)
set("versionPatch", 2)
}

fun generateVersionName() = "${ext["versionMajor"]}.${ext["versionMinor"]}.${ext["versionPatch"]}"
Expand Down
10 changes: 8 additions & 2 deletions app/detekt_baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<ID>EmptyFunctionBlock:None.kt$None${ }</ID>
<ID>EmptyFunctionBlock:SimplePageChangeListener.kt$SimplePageChangeListener${ }</ID>
<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>
<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>
<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, private val connectivityManager: ConnectivityManager, private val sharedPreferenceUtil: SharedPreferenceUtil )</ID>
<ID>MagicNumber:LibraryListItem.kt$LibraryListItem.LibraryDownloadItem$1000L</ID>
<ID>MagicNumber:PeerGroupHandshake.kt$PeerGroupHandshake$15000</ID>
<ID>MagicNumber:ShareFiles.kt$ShareFiles$24</ID>
<ID>MagicNumber:ZimManageViewModel.kt$ZimManageViewModel$5</ID>
<ID>MagicNumber:ZimManageViewModel.kt$ZimManageViewModel$500</ID>
<ID>MagicNumber:ZimManageViewModel.kt$ZimManageViewModel$60</ID>
<ID>NestedBlockDepth:PeerGroupHandshake.kt$PeerGroupHandshake$readHandshakeAndExchangeMetaData</ID>
<ID>NestedBlockDepth:ReceiverHandShake.kt$ReceiverHandShake$exchangeFileTransferMetadata</ID>
<ID>PackageNaming:AvailableSpaceCalculator.kt$package org.kiwix.kiwixmobile.zim_manager.library_view</ID>
<ID>PackageNaming:ConnectivityBroadcastReceiver.kt$package org.kiwix.kiwixmobile.zim_manager</ID>
<ID>PackageNaming:DefaultLanguageProvider.kt$package org.kiwix.kiwixmobile.zim_manager</ID>
Expand All @@ -36,8 +38,12 @@
<ID>PackageNaming:ZimManageViewModel.kt$package org.kiwix.kiwixmobile.zim_manager</ID>
<ID>ReturnCount:Fat32Checker.kt$Fat32Checker$private fun canCreate4GbFile(storage: String): Boolean</ID>
<ID>TooGenericExceptionCaught:FileWritingFileSystemChecker.kt$FileWritingFileSystemChecker$e: Exception</ID>
<ID>TooGenericExceptionCaught:PeerGroupHandshake.kt$PeerGroupHandshake$ex: Exception</ID>
<ID>TooGenericExceptionCaught:ReceiverHandShake.kt$ReceiverHandShake$e: Exception</ID>
<ID>TooGenericExceptionCaught:SenderHandShake.kt$SenderHandShake$e: Exception</ID>
<ID>TooGenericExceptionThrown:ActivityExtensions.kt$throw RuntimeException( """ applicationContext is ${applicationContext::class.java.simpleName} application is ${application::class.java.simpleName} """.trimIndent() )</ID>
<ID>TooGenericExceptionThrown:LibraryViewHolder.kt$LibraryViewHolder.LibraryBookViewHolder$throw RuntimeException("impossible invalid state: ${item.fileSystemState}")</ID>
<ID>TooGenericExceptionThrown:ZimManageViewModel.kt$ZimManageViewModel$throw RuntimeException("Impossible state")</ID>
<ID>VariableNaming:PeerGroupHandshake.kt$PeerGroupHandshake$private val HANDSHAKE_MESSAGE = "Request Kiwix File Sharing"</ID>
</Whitelist>
</SmellBaseline>
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ import org.junit.Rule
import org.junit.runner.RunWith
import org.kiwix.kiwixmobile.core.di.components.DaggerTestComponent
import org.kiwix.kiwixmobile.core.di.components.TestComponent
import org.kiwix.kiwixmobile.main.KiwixMainActivity

@RunWith(AndroidJUnit4::class)
abstract class BaseActivityTest<T : Activity> {
abstract class BaseActivityTest {
@get:Rule
abstract var activityRule: ActivityTestRule<T>
open var activityRule = ActivityTestRule(KiwixMainActivity::class.java)

@get:Rule
var readPermissionRule: GrantPermissionRule =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@
package org.kiwix.kiwixmobile.help

import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiThread
import androidx.test.rule.ActivityTestRule
import org.junit.Rule
import org.junit.Test
import org.kiwix.kiwixmobile.BaseActivityTest
import org.kiwix.kiwixmobile.R
import org.kiwix.kiwixmobile.main.KiwixMainActivity

class HelpFragmentTest : BaseActivityTest<KiwixMainActivity>() {

@get:Rule
override var activityRule: ActivityTestRule<KiwixMainActivity> =
ActivityTestRule(KiwixMainActivity::class.java)
class HelpFragmentTest : BaseActivityTest() {

@Test
fun verifyHelpActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiT
import org.junit.Test
import org.kiwix.kiwixmobile.BaseActivityTest
import org.kiwix.kiwixmobile.R
import org.kiwix.kiwixmobile.main.KiwixMainActivity

class IntroFragmentTest : BaseActivityTest<KiwixMainActivity>() {

override var activityRule = activityTestRule<KiwixMainActivity>()
class IntroFragmentTest : BaseActivityTest() {

@Test
fun viewIsSwipeableAndNavigatesToMain() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import org.kiwix.kiwixmobile.Findable.StringId.TextId
import org.kiwix.kiwixmobile.Findable.ViewId
import org.kiwix.kiwixmobile.LONG_WAIT
import org.kiwix.kiwixmobile.R
import org.kiwix.kiwixmobile.main.MainRobot
import org.kiwix.kiwixmobile.main.main
import org.kiwix.kiwixmobile.main.TopLevelDestinationRobot
import org.kiwix.kiwixmobile.main.topLevel

fun intro(func: IntroRobot.() -> Unit) = IntroRobot().applyWithViewHierarchyPrinting(func)

Expand All @@ -49,8 +49,8 @@ class IntroRobot : BaseRobot() {
}
}

infix fun clickGetStarted(func: MainRobot.() -> Unit): MainRobot {
infix fun clickGetStarted(func: TopLevelDestinationRobot.() -> Unit): TopLevelDestinationRobot {
clickOn(getStarted)
return main(func)
return topLevel(func)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Kiwix Android
* Copyright (c) 2020 Kiwix <android.kiwix.org>
* 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 <http://www.gnu.org/licenses/>.
*
*/

package org.kiwix.kiwixmobile.localFileTransfer

import applyWithViewHierarchyPrinting
import org.kiwix.kiwixmobile.BaseRobot
import org.kiwix.kiwixmobile.Findable.StringId.TextId
import org.kiwix.kiwixmobile.R

/**
* Authored by Ayush Shrivastava on 29/10/20
*/

fun localFileTransfer(func: LocalFileTransferRobot.() -> Unit) =
LocalFileTransferRobot().applyWithViewHierarchyPrinting(func)

class LocalFileTransferRobot : BaseRobot() {

init {
isVisible(TextId(R.string.receive_files_title))
}
}

This file was deleted.

Loading

0 comments on commit f003379

Please sign in to comment.