diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 717fe0108..bbe4c266b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -45,13 +45,18 @@ android:label="@string/settings" /> + android:label="@string/settings"> + + + + + ReaderSettingsFragment() + replace(R.id.container, when(intent?.action) { + Intent.ACTION_MANAGE_NETWORK_USAGE -> NetworkSettingsFragment() + ACTION_READER -> ReaderSettingsFragment() else -> MainSettingsFragment() }) } @@ -26,10 +28,9 @@ class SimpleSettingsActivity : BaseActivity() { companion object { - private const val EXTRA_SECTION = "section" - private const val SECTION_READER = 1 + private const val ACTION_READER = "${BuildConfig.APPLICATION_ID}.action.MANAGE_READER_SETTINGS" fun newReaderSettingsIntent(context: Context) = Intent(context, SimpleSettingsActivity::class.java) - .putExtra(EXTRA_SECTION, SECTION_READER) + .setAction(ACTION_READER) } } \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/ui/settings/NetworkSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/ui/settings/NetworkSettingsFragment.kt new file mode 100644 index 000000000..b4109e45c --- /dev/null +++ b/app/src/main/java/org/koitharu/kotatsu/ui/settings/NetworkSettingsFragment.kt @@ -0,0 +1,12 @@ +package org.koitharu.kotatsu.ui.settings + +import android.os.Bundle +import org.koitharu.kotatsu.R +import org.koitharu.kotatsu.ui.common.BasePreferenceFragment + +class NetworkSettingsFragment : BasePreferenceFragment(R.string.settings) { + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + //TODO https://developer.android.com/training/basics/network-ops/managing + } +} \ No newline at end of file