diff --git a/.travis.yml b/.travis.yml index 53c9bdb39..d9599c539 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,7 +82,7 @@ deploy: #publish on play store - provider: script skip_cleanup: true - script: ./gradlew publishRelease + script: ./gradlew publishReleaseApk on: tags: true diff --git a/app/build.gradle b/app/build.gradle index 4936aa2db..c6dd145bc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -78,5 +78,6 @@ play { dependencies { implementation(Libs.squidb) implementation(Libs.squidb_annotations) + implementation(Libs.ink_page_indicator) kapt(Libs.squidb_processor) } diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.kt index 6a50c4ba7..0c7e262c3 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/intro/IntroActivityTest.kt @@ -21,7 +21,6 @@ import android.os.Build import androidx.test.filters.SdkSuppress import org.junit.Test import org.kiwix.kiwixmobile.BaseActivityTest -import org.kiwix.kiwixmobile.core.intro.IntroActivity @SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN_MR2) class IntroActivityTest : BaseActivityTest() { diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/splash/SplashActivityTest.java b/app/src/androidTest/java/org/kiwix/kiwixmobile/splash/KiwixSplashActivityTest.java similarity index 84% rename from app/src/androidTest/java/org/kiwix/kiwixmobile/splash/SplashActivityTest.java rename to app/src/androidTest/java/org/kiwix/kiwixmobile/splash/KiwixSplashActivityTest.java index c1bf74827..0f2c8b654 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/splash/SplashActivityTest.java +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/splash/KiwixSplashActivityTest.java @@ -34,13 +34,11 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.kiwix.kiwixmobile.core.intro.IntroActivity; -import org.kiwix.kiwixmobile.core.main.CoreMainActivity; -import org.kiwix.kiwixmobile.core.splash.SplashActivity; +import org.kiwix.kiwixmobile.intro.IntroActivity; +import org.kiwix.kiwixmobile.main.KiwixMainActivity; import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.espresso.intent.Intents.intended; -import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction; import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent; import static org.junit.Assert.assertEquals; import static org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.PREF_SHOW_INTRO; @@ -48,10 +46,10 @@ import static org.kiwix.kiwixmobile.testutils.TestUtils.TEST_PAUSE_MS; @LargeTest @RunWith(AndroidJUnit4.class) -public class SplashActivityTest { +public class KiwixSplashActivityTest { - private ActivityTestRule activityTestRule = - new ActivityTestRule<>(SplashActivity.class, true, false); + private ActivityTestRule activityTestRule = + new ActivityTestRule<>(KiwixSplashActivity.class, true, false); @Rule public GrantPermissionRule readPermissionRule = GrantPermissionRule.grant(Manifest.permission.READ_EXTERNAL_STORAGE); @@ -72,7 +70,6 @@ public class SplashActivityTest { activityTestRule.launchActivity(new Intent()); BaristaSleepInteractions.sleep(TEST_PAUSE_MS); - // Verify that the SplashActivity is followed by IntroActivity intended(hasComponent(IntroActivity.class.getName())); // Verify that the value of the "intro shown" boolean inside the SharedPreferences Database is not changed until the "Get started" button is pressed @@ -87,8 +84,7 @@ public class SplashActivityTest { activityTestRule.launchActivity(new Intent()); BaristaSleepInteractions.sleep(TEST_PAUSE_MS); - // Verify that the SplashActivity is followed by CoreMainActivity - intended(hasAction(CoreMainActivity.class.getCanonicalName())); + intended(hasComponent(KiwixMainActivity.class.getCanonicalName())); } @After diff --git a/app/src/kiwix/play/contact-email.txt b/app/src/kiwix/play/contact-email.txt deleted file mode 100644 index 2776f83bd..000000000 --- a/app/src/kiwix/play/contact-email.txt +++ /dev/null @@ -1 +0,0 @@ -contact+android@kiwix.org \ No newline at end of file diff --git a/app/src/kiwix/play/contact-website.txt b/app/src/kiwix/play/contact-website.txt deleted file mode 100644 index 62d3adf62..000000000 --- a/app/src/kiwix/play/contact-website.txt +++ /dev/null @@ -1 +0,0 @@ -http://www.kiwix.org \ No newline at end of file diff --git a/app/src/kiwix/play/default-language.txt b/app/src/kiwix/play/default-language.txt deleted file mode 100644 index f2b0341fe..000000000 --- a/app/src/kiwix/play/default-language.txt +++ /dev/null @@ -1 +0,0 @@ -en-US \ No newline at end of file diff --git a/app/src/kiwix/play/listings/de-DE/full-description.txt b/app/src/kiwix/play/listings/de-DE/full-description.txt deleted file mode 100644 index 04c2d087d..000000000 --- a/app/src/kiwix/play/listings/de-DE/full-description.txt +++ /dev/null @@ -1,9 +0,0 @@ -Die ganze Wikipedia auf deinem Mobilgerät! - -Kiwix ist eine Programm, daß das Lesen der Wikipedia und anderer Inhalte (Ubuntu Dokumentation, WikiLeaks, WikiVoyage, WikiSource, etc) ohne Internetverbindung erlaubt. - -Sobald du die Inhaltsdateien heruntergeladen hast, die sehr groß sein können, benötigst du keine Internetverbindung um sie zu verwenden. - -Siehe die Hilfe in der App und unsere Webseite für Informationen über verfügbare Inhalte. - -Anmerkung: Kiwix existiert auch für PCs (Windows, Mac, Linux) verfügbar.. \ No newline at end of file diff --git a/app/src/kiwix/play/listings/de-DE/short-description.txt b/app/src/kiwix/play/listings/de-DE/short-description.txt deleted file mode 100644 index ce940227a..000000000 --- a/app/src/kiwix/play/listings/de-DE/short-description.txt +++ /dev/null @@ -1 +0,0 @@ -Die Wikipedia immer dabei; ohne Internetverbindung! \ No newline at end of file diff --git a/app/src/kiwix/play/listings/de-DE/title.txt b/app/src/kiwix/play/listings/de-DE/title.txt deleted file mode 100644 index 836b4ce3b..000000000 --- a/app/src/kiwix/play/listings/de-DE/title.txt +++ /dev/null @@ -1 +0,0 @@ -Kiwix, Wikipedia offline \ No newline at end of file diff --git a/app/src/kiwix/play/listings/en-US/full-description.txt b/app/src/kiwix/play/listings/en-US/full-description.txt deleted file mode 100644 index e54c7c8e6..000000000 --- a/app/src/kiwix/play/listings/en-US/full-description.txt +++ /dev/null @@ -1,7 +0,0 @@ -The whole of Wikipedia on your device! - -The app is a lightweight piece of software reading bigger files stored on your device or SD card: once it is installed, you can select which additional content you would like to download (Wikipedia, Wiktionary, TED talks, etc.) and be ready for when your internet connexion is bad (or need to be in airplane mode)! - -Please read the instructions inside the App or on the website (www.kiwix.org) to learn about the various contents that are available for download. - -Note: Kiwix is also available on regular computers (Windows, Mac, Linux). \ No newline at end of file diff --git a/app/src/kiwix/play/listings/en-US/graphics/feature-graphic/7209965217332169343.png b/app/src/kiwix/play/listings/en-US/graphics/feature-graphic/7209965217332169343.png deleted file mode 100644 index 7cf4d4c5c..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/feature-graphic/7209965217332169343.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/icon/507005201660075566.png b/app/src/kiwix/play/listings/en-US/graphics/icon/507005201660075566.png deleted file mode 100644 index 8265cf666..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/icon/507005201660075566.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/14315334251241934377.png b/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/14315334251241934377.png deleted file mode 100644 index 8cb9ab8bd..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/14315334251241934377.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/14955898928768091051.png b/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/14955898928768091051.png deleted file mode 100644 index 1f9e21fb7..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/14955898928768091051.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/4895873906377025601.png b/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/4895873906377025601.png deleted file mode 100644 index 536f32a53..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/large-tablet-screenshots/4895873906377025601.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/12957392780777855413.png b/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/12957392780777855413.png deleted file mode 100644 index b3e2468f3..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/12957392780777855413.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/13793790037793852896.png b/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/13793790037793852896.png deleted file mode 100644 index 42891b501..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/13793790037793852896.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/15676066886713697503.png b/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/15676066886713697503.png deleted file mode 100644 index 2c193cc4b..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/15676066886713697503.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/18349829269917127347.png b/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/18349829269917127347.png deleted file mode 100644 index de726856b..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/18349829269917127347.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/2489480280473763521.png b/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/2489480280473763521.png deleted file mode 100644 index b248a0986..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/2489480280473763521.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/2595780971964030933.png b/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/2595780971964030933.png deleted file mode 100644 index a15554281..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/2595780971964030933.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/5482826525557510277.png b/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/5482826525557510277.png deleted file mode 100644 index cb7094fcd..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/phone-screenshots/5482826525557510277.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/promo-graphic/11521757336504716721.png b/app/src/kiwix/play/listings/en-US/graphics/promo-graphic/11521757336504716721.png deleted file mode 100644 index ad4f3aeb0..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/promo-graphic/11521757336504716721.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/1680319443657513096.png b/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/1680319443657513096.png deleted file mode 100644 index 1f9e21fb7..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/1680319443657513096.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/5637354942562285789.png b/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/5637354942562285789.png deleted file mode 100644 index 8cb9ab8bd..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/5637354942562285789.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/9076922994365756721.png b/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/9076922994365756721.png deleted file mode 100644 index 536f32a53..000000000 Binary files a/app/src/kiwix/play/listings/en-US/graphics/tablet-screenshots/9076922994365756721.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/en-US/short-description.txt b/app/src/kiwix/play/listings/en-US/short-description.txt deleted file mode 100644 index 9a6ac2188..000000000 --- a/app/src/kiwix/play/listings/en-US/short-description.txt +++ /dev/null @@ -1 +0,0 @@ -Wikipedia (and a lot more) at hand everywhere. No internet required! \ No newline at end of file diff --git a/app/src/kiwix/play/listings/en-US/title.txt b/app/src/kiwix/play/listings/en-US/title.txt deleted file mode 100644 index 836b4ce3b..000000000 --- a/app/src/kiwix/play/listings/en-US/title.txt +++ /dev/null @@ -1 +0,0 @@ -Kiwix, Wikipedia offline \ No newline at end of file diff --git a/app/src/kiwix/play/listings/fr-FR/full-description.txt b/app/src/kiwix/play/listings/fr-FR/full-description.txt deleted file mode 100644 index 94f0e3179..000000000 --- a/app/src/kiwix/play/listings/fr-FR/full-description.txt +++ /dev/null @@ -1,11 +0,0 @@ -Tout Wikipédia dans votre mobile ! - -Kiwix est un lecteur de contenus hors-ligne qui peut être utilisé pour Wikipédia ainsi que d'autres contenus (Documentation Ubuntu, WikiLeaks, WikiVoyage, WikiSource, etc). - -Une fois que vous avez téléchargé le fichier de contenu (potentiellement très gros), vous n'avez plus du tout besoin de connexion pour l'utiliser. - -Kiwix est une application légère utilisant des fichiers ZIM que vous aurez préalablement téléchargé et stocké sur la mémoire externe (carte SD). - -Merci de consulter les instructions d'utilisations dans l'application ainsi que sur le site web pour en savoir plus sur les contenus disponibles. - -Note: Kiwix est aussi disponible sur ordinateur (Windows, Mac, Linux). \ No newline at end of file diff --git a/app/src/kiwix/play/listings/fr-FR/short-description.txt b/app/src/kiwix/play/listings/fr-FR/short-description.txt deleted file mode 100644 index e69990f82..000000000 --- a/app/src/kiwix/play/listings/fr-FR/short-description.txt +++ /dev/null @@ -1 +0,0 @@ -Emportez la Wikipédia partout avec vous ; sans connexion ! \ No newline at end of file diff --git a/app/src/kiwix/play/listings/fr-FR/title.txt b/app/src/kiwix/play/listings/fr-FR/title.txt deleted file mode 100644 index 052e4571f..000000000 --- a/app/src/kiwix/play/listings/fr-FR/title.txt +++ /dev/null @@ -1 +0,0 @@ -Kiwix, Wikipédia sans Internet \ No newline at end of file diff --git a/app/src/kiwix/play/listings/it-IT/full-description.txt b/app/src/kiwix/play/listings/it-IT/full-description.txt deleted file mode 100644 index 2e6c779b9..000000000 --- a/app/src/kiwix/play/listings/it-IT/full-description.txt +++ /dev/null @@ -1,11 +0,0 @@ -L'intera Wikipedia sempre con te! - -Kiwix è un lettore non in linea di contenuti e siti di ogni genere, Wikipedia ma non solo (documentazione di Ubuntu, WikiLeaks, Wikisource, Wikivoyage ecc.). - -Una volta scaricato l'archivio ZIM contenente il tutto (potenzialmente molto grande), non serve alcuna connessione a internet per navigarlo. - -Kiwix è leggero e gli archivi ZIM si possono scaricare e conservare nel tuo apparecchio android o memoria esterna (scheda SD). - -Controlla le istruzioni nell'applicazione e nel sito per sapere di più sui contenuti disponibili. - -Nota, Kiwix è disponibile anche per computer normali (Windows, Mac e Linux). \ No newline at end of file diff --git a/app/src/kiwix/play/listings/it-IT/short-description.txt b/app/src/kiwix/play/listings/it-IT/short-description.txt deleted file mode 100644 index 74547a7f3..000000000 --- a/app/src/kiwix/play/listings/it-IT/short-description.txt +++ /dev/null @@ -1 +0,0 @@ -Wikipedia sempre con te! \ No newline at end of file diff --git a/app/src/kiwix/play/listings/it-IT/title.txt b/app/src/kiwix/play/listings/it-IT/title.txt deleted file mode 100644 index 694905054..000000000 --- a/app/src/kiwix/play/listings/it-IT/title.txt +++ /dev/null @@ -1 +0,0 @@ -Kiwix \ No newline at end of file diff --git a/app/src/kiwix/play/listings/tr-TR/full-description.txt b/app/src/kiwix/play/listings/tr-TR/full-description.txt deleted file mode 100644 index 660878142..000000000 --- a/app/src/kiwix/play/listings/tr-TR/full-description.txt +++ /dev/null @@ -1,5 +0,0 @@ -Vikipedi'nin tamamı cihazınızda! - -Uygulama, cihazınızda veya SD kartta depolanan büyük dosyalar okuyan hafif bir yazılım parçasıdır: yükledikten sonra, hangi ek içerikler indirmek istediğinizi seçebilirsiniz (Vikipedi, Vikisözlük, TED Konferansları, v.b.) ve ne zaman internet bağlantınız kötü olsa, hazır olabilirsiniz (veya uçak modunda olmanız gerekiyorsa) ! - -Indirmek için hazır olan çeşitli içerikler hakkında bilgi edinmek için, lütfen uygulama içindeki veya web sitemizindeki talimatları okuyun (www.kiwix.org) \ No newline at end of file diff --git a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/13317485916924941511.png b/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/13317485916924941511.png deleted file mode 100644 index 55cb17379..000000000 Binary files a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/13317485916924941511.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/15571736726183203438.png b/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/15571736726183203438.png deleted file mode 100644 index 97a50289b..000000000 Binary files a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/15571736726183203438.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/4811421625514189150.png b/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/4811421625514189150.png deleted file mode 100644 index b48138cfb..000000000 Binary files a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/4811421625514189150.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/5147647062453614409.png b/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/5147647062453614409.png deleted file mode 100644 index d607f4f11..000000000 Binary files a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/5147647062453614409.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9222239657918705631.png b/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9222239657918705631.png deleted file mode 100644 index a14b97c80..000000000 Binary files a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9222239657918705631.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9331583797873846829.png b/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9331583797873846829.png deleted file mode 100644 index 8c2fa4dc1..000000000 Binary files a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9331583797873846829.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9608531406290868334.png b/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9608531406290868334.png deleted file mode 100644 index 2229de0c4..000000000 Binary files a/app/src/kiwix/play/listings/tr-TR/graphics/phone-screenshots/9608531406290868334.png and /dev/null differ diff --git a/app/src/kiwix/play/listings/tr-TR/short-description.txt b/app/src/kiwix/play/listings/tr-TR/short-description.txt deleted file mode 100644 index dbc244391..000000000 --- a/app/src/kiwix/play/listings/tr-TR/short-description.txt +++ /dev/null @@ -1 +0,0 @@ -Kiwix ile, Vikipedi tamamıyla telefonunuza veya tabletinize indirin \ No newline at end of file diff --git a/app/src/kiwix/play/listings/tr-TR/title.txt b/app/src/kiwix/play/listings/tr-TR/title.txt deleted file mode 100644 index eccbcc6b6..000000000 --- a/app/src/kiwix/play/listings/tr-TR/title.txt +++ /dev/null @@ -1 +0,0 @@ -Kiwix - offline Vikipedi \ No newline at end of file diff --git a/app/src/kiwix/play/release-notes/en-US/default.txt b/app/src/kiwix/play/release-notes/en-US/default.txt deleted file mode 100644 index 0d134254f..000000000 --- a/app/src/kiwix/play/release-notes/en-US/default.txt +++ /dev/null @@ -1,4 +0,0 @@ -BUGFIX: Some users language was causing a crash due to unstable ISO codes -BUGFIX: Some unstable zim files were crashing when opened -BUGFIX: Long titles were rendering off screen on home page -BUGFIX: Issues when opening a file externally diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d771ec35a..b681008a1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -3,6 +3,23 @@ package="org.kiwix.kiwixmobile"> + + + + + + + + + + + + { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroModule.java b/app/src/main/java/org/kiwix/kiwixmobile/intro/IntroModule.kt similarity index 70% rename from core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroModule.java rename to app/src/main/java/org/kiwix/kiwixmobile/intro/IntroModule.kt index 029cc65f1..1d9bbed21 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroModule.java +++ b/app/src/main/java/org/kiwix/kiwixmobile/intro/IntroModule.kt @@ -15,18 +15,14 @@ * along with this program. If not, see . * */ +package org.kiwix.kiwixmobile.intro -package org.kiwix.kiwixmobile.core.intro; - -import dagger.Module; -import dagger.Provides; -import org.kiwix.kiwixmobile.core.di.ActivityScope; +import dagger.Binds +import dagger.Module +import org.kiwix.kiwixmobile.core.di.ActivityScope @Module -public class IntroModule { - @ActivityScope - @Provides - IntroContract.Presenter provideIntroPresenter(IntroPresenter presenter) { - return presenter; - } +abstract class IntroModule { + @ActivityScope @Binds + abstract fun bindsPresenter(presenter: IntroPresenter): IntroContract.Presenter } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPagerAdapter.java b/app/src/main/java/org/kiwix/kiwixmobile/intro/IntroPagerAdapter.java similarity index 97% rename from core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPagerAdapter.java rename to app/src/main/java/org/kiwix/kiwixmobile/intro/IntroPagerAdapter.java index 14444dd1a..fb7f075dc 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPagerAdapter.java +++ b/app/src/main/java/org/kiwix/kiwixmobile/intro/IntroPagerAdapter.java @@ -16,7 +16,7 @@ * */ -package org.kiwix.kiwixmobile.core.intro; +package org.kiwix.kiwixmobile.intro; import android.view.View; import android.view.ViewGroup; diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPresenter.java b/app/src/main/java/org/kiwix/kiwixmobile/intro/IntroPresenter.java similarity index 88% rename from core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPresenter.java rename to app/src/main/java/org/kiwix/kiwixmobile/intro/IntroPresenter.java index b688b994b..79b8a8934 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/intro/IntroPresenter.java +++ b/app/src/main/java/org/kiwix/kiwixmobile/intro/IntroPresenter.java @@ -16,7 +16,7 @@ * */ -package org.kiwix.kiwixmobile.core.intro; +package org.kiwix.kiwixmobile.intro; import javax.inject.Inject; import org.kiwix.kiwixmobile.core.base.BasePresenter; @@ -24,7 +24,8 @@ import org.kiwix.kiwixmobile.core.di.ActivityScope; import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil; @ActivityScope -class IntroPresenter extends BasePresenter implements IntroContract.Presenter { +public class IntroPresenter extends BasePresenter + implements IntroContract.Presenter { private final SharedPreferenceUtil preferences; @Inject IntroPresenter(SharedPreferenceUtil preferences) { diff --git a/app/src/main/java/org/kiwix/kiwixmobile/splash/KiwixSplashActivity.kt b/app/src/main/java/org/kiwix/kiwixmobile/splash/KiwixSplashActivity.kt new file mode 100644 index 000000000..c3409cae1 --- /dev/null +++ b/app/src/main/java/org/kiwix/kiwixmobile/splash/KiwixSplashActivity.kt @@ -0,0 +1,38 @@ +/* + * Kiwix Android + * Copyright (c) 2019 Kiwix + * 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 . + * + */ + +package org.kiwix.kiwixmobile.splash + +import android.content.Intent +import org.kiwix.kiwixmobile.core.splash.CoreSplashActivity +import org.kiwix.kiwixmobile.intro.IntroActivity +import org.kiwix.kiwixmobile.kiwixActivityComponent +import org.kiwix.kiwixmobile.main.KiwixMainActivity + +class KiwixSplashActivity : CoreSplashActivity() { + + override fun injection() { + kiwixActivityComponent.inject(this) + } + + override val intentForNextScreen: Intent + get() = if (sharedPreferenceUtil.showIntro()) + Intent(this, IntroActivity::class.java) + else + Intent(this, KiwixMainActivity::class.java) +} diff --git a/core/src/main/res/layout/activity_intro.xml b/app/src/main/res/layout/activity_intro.xml similarity index 83% rename from core/src/main/res/layout/activity_intro.xml rename to app/src/main/res/layout/activity_intro.xml index 0d5cd55e9..10d103f3e 100644 --- a/core/src/main/res/layout/activity_intro.xml +++ b/app/src/main/res/layout/activity_intro.xml @@ -4,16 +4,14 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".intro.IntroActivity" - > + tools:context=".intro.IntroActivity"> - + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintStart_toStartOf="parent" /> + app:layout_constraintBottom_toBottomOf="parent" /> diff --git a/core/src/main/res/xml-v25/shortcuts.xml b/app/src/main/res/xml-v25/shortcuts.xml similarity index 85% rename from core/src/main/res/xml-v25/shortcuts.xml rename to app/src/main/res/xml-v25/shortcuts.xml index 1dbf9b063..1c1ca67c6 100644 --- a/core/src/main/res/xml-v25/shortcuts.xml +++ b/app/src/main/res/xml-v25/shortcuts.xml @@ -8,7 +8,7 @@ android:shortcutShortLabel="@string/new_tab_shortcut_label"> @@ -21,7 +21,7 @@ android:shortcutShortLabel="@string/get_content_shortcut_label"> diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt index f9a31ad41..5c86f0f98 100644 --- a/buildSrc/src/main/kotlin/Libs.kt +++ b/buildSrc/src/main/kotlin/Libs.kt @@ -16,8 +16,6 @@ * */ -import kotlin.String - /** * Generated by https://github.com/jmfayard/buildSrcVersions * @@ -26,72 +24,72 @@ import kotlin.String */ object Libs { const val de_fayard_buildsrcversions_gradle_plugin: String = - "de.fayard.buildSrcVersions:de.fayard.buildSrcVersions.gradle.plugin:" + + "de.fayard.buildSrcVersions:de.fayard.buildSrcVersions.gradle.plugin:" + Versions.de_fayard_buildsrcversions_gradle_plugin const val com_github_triplet_play_gradle_plugin: String = - "com.github.triplet.play:com.github.triplet.play.gradle.plugin:" + + "com.github.triplet.play:com.github.triplet.play.gradle.plugin:" + Versions.com_github_triplet_play_gradle_plugin /** * https://developer.android.com/topic/libraries/architecture/index.html */ const val android_arch_lifecycle_extensions: String = "android.arch.lifecycle:extensions:" + - Versions.android_arch_lifecycle_extensions + Versions.android_arch_lifecycle_extensions /** * https://developer.android.com/studio */ const val com_android_tools_build_gradle: String = "com.android.tools.build:gradle:" + - Versions.com_android_tools_build_gradle + Versions.com_android_tools_build_gradle const val androidx_multidex_multidex: String = "androidx.multidex:multidex:" + - Versions.androidx_multidex_multidex + Versions.androidx_multidex_multidex /** * https://github.com/JakeWharton/butterknife/ */ const val butterknife_gradle_plugin: String = "com.jakewharton:butterknife-gradle-plugin:" + - Versions.butterknife_gradle_plugin + Versions.butterknife_gradle_plugin const val multidex_instrumentation: String = "androidx.multidex:multidex-instrumentation:" + - Versions.multidex_instrumentation + Versions.multidex_instrumentation /** * https://developer.android.com/testing */ const val espresso_contrib: String = "androidx.test.espresso:espresso-contrib:" + - Versions.androidx_test_espresso + Versions.androidx_test_espresso /** * https://developer.android.com/testing */ const val espresso_core: String = "androidx.test.espresso:espresso-core:" + - Versions.androidx_test_espresso + Versions.androidx_test_espresso /** * https://developer.android.com/testing */ const val espresso_intents: String = "androidx.test.espresso:espresso-intents:" + - Versions.androidx_test_espresso + Versions.androidx_test_espresso /** * https://developer.android.com/testing */ const val espresso_web: String = "androidx.test.espresso:espresso-web:" + - Versions.androidx_test_espresso + Versions.androidx_test_espresso /** * https://github.com/square/retrofit/ */ const val adapter_rxjava2: String = "com.squareup.retrofit2:adapter-rxjava2:" + - Versions.com_squareup_retrofit2 + Versions.com_squareup_retrofit2 /** * https://github.com/square/retrofit/ */ const val converter_simplexml: String = "com.squareup.retrofit2:converter-simplexml:" + - Versions.com_squareup_retrofit2 + Versions.com_squareup_retrofit2 /** * https://github.com/square/retrofit/ @@ -99,7 +97,7 @@ object Libs { const val retrofit: String = "com.squareup.retrofit2:retrofit:" + Versions.com_squareup_retrofit2 const val play_services_location: String = "com.google.android.gms:play-services-location:" + - Versions.play_services_location + Versions.play_services_location /** * https://developer.android.com/testing @@ -110,43 +108,43 @@ object Libs { * https://github.com/JakeWharton/butterknife/ */ const val butterknife_compiler: String = "com.jakewharton:butterknife-compiler:" + - Versions.butterknife_compiler + Versions.butterknife_compiler /** * http://jcp.org/en/jsr/detail?id=250 */ const val javax_annotation_api: String = "javax.annotation:javax.annotation-api:" + - Versions.javax_annotation_api + Versions.javax_annotation_api /** * https://kotlinlang.org/ */ const val kotlin_android_extensions: String = "org.jetbrains.kotlin:kotlin-android-extensions:" + - Versions.org_jetbrains_kotlin + Versions.org_jetbrains_kotlin /** * https://kotlinlang.org/ */ const val kotlin_android_extensions_runtime: String = - "org.jetbrains.kotlin:kotlin-android-extensions-runtime:" + Versions.org_jetbrains_kotlin + "org.jetbrains.kotlin:kotlin-android-extensions-runtime:" + Versions.org_jetbrains_kotlin /** * https://kotlinlang.org/ */ const val kotlin_annotation_processing_gradle: String = - "org.jetbrains.kotlin:kotlin-annotation-processing-gradle:" + Versions.org_jetbrains_kotlin + "org.jetbrains.kotlin:kotlin-annotation-processing-gradle:" + Versions.org_jetbrains_kotlin /** * https://kotlinlang.org/ */ const val kotlin_gradle_plugin: String = "org.jetbrains.kotlin:kotlin-gradle-plugin:" + - Versions.org_jetbrains_kotlin + Versions.org_jetbrains_kotlin /** * https://kotlinlang.org/ */ const val kotlin_stdlib_jdk7: String = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:" + - Versions.org_jetbrains_kotlin + Versions.org_jetbrains_kotlin /** * https://developer.android.com/testing @@ -157,27 +155,21 @@ object Libs { * https://github.com/square/okhttp */ const val logging_interceptor: String = "com.squareup.okhttp3:logging-interceptor:" + - Versions.logging_interceptor + Versions.logging_interceptor /** * https://developer.android.com/testing */ const val androidx_test_core: String = "androidx.test:core:" + Versions.androidx_test_core - /** - * http://hc.apache.org/httpcomponents-client/ - */ - const val httpclient_android: String = "org.apache.httpcomponents:httpclient-android:" + - Versions.httpclient_android - const val ink_page_indicator: String = "com.pacioianu.david:ink-page-indicator:" + - Versions.ink_page_indicator + Versions.ink_page_indicator /** * http://github.com/square/leakcanary/ */ const val leakcanary_android: String = "com.squareup.leakcanary:leakcanary-android:" + - Versions.leakcanary_android + Versions.leakcanary_android /** * https://github.com/google/dagger @@ -188,19 +180,19 @@ object Libs { * https://github.com/google/dagger */ const val dagger_android: String = "com.google.dagger:dagger-android:" + - Versions.com_google_dagger + Versions.com_google_dagger /** * https://github.com/google/dagger */ const val dagger_android_processor: String = "com.google.dagger:dagger-android-processor:" + - Versions.com_google_dagger + Versions.com_google_dagger /** * https://github.com/google/dagger */ const val dagger_compiler: String = "com.google.dagger:dagger-compiler:" + - Versions.com_google_dagger + Versions.com_google_dagger /** * https://github.com/yahoo/squidb @@ -211,19 +203,19 @@ object Libs { * https://github.com/yahoo/squidb */ const val squidb_annotations: String = "com.yahoo.squidb:squidb-annotations:" + - Versions.com_yahoo_squidb + Versions.com_yahoo_squidb /** * https://github.com/yahoo/squidb */ const val squidb_processor: String = "com.yahoo.squidb:squidb-processor:" + - Versions.com_yahoo_squidb + Versions.com_yahoo_squidb /** * http://tools.android.com */ const val constraintlayout: String = "androidx.constraintlayout:constraintlayout:" + - Versions.constraintlayout + Versions.constraintlayout /** * https://github.com/mockito/mockito @@ -236,7 +228,7 @@ object Libs { const val collection_ktx: String = "androidx.collection:collection-ktx:" + Versions.collection_ktx const val jacoco_android: String = "com.dicedmelon.gradle:jacoco-android:" + - Versions.jacoco_android + Versions.jacoco_android /** * https://junit.org/junit5/ @@ -256,7 +248,7 @@ object Libs { const val testdroid_api: String = "com.testdroid:testdroid-api:" + Versions.testdroid_api const val xfetch2okhttp: String = "androidx.tonyodev.fetch2okhttp:xfetch2okhttp:" + - Versions.xfetch2okhttp + Versions.xfetch2okhttp /** * http://assertj.org @@ -282,7 +274,7 @@ object Libs { * https://objectbox.io */ const val objectbox_gradle_plugin: String = "io.objectbox:objectbox-gradle-plugin:" + - Versions.io_objectbox + Versions.io_objectbox /** * http://objectbox.io @@ -293,7 +285,7 @@ object Libs { * https://objectbox.io */ const val objectbox_processor: String = "io.objectbox:objectbox-processor:" + - Versions.io_objectbox + Versions.io_objectbox /** * http://objectbox.io diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 41df994d7..2dfc38e15 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -16,7 +16,6 @@ * */ -import kotlin.String import org.gradle.plugin.use.PluginDependenciesSpec import org.gradle.plugin.use.PluginDependencySpec @@ -52,7 +51,7 @@ object Versions { const val androidx_test_runner: String = "1.2.0" - const val butterknife_compiler: String = "10.1.0" // available: "10.2.0" + const val butterknife_compiler: String = "10.2.0" const val javax_annotation_api: String = "1.3.2" @@ -64,8 +63,6 @@ object Versions { const val androidx_test_core: String = "1.2.0" - const val httpclient_android: String = "4.3.3" // available: "4.3.5.1" - const val ink_page_indicator: String = "1.3.0" const val leakcanary_android: String = "2.0-alpha-2" @@ -102,7 +99,7 @@ object Versions { const val orchestrator: String = "1.1.0" // available: "1.2.0" - const val butterknife: String = "10.1.0" // available: "10.2.0" + const val butterknife: String = "10.2.0" const val lint_gradle: String = "26.5.0" @@ -160,4 +157,4 @@ object Versions { */ val PluginDependenciesSpec.buildSrcVersions: PluginDependencySpec inline get() = - id("de.fayard.buildSrcVersions").version(Versions.de_fayard_buildsrcversions_gradle_plugin) + id("de.fayard.buildSrcVersions").version(Versions.de_fayard_buildsrcversions_gradle_plugin) diff --git a/core/build.gradle b/core/build.gradle index 3c4d34abb..f69424b00 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -47,8 +47,6 @@ dependencies { // Android Support implementation(Libs.cardview) - // Tab indicator - implementation(Libs.ink_page_indicator) // SquiDB implementation(Libs.squidb) diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index 06e014896..9951aef9a 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -27,24 +27,6 @@ android:usesCleartextTraffic="true" tools:targetApi="m"> - - - - - - - - - - - - - @@ -84,8 +66,6 @@ android:resource="@xml/provider_paths" /> - - + * 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 . + * + */ +package org.kiwix.kiwixmobile.core.splash + +import android.content.Intent +import android.os.Bundle +import android.os.Process +import org.kiwix.kiwixmobile.core.BuildConfig +import org.kiwix.kiwixmobile.core.base.BaseActivity +import org.kiwix.kiwixmobile.core.error.ErrorActivity +import kotlin.system.exitProcess + +abstract class CoreSplashActivity : BaseActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + if (!BuildConfig.DEBUG) { + val appContext = applicationContext + Thread.setDefaultUncaughtExceptionHandler { paramThread: Thread?, + paramThrowable: Throwable? -> + val intent = Intent(appContext, ErrorActivity::class.java) + val extras = Bundle() + extras.putSerializable("exception", paramThrowable) + intent.putExtras(extras) + appContext.startActivity(intent) + finish() + Process.killProcess(Process.myPid()) + exitProcess(10) + } + } + startActivity(intentForNextScreen) + finish() + } + + protected abstract val intentForNextScreen: Intent +} diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/splash/SplashActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/splash/SplashActivity.java deleted file mode 100644 index 35e0049a1..000000000 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/splash/SplashActivity.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Kiwix Android - * Copyright (c) 2019 Kiwix - * 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 . - * - */ -package org.kiwix.kiwixmobile.core.splash; - -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import org.kiwix.kiwixmobile.core.BuildConfig; -import org.kiwix.kiwixmobile.core.Intents; -import org.kiwix.kiwixmobile.core.base.BaseActivity; -import org.kiwix.kiwixmobile.core.error.ErrorActivity; -import org.kiwix.kiwixmobile.core.intro.IntroActivity; -import org.kiwix.kiwixmobile.core.main.CoreMainActivity; - -public class SplashActivity extends BaseActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - if (!BuildConfig.DEBUG) { - Context appContext = getApplicationContext(); - Thread.setDefaultUncaughtExceptionHandler((paramThread, paramThrowable) -> { - - final Intent intent = new Intent(appContext, ErrorActivity.class); - - Bundle extras = new Bundle(); - extras.putSerializable("exception", paramThrowable); - - intent.putExtras(extras); - - appContext.startActivity(intent); - - finish(); - android.os.Process.killProcess(android.os.Process.myPid()); - System.exit(10); - }); - } - - Intent intent; - if (!sharedPreferenceUtil.showIntro()) { - intent = Intents.internal(CoreMainActivity.class); - } else { - intent = new Intent(this, IntroActivity.class); - } - startActivity(intent); - finish(); - } -} diff --git a/custom/src/main/AndroidManifest.xml b/custom/src/main/AndroidManifest.xml index b984597e3..860c9e799 100644 --- a/custom/src/main/AndroidManifest.xml +++ b/custom/src/main/AndroidManifest.xml @@ -4,7 +4,22 @@ + + + + + + + + + + + * 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 . + * + */ + +package org.kiwix.kiwixmobile.custom.splash + +import android.content.Intent +import org.kiwix.kiwixmobile.core.splash.CoreSplashActivity +import org.kiwix.kiwixmobile.custom.customActivityComponent +import org.kiwix.kiwixmobile.custom.main.CustomMainActivity + +class CustomSplashActivity : CoreSplashActivity() { + override fun injection() { + customActivityComponent.inject(this) + } + override val intentForNextScreen: Intent + get() = Intent(this, CustomMainActivity::class.java) +} diff --git a/custom/src/main/res/xml-v25/shortcuts.xml b/custom/src/main/res/xml-v25/shortcuts.xml new file mode 100644 index 000000000..1276a4d4c --- /dev/null +++ b/custom/src/main/res/xml-v25/shortcuts.xml @@ -0,0 +1,13 @@ + + + + +