Some changes in about section, fix links

This commit is contained in:
Zakhar Timoshenko
2021-08-03 20:11:18 +03:00
committed by Koitharu
parent 253f4abba1
commit eb5976a796
11 changed files with 34 additions and 75 deletions

View File

@@ -187,6 +187,7 @@ class AppSettings private constructor(private val prefs: SharedPreferences) :
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_APP_GRATITUDES = "about_gratitudes"
const val KEY_FEEDBACK_4PDA = "about_feedback_4pda"
const val KEY_FEEDBACK_GITHUB = "about_feedback_github"
const val KEY_SUPPORT_DEVELOPER = "about_support_developer"

View File

@@ -50,16 +50,22 @@ class AboutSettingsFragment : BasePreferenceFragment(R.string.about) {
}
AppSettings.KEY_FEEDBACK_GITHUB -> {
startActivity(context?.let { BrowserActivity.newIntent(it,
"https://4pda.to/forum/index.php?showtopic=697669",
resources.getString(R.string.about_feedback_4pda)) })
"https://github.com/nv95/Kotatsu/issues",
"GitHub") })
true
}
AppSettings.KEY_SUPPORT_DEVELOPER -> {
startActivity(context?.let { BrowserActivity.newIntent(it,
"https://4pda.to/forum/index.php?showtopic=697669",
"https://yoomoney.ru/to/410012543938752",
resources.getString(R.string.about_support_developer)) })
true
}
AppSettings.KEY_APP_GRATITUDES -> {
startActivity(context?.let { BrowserActivity.newIntent(it,
"https://github.com/nv95/Kotatsu/graphs/contributors",
resources.getString(R.string.about_gratitudes)) })
true
}
else -> super.onPreferenceTreeClick(preference)
}
}

View File

@@ -1,42 +0,0 @@
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<FragmentGratitudesBinding>() {
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
}

View File

@@ -9,12 +9,11 @@ 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<FragmentCopyrightBinding>() {
class LicenseFragment : BaseFragment<FragmentCopyrightBinding>() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
@@ -34,7 +33,7 @@ class CopyrightFragment : BaseFragment<FragmentCopyrightBinding>() {
override fun onResume() {
super.onResume()
activity?.setTitle(R.string.about_copyright)
activity?.setTitle(R.string.about_license)
}
override fun onWindowInsetsChanged(insets: Insets) = Unit

View File

@@ -0,0 +1,16 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M11.9653,11.9653m-8.6321,0a8.6321,8.6321 0,1 1,17.2642 0a8.6321,8.6321 0,1 1,-17.2642 0"
android:strokeWidth="2"
android:strokeColor="@android:color/white" />
<path
android:fillColor="@android:color/white"
android:pathData="m6.8889,10.7775l2.4533,0a2.8091,2.8707 0,1 1,0 2.3923l-2.4533,0a5.1501,5.263 0,1 0,0 -2.3923z"
android:strokeWidth="1" />
</vector>

View File

@@ -1,10 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M11.88,9.14c1.28,0.06 1.61,1.15 1.63,1.66h1.79c-0.08,-1.98 -1.49,-3.19 -3.45,-3.19C9.64,7.61 8,9 8,12.14c0,1.94 0.93,4.24 3.84,4.24c2.22,0 3.41,-1.65 3.44,-2.95h-1.79c-0.03,0.59 -0.45,1.38 -1.63,1.44C10.55,14.83 10,13.81 10,12.14C10,9.25 11.28,9.16 11.88,9.14zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8s8,3.59 8,8S16.41,20 12,20z"/>
</vector>

View File

@@ -1,5 +0,0 @@
<b>Благодарности:</b><br>
<p><a href="https://github.com/ztimms73">Zakhar Timoshenko (Xtimms)</a> - активная помощь в разработке в плане пользовательского интерфейса и перевод на белорусский язык</p>
<p><a href="https://github.com/comradekingu">Allan Nordhøy (comradekingu)</a> - перевод на норвежский букмол</p>
<p><a href="https://github.com/sguinetti">sguinetti</a> - перевод на испанский</p>
<p>J. Lavoie - перевод на французский, итальянский и немецкий</p>

View File

@@ -1,5 +0,0 @@
<b>Thanks:</b><br>
<p><a href="https://github.com/ztimms73">Zakhar Timoshenko (Xtimms)</a> - active assistance in the development from the point of view of the UI and translation into the Belarusian language</p>
<p><a href="https://github.com/comradekingu">Allan Nordhøy (comradekingu)</a> - Norwegian Bokmål translation</p>
<p><a href="https://github.com/sguinetti">sguinetti</a> - Spanish translation</p>
<p>J. Lavoie - French, German and Italian translation</p>

View File

@@ -232,5 +232,5 @@
<string name="about_gratitudes">Благодарности</string>
<string name="about_gratitudes_summary">Эти люди помогают Kotatsu стать лучше!</string>
<string name="about_copyright_and_licenses">Авторские права и лицензии</string>
<string name="about_copyright">Авторские права</string>
<string name="about_license">Лицензия</string>
</resources>

View File

@@ -235,5 +235,5 @@
<string name="about_gratitudes">Gratitudes</string>
<string name="about_gratitudes_summary">These people make Kotatsu become better!</string>
<string name="about_copyright_and_licenses">Copyright &amp; Licenses</string>
<string name="about_copyright">Copyright</string>
<string name="about_license">License</string>
</resources>

View File

@@ -37,7 +37,6 @@
app:title="@string/about_support_developer" />
<Preference
android:fragment="org.koitharu.kotatsu.settings.about.GratitudesFragment"
app:iconSpaceReserved="false"
app:key="about_gratitudes"
app:summary="@string/about_gratitudes_summary"
@@ -66,11 +65,11 @@
app:title="@string/about_copyright_and_licenses">
<Preference
android:fragment="org.koitharu.kotatsu.settings.about.CopyrightFragment"
app:icon="@drawable/ic_copyright"
android:fragment="org.koitharu.kotatsu.settings.about.LicenseFragment"
app:icon="@drawable/ic_copyleft"
app:iconSpaceReserved="false"
app:key="about_copyright"
app:title="@string/about_copyright" />
app:key="about_license"
app:title="@string/about_license" />
</PreferenceCategory>