diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 837ee29cb..6c6c112b8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -58,15 +58,6 @@ - - - - - - { - startActivity(SimpleSettingsActivity.newReaderSettingsIntent(this)) + startActivity(SettingsActivity.newReaderSettingsIntent(this)) } R.id.action_chapters -> { ChaptersBottomSheet.show( diff --git a/app/src/main/java/org/koitharu/kotatsu/reader/ui/SimpleSettingsActivity.kt b/app/src/main/java/org/koitharu/kotatsu/reader/ui/SimpleSettingsActivity.kt deleted file mode 100644 index 049a9de5b..000000000 --- a/app/src/main/java/org/koitharu/kotatsu/reader/ui/SimpleSettingsActivity.kt +++ /dev/null @@ -1,80 +0,0 @@ -package org.koitharu.kotatsu.reader.ui - -import android.content.Context -import android.content.Intent -import android.os.Bundle -import android.view.ViewGroup -import androidx.core.graphics.Insets -import androidx.core.view.updateLayoutParams -import androidx.core.view.updatePadding -import androidx.fragment.app.commit -import com.google.android.material.appbar.AppBarLayout -import org.koitharu.kotatsu.BuildConfig -import org.koitharu.kotatsu.R -import org.koitharu.kotatsu.base.ui.BaseActivity -import org.koitharu.kotatsu.databinding.ActivitySettingsSimpleBinding -import org.koitharu.kotatsu.main.ui.AppBarOwner -import org.koitharu.kotatsu.parsers.model.MangaSource -import org.koitharu.kotatsu.settings.* - -class SimpleSettingsActivity : BaseActivity(), AppBarOwner { - - override val appBar: AppBarLayout - get() = binding.appbar - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(ActivitySettingsSimpleBinding.inflate(layoutInflater)) - supportActionBar?.setDisplayHomeAsUpEnabled(true) - supportFragmentManager.commit { - replace( - R.id.container, - when (intent?.action) { - Intent.ACTION_MANAGE_NETWORK_USAGE -> NetworkSettingsFragment() - ACTION_READER -> ReaderSettingsFragment() - ACTION_SUGGESTIONS -> SuggestionsSettingsFragment() - ACTION_SOURCE -> SourceSettingsFragment.newInstance( - intent.getSerializableExtra(EXTRA_SOURCE) as? MangaSource ?: MangaSource.LOCAL - ) - else -> MainSettingsFragment() - } - ) - } - } - - override fun onWindowInsetsChanged(insets: Insets) { - with(binding.toolbar) { - updatePadding( - left = insets.left, - right = insets.right - ) - updateLayoutParams { - topMargin = insets.top - } - } - } - - companion object { - - private const val ACTION_READER = - "${BuildConfig.APPLICATION_ID}.action.MANAGE_READER_SETTINGS" - private const val ACTION_SUGGESTIONS = - "${BuildConfig.APPLICATION_ID}.action.MANAGE_SUGGESTIONS" - private const val ACTION_SOURCE = - "${BuildConfig.APPLICATION_ID}.action.MANAGE_SOURCE_SETTINGS" - private const val EXTRA_SOURCE = "source" - - fun newReaderSettingsIntent(context: Context) = - Intent(context, SimpleSettingsActivity::class.java) - .setAction(ACTION_READER) - - fun newSuggestionsSettingsIntent(context: Context) = - Intent(context, SimpleSettingsActivity::class.java) - .setAction(ACTION_SUGGESTIONS) - - fun newSourceSettingsIntent(context: Context, source: MangaSource) = - Intent(context, SimpleSettingsActivity::class.java) - .setAction(ACTION_SOURCE) - .putExtra(EXTRA_SOURCE, source) - } -} \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/remotelist/ui/RemoteListFragment.kt b/app/src/main/java/org/koitharu/kotatsu/remotelist/ui/RemoteListFragment.kt index 2df3aa5db..8c9cff562 100644 --- a/app/src/main/java/org/koitharu/kotatsu/remotelist/ui/RemoteListFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/remotelist/ui/RemoteListFragment.kt @@ -9,7 +9,7 @@ import org.koitharu.kotatsu.R import org.koitharu.kotatsu.list.ui.MangaListFragment import org.koitharu.kotatsu.list.ui.filter.FilterBottomSheet import org.koitharu.kotatsu.parsers.model.MangaSource -import org.koitharu.kotatsu.reader.ui.SimpleSettingsActivity +import org.koitharu.kotatsu.settings.SettingsActivity import org.koitharu.kotatsu.utils.ext.serializableArgument import org.koitharu.kotatsu.utils.ext.withArgs @@ -34,10 +34,7 @@ class RemoteListFragment : MangaListFragment() { return when (item.itemId) { R.id.action_source_settings -> { startActivity( - SimpleSettingsActivity.newSourceSettingsIntent( - context ?: return false, - source, - ) + SettingsActivity.newSourceSettingsIntent(context ?: return false, source) ) true } diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/AppearanceSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/AppearanceSettingsFragment.kt new file mode 100644 index 000000000..aca880ea1 --- /dev/null +++ b/app/src/main/java/org/koitharu/kotatsu/settings/AppearanceSettingsFragment.kt @@ -0,0 +1,100 @@ +package org.koitharu.kotatsu.settings + +import android.content.Intent +import android.content.SharedPreferences +import android.os.Bundle +import android.view.View +import androidx.appcompat.app.AppCompatDelegate +import androidx.preference.ListPreference +import androidx.preference.Preference +import androidx.preference.TwoStatePreference +import org.koitharu.kotatsu.R +import org.koitharu.kotatsu.base.ui.BasePreferenceFragment +import org.koitharu.kotatsu.core.prefs.AppSettings +import org.koitharu.kotatsu.core.prefs.ListMode +import org.koitharu.kotatsu.settings.protect.ProtectSetupActivity +import org.koitharu.kotatsu.settings.utils.SliderPreference +import org.koitharu.kotatsu.utils.ext.names +import org.koitharu.kotatsu.utils.ext.setDefaultValueCompat +import java.util.* + +class AppearanceSettingsFragment : + BasePreferenceFragment(R.string.appearance), + SharedPreferences.OnSharedPreferenceChangeListener { + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + addPreferencesFromResource(R.xml.pref_appearance) + findPreference(AppSettings.KEY_GRID_SIZE)?.run { + summary = "%d%%".format(value) + setOnPreferenceChangeListener { preference, newValue -> + preference.summary = "%d%%".format(newValue) + true + } + } + preferenceScreen?.findPreference(AppSettings.KEY_LIST_MODE)?.run { + entryValues = ListMode.values().names() + setDefaultValueCompat(ListMode.GRID.name) + } + findPreference(AppSettings.KEY_DYNAMIC_THEME)?.isVisible = AppSettings.isDynamicColorAvailable + findPreference(AppSettings.KEY_DATE_FORMAT)?.run { + entryValues = resources.getStringArray(R.array.date_formats) + val now = Date().time + entries = entryValues.map { value -> + val formattedDate = settings.getDateFormat(value.toString()).format(now) + if (value == "") { + "${context.getString(R.string.system_default)} ($formattedDate)" + } else { + formattedDate + } + }.toTypedArray() + setDefaultValueCompat("") + summary = "%s" + } + findPreference(AppSettings.KEY_PROTECT_APP) + ?.isChecked = !settings.appPassword.isNullOrEmpty() + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + settings.subscribe(this) + } + + override fun onDestroyView() { + settings.unsubscribe(this) + super.onDestroyView() + } + + override fun onSharedPreferenceChanged(prefs: SharedPreferences?, key: String?) { + when (key) { + AppSettings.KEY_THEME -> { + AppCompatDelegate.setDefaultNightMode(settings.theme) + } + AppSettings.KEY_DYNAMIC_THEME -> { + findPreference(key)?.setSummary(R.string.restart_required) + } + AppSettings.KEY_THEME_AMOLED -> { + findPreference(key)?.setSummary(R.string.restart_required) + } + AppSettings.KEY_APP_PASSWORD -> { + findPreference(AppSettings.KEY_PROTECT_APP) + ?.isChecked = !settings.appPassword.isNullOrEmpty() + } + } + } + + override fun onPreferenceTreeClick(preference: Preference): Boolean { + return when (preference.key) { + AppSettings.KEY_PROTECT_APP -> { + val pref = (preference as? TwoStatePreference ?: return false) + if (pref.isChecked) { + pref.isChecked = false + startActivity(Intent(preference.context, ProtectSetupActivity::class.java)) + } else { + settings.appPassword = null + } + true + } + else -> super.onPreferenceTreeClick(preference) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/ContentSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/ContentSettingsFragment.kt new file mode 100644 index 000000000..5e4c7555b --- /dev/null +++ b/app/src/main/java/org/koitharu/kotatsu/settings/ContentSettingsFragment.kt @@ -0,0 +1,96 @@ +package org.koitharu.kotatsu.settings + +import android.content.SharedPreferences +import android.os.Bundle +import android.view.View +import androidx.preference.Preference +import java.io.File +import kotlinx.coroutines.launch +import org.koin.android.ext.android.inject +import org.koitharu.kotatsu.R +import org.koitharu.kotatsu.base.ui.BasePreferenceFragment +import org.koitharu.kotatsu.base.ui.dialog.StorageSelectDialog +import org.koitharu.kotatsu.core.prefs.AppSettings +import org.koitharu.kotatsu.local.data.LocalStorageManager +import org.koitharu.kotatsu.parsers.model.MangaSource +import org.koitharu.kotatsu.utils.ext.getStorageName +import org.koitharu.kotatsu.utils.ext.viewLifecycleScope + +class ContentSettingsFragment : + BasePreferenceFragment(R.string.content), + SharedPreferences.OnSharedPreferenceChangeListener, + StorageSelectDialog.OnStorageSelectListener { + + private val storageManager by inject() + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + addPreferencesFromResource(R.xml.pref_content) + + findPreference(AppSettings.KEY_SUGGESTIONS)?.setSummary( + if (settings.isSuggestionsEnabled) R.string.enabled else R.string.disabled + ) + bindRemoteSourcesSummary() + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + findPreference(AppSettings.KEY_LOCAL_STORAGE)?.bindStorageName() + settings.subscribe(this) + } + + override fun onDestroyView() { + settings.unsubscribe(this) + super.onDestroyView() + } + + override fun onSharedPreferenceChanged(prefs: SharedPreferences?, key: String?) { + when (key) { + AppSettings.KEY_LOCAL_STORAGE -> { + findPreference(key)?.bindStorageName() + } + AppSettings.KEY_SUGGESTIONS -> { + findPreference(AppSettings.KEY_SUGGESTIONS)?.setSummary( + if (settings.isSuggestionsEnabled) R.string.enabled else R.string.disabled + ) + } + AppSettings.KEY_SOURCES_HIDDEN -> { + bindRemoteSourcesSummary() + } + } + } + + override fun onPreferenceTreeClick(preference: Preference): Boolean { + return when (preference.key) { + AppSettings.KEY_LOCAL_STORAGE -> { + val ctx = context ?: return false + StorageSelectDialog.Builder(ctx, storageManager, this) + .setTitle(preference.title ?: "") + .setNegativeButton(android.R.string.cancel) + .create() + .show() + true + } + else -> super.onPreferenceTreeClick(preference) + } + } + + override fun onStorageSelected(file: File) { + settings.mangaStorageDir = file + } + + private fun Preference.bindStorageName() { + viewLifecycleScope.launch { + val storage = storageManager.getDefaultWriteableDir() + summary = storage?.getStorageName(context) ?: getString(R.string.not_available) + } + } + + private fun bindRemoteSourcesSummary() { + findPreference(AppSettings.KEY_REMOTE_SOURCES)?.run { + val total = MangaSource.values().size - 1 + summary = getString( + R.string.enabled_d_of_d, total - settings.hiddenSources.size, total + ) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt deleted file mode 100644 index b0a9518dd..000000000 --- a/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt +++ /dev/null @@ -1,182 +0,0 @@ -package org.koitharu.kotatsu.settings - -import android.content.ComponentName -import android.content.Intent -import android.content.SharedPreferences -import android.os.Bundle -import android.view.Menu -import android.view.MenuInflater -import android.view.MenuItem -import android.view.View -import androidx.appcompat.app.AppCompatDelegate -import androidx.preference.ListPreference -import androidx.preference.Preference -import androidx.preference.PreferenceScreen -import androidx.preference.TwoStatePreference -import kotlinx.coroutines.launch -import org.koin.android.ext.android.inject -import org.koitharu.kotatsu.R -import org.koitharu.kotatsu.base.ui.BasePreferenceFragment -import org.koitharu.kotatsu.base.ui.dialog.StorageSelectDialog -import org.koitharu.kotatsu.core.prefs.AppSettings -import org.koitharu.kotatsu.core.prefs.ListMode -import org.koitharu.kotatsu.local.data.LocalStorageManager -import org.koitharu.kotatsu.parsers.model.MangaSource -import org.koitharu.kotatsu.settings.protect.ProtectSetupActivity -import org.koitharu.kotatsu.settings.utils.SliderPreference -import org.koitharu.kotatsu.utils.ext.getStorageName -import org.koitharu.kotatsu.utils.ext.names -import org.koitharu.kotatsu.utils.ext.setDefaultValueCompat -import org.koitharu.kotatsu.utils.ext.viewLifecycleScope -import java.io.File -import java.util.* - - -class MainSettingsFragment : BasePreferenceFragment(R.string.settings), - SharedPreferences.OnSharedPreferenceChangeListener, - StorageSelectDialog.OnStorageSelectListener { - - private val storageManager by inject() - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setHasOptionsMenu(true) - } - - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - addPreferencesFromResource(R.xml.pref_main) - findPreference(AppSettings.KEY_GRID_SIZE)?.run { - summary = "%d%%".format(value) - setOnPreferenceChangeListener { preference, newValue -> - preference.summary = "%d%%".format(newValue) - true - } - } - preferenceScreen?.findPreference(AppSettings.KEY_LIST_MODE)?.run { - entryValues = ListMode.values().names() - setDefaultValueCompat(ListMode.GRID.name) - } - findPreference(AppSettings.KEY_DYNAMIC_THEME)?.isVisible = - AppSettings.isDynamicColorAvailable - findPreference(AppSettings.KEY_DATE_FORMAT)?.run { - entryValues = resources.getStringArray(R.array.date_formats) - val now = Date().time - entries = entryValues.map { value -> - val formattedDate = settings.getDateFormat(value.toString()).format(now) - if (value == "") { - "${context.getString(R.string.system_default)} ($formattedDate)" - } else { - formattedDate - } - }.toTypedArray() - setDefaultValueCompat("") - summary = "%s" - } - findPreference(AppSettings.KEY_SUGGESTIONS)?.setSummary( - if (settings.isSuggestionsEnabled) R.string.enabled else R.string.disabled - ) - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - findPreference(AppSettings.KEY_LOCAL_STORAGE)?.bindStorageName() - findPreference(AppSettings.KEY_PROTECT_APP)?.isChecked = - !settings.appPassword.isNullOrEmpty() - settings.subscribe(this) - } - - override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { - super.onCreateOptionsMenu(menu, inflater) - inflater.inflate(R.menu.opt_settings, menu) - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - return when (item.itemId) { - R.id.action_leaks -> { - val intent = Intent() - intent.component = ComponentName(requireContext(), "leakcanary.internal.activity.LeakActivity") - intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP - startActivity(intent) - true - } - else -> super.onOptionsItemSelected(item) - } - } - - override fun onDestroyView() { - settings.unsubscribe(this) - super.onDestroyView() - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) { - when (key) { - AppSettings.KEY_THEME -> { - AppCompatDelegate.setDefaultNightMode(settings.theme) - } - AppSettings.KEY_DYNAMIC_THEME -> { - findPreference(key)?.setSummary(R.string.restart_required) - } - AppSettings.KEY_THEME_AMOLED -> { - findPreference(key)?.setSummary(R.string.restart_required) - } - AppSettings.KEY_LOCAL_STORAGE -> { - findPreference(key)?.bindStorageName() - } - AppSettings.KEY_APP_PASSWORD -> { - findPreference(AppSettings.KEY_PROTECT_APP) - ?.isChecked = !settings.appPassword.isNullOrEmpty() - } - AppSettings.KEY_SUGGESTIONS -> { - findPreference(AppSettings.KEY_SUGGESTIONS)?.setSummary( - if (settings.isSuggestionsEnabled) R.string.enabled else R.string.disabled - ) - } - } - } - - override fun onResume() { - super.onResume() - findPreference(AppSettings.KEY_REMOTE_SOURCES)?.run { - val total = MangaSource.values().size - 1 - summary = getString( - R.string.enabled_d_of_d, total - settings.hiddenSources.size, total - ) - } - } - - override fun onPreferenceTreeClick(preference: Preference): Boolean { - return when (preference.key) { - AppSettings.KEY_LOCAL_STORAGE -> { - val ctx = context ?: return false - StorageSelectDialog.Builder(ctx, storageManager, this) - .setTitle(preference.title ?: "") - .setNegativeButton(android.R.string.cancel) - .create() - .show() - true - } - AppSettings.KEY_PROTECT_APP -> { - val pref = (preference as? TwoStatePreference ?: return false) - if (pref.isChecked) { - pref.isChecked = false - startActivity(Intent(preference.context, ProtectSetupActivity::class.java)) - } else { - settings.appPassword = null - } - true - } - else -> super.onPreferenceTreeClick(preference) - } - } - - override fun onStorageSelected(file: File) { - settings.mangaStorageDir = file - } - - private fun Preference.bindStorageName() { - viewLifecycleScope.launch { - val storage = storageManager.getDefaultWriteableDir() - summary = storage?.getStorageName(context) ?: getString(R.string.not_available) - } - } -} diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/NetworkSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/RootSettingsFragment.kt similarity index 61% rename from app/src/main/java/org/koitharu/kotatsu/settings/NetworkSettingsFragment.kt rename to app/src/main/java/org/koitharu/kotatsu/settings/RootSettingsFragment.kt index 8bfb2c3d6..ad02acf64 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/NetworkSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/RootSettingsFragment.kt @@ -4,9 +4,9 @@ import android.os.Bundle import org.koitharu.kotatsu.R import org.koitharu.kotatsu.base.ui.BasePreferenceFragment -class NetworkSettingsFragment : BasePreferenceFragment(R.string.settings) { +class RootSettingsFragment : BasePreferenceFragment(R.string.settings) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - //TODO https://developer.android.com/training/basics/network-ops/managing + addPreferencesFromResource(R.xml.pref_root) } } \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/SettingsActivity.kt b/app/src/main/java/org/koitharu/kotatsu/settings/SettingsActivity.kt index 04afdd246..8b82b327c 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/SettingsActivity.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/SettingsActivity.kt @@ -1,9 +1,13 @@ package org.koitharu.kotatsu.settings +import android.content.ComponentName import android.content.Context import android.content.Intent import android.os.Bundle +import android.view.Menu +import android.view.MenuItem import androidx.core.graphics.Insets +import androidx.core.view.updatePadding import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentTransaction @@ -11,6 +15,7 @@ import androidx.fragment.app.commit import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import com.google.android.material.appbar.AppBarLayout +import org.koitharu.kotatsu.BuildConfig import org.koitharu.kotatsu.R import org.koitharu.kotatsu.base.ui.BaseActivity import org.koitharu.kotatsu.base.ui.util.RecyclerViewOwner @@ -34,9 +39,7 @@ class SettingsActivity : supportActionBar?.setDisplayHomeAsUpEnabled(true) if (supportFragmentManager.findFragmentById(R.id.container) == null) { - supportFragmentManager.commit { - replace(R.id.container, MainSettingsFragment()) - } + openDefaultFragment() } } @@ -55,6 +58,22 @@ class SettingsActivity : super.onStop() } + override fun onCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.opt_settings, menu) + return super.onCreateOptionsMenu(menu) + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) { + R.id.action_leaks -> { + val intent = Intent() + intent.component = ComponentName(this, "leakcanary.internal.activity.LeakActivity") + intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP + startActivity(intent) + true + } + else -> super.onOptionsItemSelected(item) + } + override fun onBackStackChanged() { val fragment = supportFragmentManager.findFragmentById(R.id.container) as? RecyclerViewOwner ?: return val recyclerView = fragment.recyclerView @@ -70,32 +89,66 @@ class SettingsActivity : val fm = supportFragmentManager val fragment = fm.fragmentFactory.instantiate(classLoader, pref.fragment ?: return false) fragment.arguments = pref.extras - fragment.setTargetFragment(caller, 0) + // fragment.setTargetFragment(caller, 0) openFragment(fragment) return true } - fun openMangaSourceSettings(mangaSource: MangaSource) { - openFragment(SourceSettingsFragment.newInstance(mangaSource)) + override fun onWindowInsetsChanged(insets: Insets) { + binding.appbar.updatePadding( + left = insets.left, + right = insets.right, + ) + binding.container.updatePadding( + left = insets.left, + right = insets.right, + ) } - fun openNotificationSettingsLegacy() { - openFragment(NotificationSettingsLegacyFragment()) - } - - private fun openFragment(fragment: Fragment) { + fun openFragment(fragment: Fragment) { supportFragmentManager.commit { - setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) - replace(R.id.container, fragment) setReorderingAllowed(true) + replace(R.id.container, fragment) + setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) addToBackStack(null) } } - override fun onWindowInsetsChanged(insets: Insets) = Unit + private fun openDefaultFragment() { + val fragment = when (intent?.action) { + ACTION_READER -> ReaderSettingsFragment() + ACTION_SUGGESTIONS -> SuggestionsSettingsFragment() + ACTION_SOURCE -> SourceSettingsFragment.newInstance( + intent.getSerializableExtra(EXTRA_SOURCE) as? MangaSource ?: MangaSource.LOCAL + ) + else -> SettingsHeadersFragment() + } + supportFragmentManager.commit { + setReorderingAllowed(true) + replace(R.id.container, fragment) + } + } companion object { + private const val ACTION_READER = "${BuildConfig.APPLICATION_ID}.action.MANAGE_READER_SETTINGS" + private const val ACTION_SUGGESTIONS = "${BuildConfig.APPLICATION_ID}.action.MANAGE_SUGGESTIONS" + private const val ACTION_SOURCE = "${BuildConfig.APPLICATION_ID}.action.MANAGE_SOURCE_SETTINGS" + private const val EXTRA_SOURCE = "source" + fun newIntent(context: Context) = Intent(context, SettingsActivity::class.java) + + fun newReaderSettingsIntent(context: Context) = + Intent(context, SettingsActivity::class.java) + .setAction(ACTION_READER) + + fun newSuggestionsSettingsIntent(context: Context) = + Intent(context, SettingsActivity::class.java) + .setAction(ACTION_SUGGESTIONS) + + fun newSourceSettingsIntent(context: Context, source: MangaSource) = + Intent(context, SettingsActivity::class.java) + .setAction(ACTION_SOURCE) + .putExtra(EXTRA_SOURCE, source) } } \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/SettingsHeadersFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/SettingsHeadersFragment.kt new file mode 100644 index 000000000..bec03f017 --- /dev/null +++ b/app/src/main/java/org/koitharu/kotatsu/settings/SettingsHeadersFragment.kt @@ -0,0 +1,49 @@ +package org.koitharu.kotatsu.settings + +import android.os.Bundle +import android.view.View +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentTransaction +import androidx.fragment.app.commit +import androidx.preference.PreferenceFragmentCompat +import androidx.preference.PreferenceHeaderFragmentCompat +import androidx.slidingpanelayout.widget.SlidingPaneLayout +import org.koitharu.kotatsu.R + +class SettingsHeadersFragment : PreferenceHeaderFragmentCompat(), SlidingPaneLayout.PanelSlideListener { + + private var currentTitle: CharSequence? = null + + override fun onCreatePreferenceHeader(): PreferenceFragmentCompat = RootSettingsFragment() + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + slidingPaneLayout.addPanelSlideListener(this) + } + + override fun onPanelSlide(panel: View, slideOffset: Float) = Unit + + override fun onPanelOpened(panel: View) { + activity?.title = currentTitle ?: getString(R.string.settings) + } + + override fun onPanelClosed(panel: View) { + activity?.setTitle(R.string.settings) + } + + fun setTitle(title: CharSequence?) { + currentTitle = title + if (slidingPaneLayout.isSlideable && slidingPaneLayout.isOpen) { + activity?.title = title + } + } + + fun openFragment(fragment: Fragment) { + childFragmentManager.commit { + setReorderingAllowed(true) + replace(androidx.preference.R.id.preferences_detail, fragment) + setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) + addToBackStack(null) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/SourceSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/SourceSettingsFragment.kt index fc670874a..384905df2 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/SourceSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/SourceSettingsFragment.kt @@ -25,7 +25,7 @@ class SourceSettingsFragment : BasePreferenceFragment(0) { override fun onResume() { super.onResume() - activity?.title = source.title + setTitle(source.title) } override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/TrackerSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/TrackerSettingsFragment.kt index a7191a756..1e993f845 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/TrackerSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/TrackerSettingsFragment.kt @@ -31,7 +31,6 @@ class TrackerSettingsFragment : BasePreferenceFragment(R.string.check_for_new_ch append(getString(R.string.read_more)) } } - warningPreference } } @@ -43,10 +42,10 @@ class TrackerSettingsFragment : BasePreferenceFragment(R.string.check_for_new_ch .putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName) .putExtra(Settings.EXTRA_CHANNEL_ID, TrackWorker.CHANNEL_ID) startActivity(intent) + true } else { - (activity as? SettingsActivity)?.openNotificationSettingsLegacy() + super.onPreferenceTreeClick(preference) } - true } else -> super.onPreferenceTreeClick(preference) } diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt index a88856b15..8e149f83b 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt @@ -1,13 +1,13 @@ package org.koitharu.kotatsu.settings.about +import android.content.Intent import android.os.Bundle -import android.view.View +import androidx.core.net.toUri 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 @@ -16,20 +16,16 @@ class AboutSettingsFragment : 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) + val isUpdateSupported = AppUpdateChecker.isUpdateSupported(requireContext()) findPreference(AppSettings.KEY_APP_UPDATE_AUTO)?.run { - isVisible = AppUpdateChecker.isUpdateSupported(context) + isVisible = isUpdateSupported } findPreference(AppSettings.KEY_APP_VERSION)?.run { title = getString(R.string.app_version, BuildConfig.VERSION_NAME) - isEnabled = AppUpdateChecker.isUpdateSupported(context) + isEnabled = isUpdateSupported } } - override fun onPreferenceTreeClick(preference: Preference): Boolean { return when (preference.key) { AppSettings.KEY_APP_VERSION -> { @@ -37,39 +33,19 @@ class AboutSettingsFragment : 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)) }) + openLink(getString(R.string.url_weblate), preference.title) 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)) }) + openLink(getString(R.string.url_forpda), preference.title) true } AppSettings.KEY_FEEDBACK_DISCORD -> { - startActivity(context?.let { BrowserActivity.newIntent(it, - "https://discord.gg/NNJ5RgVBC5", - "Discord") }) + openLink(getString(R.string.url_discord), preference.title) true } AppSettings.KEY_FEEDBACK_GITHUB -> { - startActivity(context?.let { BrowserActivity.newIntent(it, - "https://github.com/nv95/Kotatsu/issues", - "GitHub") }) - true - } - AppSettings.KEY_SUPPORT_DEVELOPER -> { - startActivity(context?.let { BrowserActivity.newIntent(it, - "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)) }) + openLink(getString(R.string.url_github_issues), preference.title) true } else -> super.onPreferenceTreeClick(preference) @@ -95,4 +71,16 @@ class AboutSettingsFragment : BasePreferenceFragment(R.string.about) { } } } -} + + private fun openLink(url: String, title: CharSequence?) { + val intent = Intent(Intent.ACTION_VIEW) + intent.data = url.toUri() + startActivity( + if (title != null) { + Intent.createChooser(intent, title) + } else { + intent + } + ) + } +} \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/about/LicenseFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/about/LicenseFragment.kt deleted file mode 100644 index 8d25e3ca9..000000000 --- a/app/src/main/java/org/koitharu/kotatsu/settings/about/LicenseFragment.kt +++ /dev/null @@ -1,41 +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 org.koitharu.kotatsu.R -import org.koitharu.kotatsu.base.ui.BaseFragment -import org.koitharu.kotatsu.databinding.FragmentCopyrightBinding - -class LicenseFragment : 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_license) - } - - override fun onWindowInsetsChanged(insets: Insets) = Unit - -} \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsFragment.kt index 200d8c31f..60a5b6ff9 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsFragment.kt @@ -15,6 +15,8 @@ import org.koitharu.kotatsu.base.ui.util.RecyclerViewOwner import org.koitharu.kotatsu.databinding.FragmentSettingsSourcesBinding import org.koitharu.kotatsu.main.ui.AppBarOwner import org.koitharu.kotatsu.settings.SettingsActivity +import org.koitharu.kotatsu.settings.SettingsHeadersFragment +import org.koitharu.kotatsu.settings.SourceSettingsFragment import org.koitharu.kotatsu.settings.sources.adapter.SourceConfigAdapter import org.koitharu.kotatsu.settings.sources.adapter.SourceConfigListener import org.koitharu.kotatsu.settings.sources.model.SourceConfigItem @@ -87,7 +89,9 @@ class SourcesSettingsFragment : BaseFragment(), } override fun onItemSettingsClick(item: SourceConfigItem.SourceItem) { - (activity as? SettingsActivity)?.openMangaSourceSettings(item.source) + val fragment = SourceSettingsFragment.newInstance(item.source) + (parentFragment as? SettingsHeadersFragment)?.openFragment(fragment) + ?: (activity as? SettingsActivity)?.openFragment(fragment) } override fun onItemEnabledChanged(item: SourceConfigItem.SourceItem, isEnabled: Boolean) { diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/utils/SliderPreference.kt b/app/src/main/java/org/koitharu/kotatsu/settings/utils/SliderPreference.kt index 472467a1d..0933fe1d0 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/utils/SliderPreference.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/utils/SliderPreference.kt @@ -30,18 +30,22 @@ class SliderPreference @JvmOverloads constructor( set(value) = setValueInternal(value, notifyChanged = true) private val sliderListener = Slider.OnChangeListener { _, value, fromUser -> - if (fromUser) { - syncValueInternal(value.toInt()) - } + if (fromUser) { + syncValueInternal(value.toInt()) } + } init { - context.withStyledAttributes(attrs, + context.withStyledAttributes( + attrs, R.styleable.SliderPreference, defStyleAttr, - defStyleRes) { - valueFrom = getFloat(R.styleable.SliderPreference_android_valueFrom, - valueFrom.toFloat()).toInt() + defStyleRes + ) { + valueFrom = getFloat( + R.styleable.SliderPreference_android_valueFrom, + valueFrom.toFloat() + ).toInt() valueTo = getFloat(R.styleable.SliderPreference_android_valueTo, valueTo.toFloat()).toInt() stepSize = diff --git a/app/src/main/java/org/koitharu/kotatsu/suggestions/ui/SuggestionsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/suggestions/ui/SuggestionsFragment.kt index 507c2a142..0e7eef63a 100644 --- a/app/src/main/java/org/koitharu/kotatsu/suggestions/ui/SuggestionsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/suggestions/ui/SuggestionsFragment.kt @@ -8,7 +8,7 @@ import com.google.android.material.snackbar.Snackbar import org.koin.androidx.viewmodel.ext.android.viewModel import org.koitharu.kotatsu.R import org.koitharu.kotatsu.list.ui.MangaListFragment -import org.koitharu.kotatsu.reader.ui.SimpleSettingsActivity +import org.koitharu.kotatsu.settings.SettingsActivity class SuggestionsFragment : MangaListFragment() { @@ -37,7 +37,7 @@ class SuggestionsFragment : MangaListFragment() { true } R.id.action_settings -> { - startActivity(SimpleSettingsActivity.newSuggestionsSettingsIntent(requireContext())) + startActivity(SettingsActivity.newSuggestionsSettingsIntent(requireContext())) true } else -> super.onOptionsItemSelected(item) diff --git a/app/src/main/res/drawable/ic_appearance.xml b/app/src/main/res/drawable/ic_appearance.xml new file mode 100644 index 000000000..b5aa6519c --- /dev/null +++ b/app/src/main/res/drawable/ic_appearance.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_copyleft.xml b/app/src/main/res/drawable/ic_copyleft.xml deleted file mode 100644 index 47ac8bbca..000000000 --- a/app/src/main/res/drawable/ic_copyleft.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/app/src/main/res/layout-w600dp/activity_settings.xml b/app/src/main/res/layout-w600dp/activity_settings.xml index c381476a0..642380efc 100644 --- a/app/src/main/res/layout-w600dp/activity_settings.xml +++ b/app/src/main/res/layout-w600dp/activity_settings.xml @@ -1,5 +1,5 @@ - + app:layout_constraintTop_toTopOf="parent" + app:liftOnScroll="false"> - + - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_settings_simple.xml b/app/src/main/res/layout/activity_settings_simple.xml deleted file mode 100644 index fa9c5d762..000000000 --- a/app/src/main/res/layout/activity_settings_simple.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_copyright.xml b/app/src/main/res/layout/fragment_copyright.xml deleted file mode 100644 index fe9c3e4e1..000000000 --- a/app/src/main/res/layout/fragment_copyright.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/raw/copyright b/app/src/main/res/raw/copyright deleted file mode 100644 index bf4212730..000000000 --- a/app/src/main/res/raw/copyright +++ /dev/null @@ -1,24 +0,0 @@ -

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/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index 0f0e6134e..0e8ab0bad 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -217,13 +217,7 @@ Гэтая глава адсутнічае на вашай прыладзе. Спампуйце ціпрачытайце яе онлайн. На дадзены момант няма актыўных спамповак У чарзе - Ліцэнзія - Аўтарскія правы і ліцэнзіі - Гэтыя людзі робяць Kotatsu лепш - Падзякі - Калі вам падабаецца гэтая праграма, вы можаце дапамагчы фінансава з дапамогай ЮMoney (был. Яндекс.Деньги) - Падтрымаць распрацоўшчыка - Тэма на 4PDA + Тэма на 4PDA Зваротная сувязь Дапамагчы з перакладам праграмы Пераклад diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 966ee5667..d25f7be80 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -217,13 +217,7 @@ Dieses Kapitel fehlt auf deinem Gerät. Lade ihn herunter oder lese ihn online. Zurzeit sind keine aktiven Datenübertragungen vorhanden In Warteschlange - Wenn diese Anwendung dir gefällt, kannst du über Yoomoney (Yandex.Money) finanziell helfen - Lizenz - Urheberrecht und Lizenzen - Diese Leute machen Kotatsu besser - Danksagung - Den Entwickler unterstützen - Thema auf 4PDA + Thema auf 4PDA Rückmeldung Übersetzung Diese Anwendung übersetzen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 1b64f874e..44bb53494 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -205,14 +205,8 @@ Encuentra qué leer en el menú lateral. Lo que leas se mostrará aquí Está un poco vacío aquí… - Agradecimientos - Si te gusta esta aplicación, puedes ayudar económicamente a través de Yoomoney (ex. Yandex.Money) - Apoyar al desarrollador - Buscar sólo en %s - Todas estas personas hicieron que Kotatsu fuera mejor - Licencia - Derechos de autor y licencias - Falta un capítulo + Buscar sólo en %s + Falta un capítulo Traducir esta aplicación Comentarios Traducción diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 022d894ce..69ef71847 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -4,13 +4,7 @@ Tyylilajit %s -valtuutusta ei tueta Valtuutus valmis - Lisenssi - Tekijänoikeudet ja lisenssit - Nämä ihmiset tekevät Kotatsusta paremman - Kiitokset - Jos pidät tästä sovelluksesta, voit auttaa taloudellisesti Yoomoneyn (ent. Yandex.Money) kautta - Tue kehittäjää - Aihe 4PDA: ssa + Aihe 4PDA: ssa Palaute Käännös Käännä tämä sovellus diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a20bce18d..c76fb6027 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -217,13 +217,7 @@ Téléchargez ou lisez ce chapitre manquant en ligne. Aucun téléchargement actif En file d\'attente - Si vous aimez cette application, vous pouvez envoyer de l\'argent via Yoomoney (ex. Yandex.Money) - Soutenir le concepteur - Licence - Droits d\'auteur et licences - Ces personnes ont toutes rendu Kotatsu meilleur - Remerciements - Sujet sur 4PDA + Sujet sur 4PDA Remarques Traduction Traduire cette application diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 4245f4355..a1586ed71 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -217,13 +217,7 @@ Questo capitolo manca sul tuo dispositivo. Scaricalo o leggilo in linea. Attualmente non ci sono scaricamenti attivi In coda - Licenza - Diritti d\'autore e licenze - Queste persone rendono Kotatsu migliore - Ringraziamenti - Se ti piace questa applicazione, puoi aiutare finanziariamente via Yoomoney (Yandex.Money) - Sostieni lo sviluppatore - Argomento su 4PDA + Argomento su 4PDA Commenti Traduzione Traduci questa applicazione diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index dbf16817d..4e3fdfcd5 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -163,10 +163,7 @@ 右から左(←)の読書を好む フィードバック 4PDAに関する話題 - 開発者をサポートします(Yoomoneyが開きます) - このアプリが気に入ったら、Yoomoney(Yandex.Moneyなど)から開発者をサポートできます - ライセンス - 承認済み + 承認済み %sへのログインはサポートされていません 完成 進行中 @@ -212,12 +209,10 @@ このアプリを翻訳 全てのデータが復元されました 復元 - 感謝の気持ち - 準備中… + 準備中… 開始時に維持 バックアップと復元 - 著作権とライセンス - リバース + リバース 選択した構成はこの漫画のために記憶されます クッキーを削除 GitHubでissueを作成する(GitHubのアカウントが必要です) @@ -235,8 +230,7 @@ スケールモード 名前を入力する必要があります 今日 - この人達のお陰でKotatsuがより良くなりました - Kotatsuを翻訳する(Weblateのサイトに移動します) + Kotatsuを翻訳する(Weblateのサイトに移動します) 次のページ サイレント サインイン diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index 04a7d2dd5..74c07b980 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -223,13 +223,7 @@ Oversettelse Tilbakemelding Emne på 4PDA - Støtt utvikleren - Hvis du liker programmet kan du kronerulle det på Yoomoney (tidligere Yandex.Money) - Takk rettes til - Folk som gjorde Kotatsu enda bedre - Opphavsrett og lisenser - Lisens - Identitetsbekreftet + Identitetsbekreftet Innlogging på %s støttes ikke Du vil bli utlogget fra alle kilder Sjangere diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index afa68d7a0..25bc9f483 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -183,12 +183,7 @@ Tradução Comentar Tópico no 4PDA - Apoie o desenvolvedor - Se você gosta deste aplicativo, você pode enviar dinheiro através do Yoomoney (ex. Yandex.Money) - Gratidão - Todas essas pessoas tornaram o Kotatsu melhor - Licença - Autorizado + Autorizado O login em %s não é suportado Você será desconectado de todas as fontes Gêneros @@ -266,8 +261,7 @@ Os dados foram restaurados, mas há erros Criar problema no GitHub Arquivo não encontrado - Direitos autorais e licenças - Localizar capítulo + Localizar capítulo Não há capítulos neste mangá %1$s%% \ No newline at end of file diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 24d687be3..0f0d99fc0 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -185,13 +185,7 @@ Traduzir esta aplicação Comentar Tópico no 4PDA - Apoiar o desenvolvedor - Se você gosta deste aplicativo, você pode enviar dinheiro através do Yoomoney (ex. Yandex.Money) - Agradecimentos - Todas essas pessoas tornaram o Kotatsu melhor - Direitos de autor e licenças - Licença - Baixe ou leia este capítulo perdido online. + Baixe ou leia este capítulo perdido online. O capítulo está em falta Autorizado O login em %s não é suportado diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 4801b3498..1fc097e9e 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -220,13 +220,7 @@ Перевод Тема на 4PDA Обратная связь - Поддержать разработчика - Если вам нравится это приложение, вы можете помочь финансово с помощью ЮMoney (бывш. Яндекс.Деньги) - Благодарности - Все эти люди сделали Kotatsu лучше - Авторские права и лицензии - Лицензия - Авторизация выполнена + Авторизация выполнена Вход в %s не поддерживается Вы выйдете из всех источников Жанры @@ -269,4 +263,6 @@ Разные языки Найти главу В этой манге нет глав + Оформление + Контент \ No newline at end of file diff --git a/app/src/main/res/values-sw360dp/bools.xml b/app/src/main/res/values-sw360dp/bools.xml new file mode 100644 index 000000000..927afe2f8 --- /dev/null +++ b/app/src/main/res/values-sw360dp/bools.xml @@ -0,0 +1,6 @@ + + + + false + + \ No newline at end of file diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index c9154f6a5..eb03a51d6 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -131,8 +131,7 @@ Yedekten geri yükle Güncelle Oturum aç - Lisans - Bitti + Bitti Hakkında Bu içeriği görüntülemek için oturum açın Onayla @@ -185,9 +184,7 @@ Çeviri Yalnızca %s içinde ara 4PDA\'daki konu - Teşekkürler - Tüm bu insanlar Kotatsu\'yu daha iyi hale getirdi - Devam ediyor + Devam ediyor Tüm kaynaklardaki oturumunuz kapatılacak Kullanılan kaynaklar Kullanılabilir kaynaklar @@ -226,16 +223,13 @@ CAPTCHA gerekli Tüm çerezler kaldırıldı Seçilen yapılandırma bu manga için hatırlanacak - Bu uygulamayı beğendiyseniz Yoomoney (eski Yandex.Money) üzerinden para gönderebilirsiniz - Tüm güncelleme geçmişi kalıcı olarak silinsin mi\? + Tüm güncelleme geçmişi kalıcı olarak silinsin mi\? …ve %1$d daha fazlası Uygulamayı başlatmak için bir parola girin Tüm son arama sorguları kalıcı olarak kaldırılsın mı\? Geri bildirim Yedek kaydedildi - Geliştiriciyi destekleyin - Telif Hakkı ve Lisanslar - Türler + Türler Tarih biçimi Öntanımlı Bir ad girmelisiniz diff --git a/app/src/main/res/values/bools.xml b/app/src/main/res/values/bools.xml index 967cf9dce..6cb53be9e 100644 --- a/app/src/main/res/values/bools.xml +++ b/app/src/main/res/values/bools.xml @@ -1,5 +1,5 @@ - + false true false diff --git a/app/src/main/res/values/constants.xml b/app/src/main/res/values/constants.xml index 2e676d010..5132610e6 100644 --- a/app/src/main/res/values/constants.xml +++ b/app/src/main/res/values/constants.xml @@ -1,5 +1,9 @@ + https://github.com/nv95/Kotatsu/issues + https://discord.gg/NNJ5RgVBC5 + https://4pda.to/forum/index.php?showtopic=697669 + https://hosted.weblate.org/engage/kotatsu -1 1 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b2dc561b1..aeace4628 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -222,13 +222,7 @@ Translation Feedback Topic on 4PDA - Support the developer - If you like this app, you can send money through Yoomoney (ex. Yandex.Money) - Gratitudes - These people all made Kotatsu better - Copyright and Licenses - License - Authorized + Authorized Logging in on %s is not supported You will be logged out from all sources Genres @@ -270,4 +264,8 @@ Find chapter No chapters in this manga %1$s%% + Appearance + Content + GitHub + Discord \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 212be7451..f0bdca57b 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/xml/pref_about.xml b/app/src/main/res/xml/pref_about.xml index 7be3e5c8a..bde3d1904 100644 --- a/app/src/main/res/xml/pref_about.xml +++ b/app/src/main/res/xml/pref_about.xml @@ -1,84 +1,44 @@ + xmlns:android="http://schemas.android.com/apk/res/android"> - + + android:key="app_version" + android:persistent="false" + android:summary="@string/check_for_updates" /> - - - - - - + android:defaultValue="true" + android:key="app_update_auto" + android:summary="@string/show_notification_app_update" + android:title="@string/application_update" /> - + + android:key="about_feedback_github" + android:persistent="false" + android:summary="@string/url_github_issues" + android:title="@string/github" /> + android:key="about_feedback_4pda" + android:summary="@string/url_forpda" + android:title="@string/about_feedback_4pda" /> - - - - + android:key="about_feedback_discord" + android:summary="@string/url_discord" + android:title="@string/discord" /> + android:key="about_app_translation" + android:summary="@string/about_app_translation_summary" + android:title="@string/about_app_translation" /> diff --git a/app/src/main/res/xml/pref_appearance.xml b/app/src/main/res/xml/pref_appearance.xml new file mode 100644 index 000000000..eac08e162 --- /dev/null +++ b/app/src/main/res/xml/pref_appearance.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/pref_backup.xml b/app/src/main/res/xml/pref_backup.xml index 7a61eb336..7fc94bcba 100644 --- a/app/src/main/res/xml/pref_backup.xml +++ b/app/src/main/res/xml/pref_backup.xml @@ -6,14 +6,12 @@ + android:title="@string/create_backup" /> + android:title="@string/restore_backup" /> + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/pref_history.xml b/app/src/main/res/xml/pref_history.xml index 50061d04a..6b7d82c50 100644 --- a/app/src/main/res/xml/pref_history.xml +++ b/app/src/main/res/xml/pref_history.xml @@ -1,51 +1,42 @@ + xmlns:android="http://schemas.android.com/apk/res/android"> + android:title="@string/clear_search_history" /> + android:title="@string/clear_updates_feed" /> + android:title="@string/exclude_nsfw_from_history" /> - + + android:title="@string/clear_thumbs_cache" /> + android:title="@string/clear_pages_cache" /> + android:title="@string/clear_cookies" /> \ 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 deleted file mode 100644 index dd72fe7c1..000000000 --- a/app/src/main/res/xml/pref_main.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/xml/pref_notifications.xml b/app/src/main/res/xml/pref_notifications.xml index c1a70a6fd..b3c349d72 100644 --- a/app/src/main/res/xml/pref_notifications.xml +++ b/app/src/main/res/xml/pref_notifications.xml @@ -1,23 +1,19 @@ + xmlns:android="http://schemas.android.com/apk/res/android"> + android:title="@string/notification_sound" /> + android:title="@string/vibration" /> + android:title="@string/light_indicator" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_reader.xml b/app/src/main/res/xml/pref_reader.xml index 8fa00ef0e..e152d7054 100644 --- a/app/src/main/res/xml/pref_reader.xml +++ b/app/src/main/res/xml/pref_reader.xml @@ -7,14 +7,13 @@ android:defaultValue="false" android:key="reader_prefer_rtl" android:summary="@string/prefer_rtl_reader_summary" - android:title="@string/prefer_rtl_reader" - app:iconSpaceReserved="false" /> + android:title="@string/prefer_rtl_reader" /> + app:allowDividerAbove="true" /> + android:title="@string/pages_animation" /> + android:title="@string/show_pages_numbers" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_root.xml b/app/src/main/res/xml/pref_root.xml new file mode 100644 index 000000000..a7ed841c0 --- /dev/null +++ b/app/src/main/res/xml/pref_root.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/pref_source.xml b/app/src/main/res/xml/pref_source.xml index d4be72273..51a669888 100644 --- a/app/src/main/res/xml/pref_source.xml +++ b/app/src/main/res/xml/pref_source.xml @@ -5,10 +5,9 @@ + app:allowDividerAbove="true" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_suggestions.xml b/app/src/main/res/xml/pref_suggestions.xml index aa6f20132..0206aa4c2 100644 --- a/app/src/main/res/xml/pref_suggestions.xml +++ b/app/src/main/res/xml/pref_suggestions.xml @@ -7,14 +7,12 @@ android:defaultValue="false" android:key="suggestions" android:summary="@string/suggestions_summary" - android:title="@string/suggestions_enable" - app:iconSpaceReserved="false" /> + android:title="@string/suggestions_enable" /> + android:title="@string/exclude_nsfw_from_suggestions" /> + android:title="@string/track_sources" /> + android:title="@string/notifications" /> + android:title="@string/notifications_settings" />