Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
JhonnySalles committed Aug 27, 2022
2 parents 5bf6b0a + ca197d4 commit 88ad27b
Show file tree
Hide file tree
Showing 204 changed files with 10,310 additions and 2,826 deletions.
19 changes: 15 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "br.com.fenix.bilingualmangareader"
minSdk 26
targetSdk 31
versionCode 13
versionName "2.13"
versionCode 15
versionName "2.15"
archivesBaseName = "BilingualManga_" + versionName

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -33,6 +33,7 @@ android {
}
buildFeatures {
viewBinding true
dataBinding true
}
packagingOptions {
resources {
Expand All @@ -49,13 +50,19 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.databinding:library:3.2.0-alpha11'
kapt "com.android.databinding:compiler:3.1.2"
implementation 'androidx.compose.ui:ui:1.0.0-beta04'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation 'de.raphaelebner:roomdatabasebackup:1.0.0-beta10' //backup
implementation 'androidx.room:room-runtime:2.4.2' // database
kapt 'androidx.room:room-compiler:2.4.2' // use join room
implementation "androidx.paging:paging-runtime-ktx:3.1.0"
implementation "androidx.room:room-paging:2.4.2"
implementation "androidx.paging:paging-compose:1.0.0-alpha13"

implementation 'com.github.rey5137:material:1.3.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.google.android.material:material:1.5.0-alpha05'
Expand All @@ -80,8 +87,12 @@ dependencies {
implementation 'cz.adaptech:tesseract4android:4.1.1'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.0'

// API CONECTION
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

// MANGA INFO
implementation 'com.kttdevelopment:mal4j:2.8.1'
//implementation 'com.kttdevelopment:mal4j:2.8.1'

// TEST
testImplementation 'junit:junit:4.13.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class MainActivityTest {
.perform(DrawerActions.open())

onView(withId(R.id.nav_view))
.perform(NavigationViewActions.navigateTo(R.id.menu_library))
.perform(NavigationViewActions.navigateTo(R.id.menu_library_default))

waiter.await(animationTimer, TimeUnit.MILLISECONDS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.graphics.Color
import android.graphics.drawable.Drawable
import android.graphics.drawable.StateListDrawable
import android.view.View
import androidx.annotation.IdRes

class CustomUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class TestUtils {
(1..2).random() > 1,
LocalDateTime.parse("2022-06-28T14:15:50.63"),
LocalDateTime.now(),
LocalDateTime.now(),
GeneralConsts.KEYS.LIBRARY.DEFAULT,
(1..5).random() > 2
)

Expand Down Expand Up @@ -84,7 +86,8 @@ class TestUtils {
return Manga(
1, Util.getNameFromPath(TEST_FILE_PATH), "", TEST_FILE_PATH, Util.getFolderFromPath(TEST_FILE_PATH),
Util.getNameWithoutExtensionFromPath(TEST_FILE_PATH), Util.getExtensionFromPath(TEST_FILE_PATH), 10, 5,
(1..2).random() > 1, LocalDateTime.parse("2022-06-28T14:15:50.63"), LocalDateTime.now(), (1..5).random() > 2
(1..2).random() > 1, LocalDateTime.parse("2022-06-28T14:15:50.63"), LocalDateTime.now(),
LocalDateTime.now(), GeneralConsts.KEYS.LIBRARY.DEFAULT, (1..5).random() > 2
)
}

Expand All @@ -103,7 +106,7 @@ class TestUtils {
i.toLong(), Util.getNameFromPath(TEST_FILE_PATH), "", TEST_FILE_PATH, Util.getFolderFromPath(TEST_FILE_PATH),
Util.getNameWithoutExtensionFromPath(TEST_FILE_PATH), Util.getExtensionFromPath(TEST_FILE_PATH), 125,
(0..100).random(), i in 2..5, LocalDateTime.parse("2022-06-28T14:15:50.63"), LocalDateTime.now(),
i in 4..6
LocalDateTime.now(), GeneralConsts.KEYS.LIBRARY.DEFAULT, i in 4..6
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import br.com.fenix.bilingualmangareader.R
import br.com.fenix.bilingualmangareader.custom.CustomMatchers
import br.com.fenix.bilingualmangareader.model.entity.Library
import br.com.fenix.bilingualmangareader.model.entity.Manga
import br.com.fenix.bilingualmangareader.model.enums.Libraries
import br.com.fenix.bilingualmangareader.util.constants.GeneralConsts
import br.com.fenix.bilingualmangareader.utils.TestUtils
import junit.framework.TestCase.assertTrue
Expand All @@ -33,6 +35,7 @@ class MangaDetailActivityTest {
intent = Intent(ApplicationProvider.getApplicationContext(), MangaDetailActivity::class.java)
val bundle = Bundle()
manga = TestUtils.getManga(ApplicationProvider.getApplicationContext())
bundle.putSerializable(GeneralConsts.KEYS.OBJECT.LIBRARY, Library(-1, Libraries.DEFAULT.name, ""))
bundle.putSerializable(GeneralConsts.KEYS.OBJECT.MANGA, manga)
intent?.putExtras(bundle)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package br.com.fenix.bilingualmangareader.view.ui.menu

import android.content.Intent
import android.os.Bundle
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import br.com.fenix.bilingualmangareader.R
import br.com.fenix.bilingualmangareader.util.constants.GeneralConsts
import junit.framework.TestCase
import org.junit.FixMethodOrder
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import java.util.concurrent.CountDownLatch

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@RunWith(AndroidJUnit4::class)
class MenuActivityTest {

private var intent: Intent? = null

init {
intent = Intent(ApplicationProvider.getApplicationContext(), MenuActivity::class.java)

val bundle = Bundle()
bundle.putInt(GeneralConsts.KEYS.FRAGMENT.ID, R.id.frame_select_manga)
intent?.putExtras(bundle)
}


@get:Rule
val activityScenarioRule = ActivityScenarioRule<MenuActivity>(intent)

private val awaitProcessSeconds = 2L

@Test
fun `1_test_select_manga`() {
val waiter = CountDownLatch(1)
val scenario = activityScenarioRule.scenario

scenario.onActivity {
val fragment = it.supportFragmentManager.findFragmentById(R.id.root_frame_menu)
TestCase.assertTrue(fragment is SelectMangaFragment)
}

waiter.await()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import br.com.fenix.bilingualmangareader.R
import br.com.fenix.bilingualmangareader.model.entity.Library
import br.com.fenix.bilingualmangareader.model.entity.Manga
import br.com.fenix.bilingualmangareader.model.enums.Libraries
import br.com.fenix.bilingualmangareader.util.constants.GeneralConsts
import br.com.fenix.bilingualmangareader.utils.TestUtils
import com.google.android.material.progressindicator.CircularProgressIndicator
Expand Down Expand Up @@ -44,6 +46,7 @@ class PagesLinkActivityTest {
intent = Intent(ApplicationProvider.getApplicationContext(), PagesLinkActivity::class.java)

val bundle = Bundle()
bundle.putSerializable(GeneralConsts.KEYS.OBJECT.LIBRARY, Library(-1, Libraries.DEFAULT.name, ""))
bundle.putSerializable(GeneralConsts.KEYS.OBJECT.MANGA, manga)
bundle.putInt(GeneralConsts.KEYS.MANGA.PAGE_NUMBER, 0)
intent?.putExtras(bundle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import br.com.fenix.bilingualmangareader.R
import br.com.fenix.bilingualmangareader.custom.CustomTypes
import br.com.fenix.bilingualmangareader.model.entity.Library
import br.com.fenix.bilingualmangareader.model.entity.Manga
import br.com.fenix.bilingualmangareader.model.enums.Libraries
import br.com.fenix.bilingualmangareader.util.constants.GeneralConsts
import br.com.fenix.bilingualmangareader.utils.TestUtils
import junit.framework.TestCase.assertFalse
Expand Down Expand Up @@ -40,6 +42,7 @@ class ReaderActivityTest {
intent = Intent(ApplicationProvider.getApplicationContext(), ReaderActivity::class.java)

val bundle = Bundle()
bundle.putSerializable(GeneralConsts.KEYS.OBJECT.LIBRARY, Library(-1, Libraries.DEFAULT.name, ""))
bundle.putSerializable(GeneralConsts.KEYS.OBJECT.MANGA, manga)
bundle.putString(GeneralConsts.KEYS.MANGA.NAME, manga.title)
bundle.putInt(GeneralConsts.KEYS.MANGA.PAGE_NUMBER, 0)
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
android:maxSdkVersion="29" />
<uses-permission
android:name="android.permission.WRITE_INTERNAL_STORAGE"
android:maxSdkVersion="28" />
android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Expand Down Expand Up @@ -52,6 +52,11 @@
android:exported="true"
android:theme="@style/AppTheme.NoActionBar"
android:parentActivityName=".MainActivity"/>
<activity
android:name="br.com.fenix.bilingualmangareader.view.ui.menu.MenuActivity"
android:exported="true"
android:theme="@style/AppTheme.NoActionBar"
android:parentActivityName=".MainActivity"/>

<meta-data
android:name="com.google.android.gms.version"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/assets/vocabulary.sql

Large diffs are not rendered by default.

Loading

0 comments on commit 88ad27b

Please sign in to comment.