diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3a8a5ce86..7e221bce1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -87,7 +87,6 @@ - () { - - 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/core/prefs/AppSettings.kt b/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt index 7f67ebcd5..057e7913c 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 @@ -167,8 +167,6 @@ class AppSettings private constructor(private val prefs: SharedPreferences) : const val KEY_READER_SWITCHERS = "reader_switchers" const val KEY_TRACK_SOURCES = "track_sources" const val KEY_TRACK_WARNING = "track_warning" - const val KEY_APP_UPDATE = "app_update" - const val KEY_APP_UPDATE_AUTO = "app_update_auto" const val KEY_TRACKER_NOTIFICATIONS = "tracker_notifications" const val KEY_NOTIFICATIONS_SETTINGS = "notifications_settings" const val KEY_NOTIFICATIONS_SOUND = "notifications_sound" @@ -186,8 +184,11 @@ class AppSettings private constructor(private val prefs: SharedPreferences) : const val KEY_REVERSE_CHAPTERS = "reverse_chapters" // About + const val KEY_APP_UPDATE = "app_update" + const val KEY_APP_UPDATE_AUTO = "app_update_auto" const val KEY_APP_TRANSLATION = "about_app_translation" const val KEY_FEEDBACK_4PDA = "about_feedback_4pda" const val KEY_FEEDBACK_GITHUB = "about_feedback_github" + const val KEY_SUPPORT_DEVELOPER = "about_support_developer" } } \ 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 6c8e88429..2788a6ee0 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,7 +25,6 @@ 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 @@ -196,9 +195,6 @@ 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/about/AboutFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt similarity index 69% rename from app/src/main/java/org/koitharu/kotatsu/about/AboutFragment.kt rename to app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt index 02c2d3738..193a7d282 100644 --- a/app/src/main/java/org/koitharu/kotatsu/about/AboutFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt @@ -1,4 +1,4 @@ -package org.koitharu.kotatsu.about +package org.koitharu.kotatsu.settings.about import android.os.Bundle import android.view.View @@ -12,7 +12,7 @@ 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) { +class AboutSettingsFragment : BasePreferenceFragment(R.string.about) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { addPreferencesFromResource(R.xml.pref_about) @@ -37,15 +37,27 @@ class AboutFragment : BasePreferenceFragment(R.string.about) { true } AppSettings.KEY_APP_TRANSLATION -> { - startActivity(context?.let { BrowserActivity.newIntent(it, "https://hosted.weblate.org/engage/kotatsu", resources.getString(R.string.about_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)) }) + 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") }) + startActivity(context?.let { BrowserActivity.newIntent(it, + "https://4pda.to/forum/index.php?showtopic=697669", + resources.getString(R.string.about_feedback_4pda)) }) + true + } + AppSettings.KEY_SUPPORT_DEVELOPER -> { + startActivity(context?.let { BrowserActivity.newIntent(it, + "https://4pda.to/forum/index.php?showtopic=697669", + resources.getString(R.string.about_support_developer)) }) true } else -> super.onPreferenceTreeClick(preference) diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/about/CopyrightFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/about/CopyrightFragment.kt new file mode 100644 index 000000000..3f134492d --- /dev/null +++ b/app/src/main/java/org/koitharu/kotatsu/settings/about/CopyrightFragment.kt @@ -0,0 +1,42 @@ +package org.koitharu.kotatsu.settings.about + +import android.os.Bundle +import android.text.SpannableStringBuilder +import android.text.method.LinkMovementMethod +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.core.graphics.Insets +import androidx.core.text.HtmlCompat +import androidx.core.text.parseAsHtml +import androidx.core.view.updatePadding +import org.koitharu.kotatsu.R +import org.koitharu.kotatsu.base.ui.BaseFragment +import org.koitharu.kotatsu.databinding.FragmentCopyrightBinding + +class CopyrightFragment : BaseFragment() { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.textView.apply { + text = + SpannableStringBuilder(resources.openRawResource(R.raw.copyright).bufferedReader() + .readText() + .parseAsHtml(HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST)) + movementMethod = LinkMovementMethod.getInstance() + } + } + + override fun onInflateView( + inflater: LayoutInflater, + container: ViewGroup? + ) = FragmentCopyrightBinding.inflate(inflater, container, false) + + override fun onResume() { + super.onResume() + activity?.setTitle(R.string.about_copyright) + } + + override fun onWindowInsetsChanged(insets: Insets) = Unit + +} \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/about/GratitudesFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/about/GratitudesFragment.kt new file mode 100644 index 000000000..3a1a0ddd8 --- /dev/null +++ b/app/src/main/java/org/koitharu/kotatsu/settings/about/GratitudesFragment.kt @@ -0,0 +1,42 @@ +package org.koitharu.kotatsu.settings.about + +import android.os.Bundle +import android.text.SpannableStringBuilder +import android.text.method.LinkMovementMethod +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.core.graphics.Insets +import androidx.core.text.HtmlCompat +import androidx.core.text.parseAsHtml +import androidx.core.view.updatePadding +import org.koitharu.kotatsu.R +import org.koitharu.kotatsu.base.ui.BaseFragment +import org.koitharu.kotatsu.databinding.FragmentGratitudesBinding + +class GratitudesFragment : BaseFragment() { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.textView.apply { + text = + SpannableStringBuilder(resources.openRawResource(R.raw.gratitudes).bufferedReader() + .readText() + .parseAsHtml(HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST)) + movementMethod = LinkMovementMethod.getInstance() + } + } + + override fun onInflateView( + inflater: LayoutInflater, + container: ViewGroup? + ) = FragmentGratitudesBinding.inflate(inflater, container, false) + + override fun onResume() { + super.onResume() + activity?.setTitle(R.string.about_gratitudes) + } + + override fun onWindowInsetsChanged(insets: Insets) = Unit + +} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_copyright.xml b/app/src/main/res/drawable/ic_copyright.xml new file mode 100644 index 000000000..7cb1adcdc --- /dev/null +++ b/app/src/main/res/drawable/ic_copyright.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/fragment_copyright.xml b/app/src/main/res/layout/fragment_copyright.xml new file mode 100644 index 000000000..d77f49e1d --- /dev/null +++ b/app/src/main/res/layout/fragment_copyright.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_gratitudes.xml b/app/src/main/res/layout/fragment_gratitudes.xml new file mode 100644 index 000000000..d77f49e1d --- /dev/null +++ b/app/src/main/res/layout/fragment_gratitudes.xml @@ -0,0 +1,15 @@ + + + + + + \ 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 f55898559..75869c7a7 100644 --- a/app/src/main/res/menu/nav_drawer.xml +++ b/app/src/main/res/menu/nav_drawer.xml @@ -37,9 +37,5 @@ 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/raw-ru/gratitudes b/app/src/main/res/raw-ru/gratitudes new file mode 100644 index 000000000..4d74c4cac --- /dev/null +++ b/app/src/main/res/raw-ru/gratitudes @@ -0,0 +1,5 @@ +Благодарности:
+

Zakhar Timoshenko (Xtimms) - активная помощь в разработке в плане пользовательского интерфейса и перевод на белорусский язык

+

Allan Nordhøy (comradekingu) - перевод на норвежский букмол

+

sguinetti - перевод на испанский

+

J. Lavoie - перевод на французский, итальянский и немецкий

\ No newline at end of file diff --git a/app/src/main/res/raw/copyright b/app/src/main/res/raw/copyright new file mode 100644 index 000000000..bf4212730 --- /dev/null +++ b/app/src/main/res/raw/copyright @@ -0,0 +1,24 @@ +

Kotatsu is a free and open source manga reader for Android.

+

Copyright (C) 2020 by Koitharu

+

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/.

+

Open Source Licenses

+ \ No newline at end of file diff --git a/app/src/main/res/raw/gratitudes b/app/src/main/res/raw/gratitudes new file mode 100644 index 000000000..fbf8de215 --- /dev/null +++ b/app/src/main/res/raw/gratitudes @@ -0,0 +1,5 @@ +Thanks:
+

Zakhar Timoshenko (Xtimms) - active assistance in the development from the point of view of the UI and translation into the Belarusian language

+

Allan Nordhøy (comradekingu) - Norwegian Bokmål translation

+

sguinetti - Spanish translation

+

J. Lavoie - French, German and Italian translation

\ 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 fb6c6d6fe..8a2e65b13 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -227,4 +227,10 @@ Автор Тема на 4PDA Обратная связь + Поддержать разработчика + Если вам нравится это приложение, вы можете помочь финансово с помощью ЮMoney (бывш. Яндекс.Деньги) + Благодарности + Эти люди помогают Kotatsu стать лучше! + Авторские права и лицензии + Авторские права \ 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 b2b753608..0f844b714 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -230,4 +230,10 @@ Author Feedback Topic on 4PDA + Support the developer + If you like this app, you can help financially through Yoomoney (ex. Yandex.Money) + Gratitudes + These people make Kotatsu become better! + Copyright & Licenses + Copyright \ 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 index cd7919264..dcc47a0cc 100644 --- a/app/src/main/res/xml/pref_about.xml +++ b/app/src/main/res/xml/pref_about.xml @@ -1,7 +1,9 @@ + xmlns:tools="http://schemas.android.com/tools" + app:initialExpandedChildrenCount="5"> + + + + + + + + + + + \ 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 0a5948c24..7f9d8bf84 100644 --- a/app/src/main/res/xml/pref_main.xml +++ b/app/src/main/res/xml/pref_main.xml @@ -84,4 +84,9 @@ android:title="@string/backup_restore" app:iconSpaceReserved="false" /> + + \ No newline at end of file