diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7e221bce1..3a8a5ce86 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -87,6 +87,7 @@
+
() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(ActivityAboutBinding.inflate(layoutInflater))
+ supportActionBar?.apply {
+ setDisplayHomeAsUpEnabled(true)
+ setTitle(R.string.about)
+ }
+ }
+
+ override fun onWindowInsetsChanged(insets: Insets) {
+ binding.toolbar.updatePadding(
+ top = insets.top,
+ left = insets.left,
+ right = insets.right
+ )
+ }
+
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ if (item.itemId == android.R.id.home) {
+ onBackPressed()
+ return true
+ }
+ return super.onOptionsItemSelected(item)
+ }
+
+ companion object {
+
+ fun newIntent(context: Context) = Intent(context, AboutActivity::class.java)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/koitharu/kotatsu/about/AboutFragment.kt b/app/src/main/java/org/koitharu/kotatsu/about/AboutFragment.kt
new file mode 100644
index 000000000..02c2d3738
--- /dev/null
+++ b/app/src/main/java/org/koitharu/kotatsu/about/AboutFragment.kt
@@ -0,0 +1,74 @@
+package org.koitharu.kotatsu.about
+
+import android.os.Bundle
+import android.view.View
+import androidx.preference.Preference
+import kotlinx.coroutines.launch
+import org.koitharu.kotatsu.BuildConfig
+import org.koitharu.kotatsu.R
+import org.koitharu.kotatsu.base.ui.BasePreferenceFragment
+import org.koitharu.kotatsu.browser.BrowserActivity
+import org.koitharu.kotatsu.core.prefs.AppSettings
+import org.koitharu.kotatsu.settings.AppUpdateChecker
+import org.koitharu.kotatsu.utils.ext.viewLifecycleScope
+
+class AboutFragment : BasePreferenceFragment(R.string.about) {
+
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ addPreferencesFromResource(R.xml.pref_about)
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ findPreference(AppSettings.KEY_APP_UPDATE_AUTO)?.run {
+ isVisible = AppUpdateChecker.isUpdateSupported(context)
+ }
+ findPreference(AppSettings.KEY_APP_VERSION)?.run {
+ title = getString(R.string.app_version, BuildConfig.VERSION_NAME)
+ isEnabled = AppUpdateChecker.isUpdateSupported(context)
+ }
+ }
+
+
+ override fun onPreferenceTreeClick(preference: Preference?): Boolean {
+ return when (preference?.key) {
+ AppSettings.KEY_APP_VERSION -> {
+ checkForUpdates()
+ true
+ }
+ AppSettings.KEY_APP_TRANSLATION -> {
+ startActivity(context?.let { BrowserActivity.newIntent(it, "https://hosted.weblate.org/engage/kotatsu", resources.getString(R.string.about_app_translation)) })
+ true
+ }
+ AppSettings.KEY_FEEDBACK_4PDA -> {
+ startActivity(context?.let { BrowserActivity.newIntent(it, "https://4pda.to/forum/index.php?showtopic=697669", resources.getString(R.string.about_feedback_4pda)) })
+ true
+ }
+ AppSettings.KEY_FEEDBACK_GITHUB -> {
+ startActivity(context?.let { BrowserActivity.newIntent(it, "https://github.com/nv95/Kotatsu/issues", "GitHub") })
+ true
+ }
+ else -> super.onPreferenceTreeClick(preference)
+ }
+ }
+
+ private fun checkForUpdates() {
+ viewLifecycleScope.launch {
+ findPreference(AppSettings.KEY_APP_VERSION)?.run {
+ setSummary(R.string.checking_for_updates)
+ isSelectable = false
+ }
+ val result = AppUpdateChecker(activity ?: return@launch).checkNow()
+ findPreference(AppSettings.KEY_APP_VERSION)?.run {
+ setSummary(
+ when (result) {
+ true -> R.string.check_for_updates
+ false -> R.string.no_update_available
+ null -> R.string.update_check_failed
+ }
+ )
+ isSelectable = true
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt b/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt
index 370f69720..7f67ebcd5 100644
--- a/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt
+++ b/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt
@@ -184,5 +184,10 @@ class AppSettings private constructor(private val prefs: SharedPreferences) :
const val KEY_RESTORE = "restore"
const val KEY_HISTORY_GROUPING = "history_grouping"
const val KEY_REVERSE_CHAPTERS = "reverse_chapters"
+
+ // About
+ const val KEY_APP_TRANSLATION = "about_app_translation"
+ const val KEY_FEEDBACK_4PDA = "about_feedback_4pda"
+ const val KEY_FEEDBACK_GITHUB = "about_feedback_github"
}
}
\ No newline at end of file
diff --git a/app/src/main/java/org/koitharu/kotatsu/main/ui/MainActivity.kt b/app/src/main/java/org/koitharu/kotatsu/main/ui/MainActivity.kt
index 2788a6ee0..6c8e88429 100644
--- a/app/src/main/java/org/koitharu/kotatsu/main/ui/MainActivity.kt
+++ b/app/src/main/java/org/koitharu/kotatsu/main/ui/MainActivity.kt
@@ -25,6 +25,7 @@ import com.google.android.material.snackbar.Snackbar
import org.koin.android.ext.android.get
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koitharu.kotatsu.R
+import org.koitharu.kotatsu.about.AboutActivity
import org.koitharu.kotatsu.base.ui.BaseActivity
import org.koitharu.kotatsu.core.model.Manga
import org.koitharu.kotatsu.core.model.MangaSource
@@ -195,6 +196,9 @@ class MainActivity : BaseActivity(),
startActivity(SettingsActivity.newIntent(this))
return true
}
+ R.id.nav_action_about -> {
+ startActivity(AboutActivity.newIntent(this))
+ }
else -> return false
}
}
diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt
index 388059e99..a61eaa361 100644
--- a/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt
+++ b/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt
@@ -44,19 +44,12 @@ class MainSettingsFragment : BasePreferenceFragment(R.string.settings),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
- findPreference(AppSettings.KEY_APP_UPDATE_AUTO)?.run {
- isVisible = AppUpdateChecker.isUpdateSupported(context)
- }
findPreference(AppSettings.KEY_LOCAL_STORAGE)?.run {
summary = settings.getStorageDir(context)?.getStorageName(context)
?: getString(R.string.not_available)
}
findPreference(AppSettings.KEY_PROTECT_APP)?.isChecked =
!settings.appPassword.isNullOrEmpty()
- findPreference(AppSettings.KEY_APP_VERSION)?.run {
- title = getString(R.string.app_version, BuildConfig.VERSION_NAME)
- isEnabled = AppUpdateChecker.isUpdateSupported(context)
- }
settings.subscribe(this)
}
@@ -120,10 +113,6 @@ class MainSettingsFragment : BasePreferenceFragment(R.string.settings),
}
true
}
- AppSettings.KEY_APP_VERSION -> {
- checkForUpdates()
- true
- }
else -> super.onPreferenceTreeClick(preference)
}
}
@@ -181,24 +170,4 @@ class MainSettingsFragment : BasePreferenceFragment(R.string.settings),
.create()
.show()
}
-
- private fun checkForUpdates() {
- viewLifecycleScope.launch {
- findPreference(AppSettings.KEY_APP_VERSION)?.run {
- setSummary(R.string.checking_for_updates)
- isSelectable = false
- }
- val result = AppUpdateChecker(activity ?: return@launch).checkNow()
- findPreference(AppSettings.KEY_APP_VERSION)?.run {
- setSummary(
- when (result) {
- true -> R.string.check_for_updates
- false -> R.string.no_update_available
- null -> R.string.update_check_failed
- }
- )
- isSelectable = true
- }
- }
- }
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml
new file mode 100644
index 000000000..80d17b028
--- /dev/null
+++ b/app/src/main/res/layout/activity_about.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/nav_drawer.xml b/app/src/main/res/menu/nav_drawer.xml
index 75869c7a7..f55898559 100644
--- a/app/src/main/res/menu/nav_drawer.xml
+++ b/app/src/main/res/menu/nav_drawer.xml
@@ -37,5 +37,9 @@
android:id="@+id/nav_action_settings"
android:icon="@drawable/ic_settings"
android:title="@string/settings" />
+
\ No newline at end of file
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 35cfc2e73..fb6c6d6fe 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -222,4 +222,9 @@
На данный момент нет активных загрузок
Глава отсутствует
Эта глава отсутствует на вашем устройстве. Скачайте её или прочитайте онлайн
+ Помочь с переводом приложения
+ Перевод
+ Автор
+ Тема на 4PDA
+ Обратная связь
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3c354bd6c..b2b753608 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -225,4 +225,9 @@
There are currently no active downloads
This chapter is missing on your device. Download or read it online.
Chapter is missing
+ Translate this app
+ Translation
+ Author
+ Feedback
+ Topic on 4PDA
\ No newline at end of file
diff --git a/app/src/main/res/xml/pref_about.xml b/app/src/main/res/xml/pref_about.xml
new file mode 100644
index 000000000..cd7919264
--- /dev/null
+++ b/app/src/main/res/xml/pref_about.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/pref_main.xml b/app/src/main/res/xml/pref_main.xml
index a8613f904..0a5948c24 100644
--- a/app/src/main/res/xml/pref_main.xml
+++ b/app/src/main/res/xml/pref_main.xml
@@ -79,30 +79,9 @@
android:title="@string/new_chapters_checking"
app:iconSpaceReserved="false" />
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file