diff --git a/app/src/main/java/org/kiwix/kiwixmobile/main/KiwixMainActivity.kt b/app/src/main/java/org/kiwix/kiwixmobile/main/KiwixMainActivity.kt index 02292eb43..848d3a59a 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/main/KiwixMainActivity.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/main/KiwixMainActivity.kt @@ -25,7 +25,7 @@ import android.widget.Toast import androidx.core.net.toFile import androidx.core.net.toUri import org.json.JSONArray -import org.kiwix.kiwixmobile.core.R +import org.kiwix.kiwixmobile.R import org.kiwix.kiwixmobile.core.extensions.ActivityExtensions.start import org.kiwix.kiwixmobile.core.extensions.toast import org.kiwix.kiwixmobile.core.main.CoreMainActivity @@ -107,6 +107,8 @@ class KiwixMainActivity : CoreMainActivity() { override fun hasValidFileAndUrl(url: String?, zimFileReader: ZimFileReader?) = super.hasValidFileAndUrl(url, zimFileReader) && url != HOME_URL + override fun getIconResId() = R.mipmap.ic_launcher + override fun urlIsInvalid() = super.urlIsInvalid() || currentWebView.url == HOME_URL diff --git a/app/src/main/java/org/kiwix/kiwixmobile/webserver/wifi_hotspot/HotspotNotificationManager.java b/app/src/main/java/org/kiwix/kiwixmobile/webserver/wifi_hotspot/HotspotNotificationManager.java index 4d48c1e85..98d9c4ac5 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/webserver/wifi_hotspot/HotspotNotificationManager.java +++ b/app/src/main/java/org/kiwix/kiwixmobile/webserver/wifi_hotspot/HotspotNotificationManager.java @@ -28,7 +28,7 @@ import android.os.Build; import androidx.annotation.NonNull; import androidx.core.app.NotificationCompat; import javax.inject.Inject; -import org.kiwix.kiwixmobile.core.R; +import org.kiwix.kiwixmobile.R; import org.kiwix.kiwixmobile.core.utils.Constants; import org.kiwix.kiwixmobile.webserver.ZimHostActivity; diff --git a/core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/core/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from core/src/main/res/mipmap-hdpi/ic_launcher.png rename to app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/core/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png similarity index 100% rename from core/src/main/res/mipmap-hdpi/ic_launcher_foreground.png rename to app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png diff --git a/core/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from core/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/core/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from core/src/main/res/mipmap-mdpi/ic_launcher.png rename to app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/core/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png similarity index 100% rename from core/src/main/res/mipmap-mdpi/ic_launcher_foreground.png rename to app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png diff --git a/core/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from core/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/core/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from core/src/main/res/mipmap-xhdpi/ic_launcher.png rename to app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png similarity index 100% rename from core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png rename to app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png diff --git a/core/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from core/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/core/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from core/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png similarity index 100% rename from core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png rename to app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png diff --git a/core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/core/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from core/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png similarity index 100% rename from core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png rename to app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png diff --git a/core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.java index 519b8a889..c92330013 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.java @@ -598,10 +598,12 @@ public abstract class CoreMainActivity extends BaseActivity tempVisitCount = 0; visitCounterPref.setCount(tempVisitCount); }) - .setIcon(ContextCompat.getDrawable(this, R.mipmap.ic_launcher)) + .setIcon(ContextCompat.getDrawable(this, getIconResId())) .show(); } + protected abstract int getIconResId(); + private void goToSearch(boolean isVoice) { final String zimFile = zimReaderContainer.getZimCanonicalPath(); saveTabStates(); diff --git a/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomMainActivity.kt b/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomMainActivity.kt index fd3fce922..5993fbf26 100644 --- a/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomMainActivity.kt +++ b/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomMainActivity.kt @@ -21,13 +21,13 @@ package org.kiwix.kiwixmobile.custom.main import android.os.Bundle import android.util.Log import android.view.Menu -import org.kiwix.kiwixmobile.core.R import org.kiwix.kiwixmobile.core.extensions.ActivityExtensions.start import org.kiwix.kiwixmobile.core.main.CoreMainActivity import org.kiwix.kiwixmobile.core.main.WebViewCallback import org.kiwix.kiwixmobile.core.reader.ZimReaderContainer import org.kiwix.kiwixmobile.core.utils.LanguageUtils import org.kiwix.kiwixmobile.custom.BuildConfig +import org.kiwix.kiwixmobile.custom.R import org.kiwix.kiwixmobile.custom.customActivityComponent import org.kiwix.kiwixmobile.custom.download.CustomDownloadActivity import org.kiwix.kiwixmobile.custom.main.ValidationState.HasBothFiles @@ -83,6 +83,8 @@ class CustomMainActivity : CoreMainActivity() { zimReaderContainer: ZimReaderContainer ) = CustomWebViewClient(webViewCallback, zimReaderContainer) + override fun getIconResId() = R.mipmap.ic_launcher + private fun requireEnforcedLanguage(): Boolean { val currentLocaleCode = Locale.getDefault().toString() if (BuildConfig.ENFORCED_LANG.isNotEmpty() && BuildConfig.ENFORCED_LANG != currentLocaleCode) {