|
|
@ -3,13 +3,16 @@ package io.legado.app.ui.main.myconfig |
|
|
|
import android.content.Intent |
|
|
|
import android.content.Intent |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.Bundle |
|
|
|
import android.view.Menu |
|
|
|
import android.view.Menu |
|
|
|
|
|
|
|
import android.view.MenuItem |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.BaseFragment |
|
|
|
import io.legado.app.base.BaseFragment |
|
|
|
import io.legado.app.ui.config.ConfigActivity |
|
|
|
import io.legado.app.ui.config.ConfigActivity |
|
|
|
import io.legado.app.ui.config.ConfigViewModel |
|
|
|
import io.legado.app.ui.config.ConfigViewModel |
|
|
|
|
|
|
|
import io.legado.app.ui.search.SearchActivity |
|
|
|
import kotlinx.android.synthetic.main.fragment_my_config.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_my_config.* |
|
|
|
import kotlinx.android.synthetic.main.view_titlebar.* |
|
|
|
import kotlinx.android.synthetic.main.view_titlebar.* |
|
|
|
|
|
|
|
import org.jetbrains.anko.startActivity |
|
|
|
|
|
|
|
|
|
|
|
class MyConfigFragment : BaseFragment(R.layout.fragment_my_config) { |
|
|
|
class MyConfigFragment : BaseFragment(R.layout.fragment_my_config) { |
|
|
|
|
|
|
|
|
|
|
@ -17,13 +20,17 @@ class MyConfigFragment : BaseFragment(R.layout.fragment_my_config) { |
|
|
|
setSupportToolbar(toolbar) |
|
|
|
setSupportToolbar(toolbar) |
|
|
|
|
|
|
|
|
|
|
|
tv_theme_config.setOnClickListener { |
|
|
|
tv_theme_config.setOnClickListener { |
|
|
|
val intent = Intent(context, ConfigActivity::class.java) |
|
|
|
requireContext().startActivity<ConfigActivity>(Pair("configType", ConfigViewModel.TYPE_THEME_CONFIG)) |
|
|
|
intent.putExtra("configType", ConfigViewModel.TYPE_THEME_CONFIG) |
|
|
|
|
|
|
|
startActivity(intent) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onCompatCreateOptionsMenu(menu: Menu) { |
|
|
|
override fun onCompatCreateOptionsMenu(menu: Menu) { |
|
|
|
menuInflater.inflate(R.menu.my_config, menu) |
|
|
|
menuInflater.inflate(R.menu.my_config, menu) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCompatOptionsItemSelected(item: MenuItem) { |
|
|
|
|
|
|
|
when (item.itemId) { |
|
|
|
|
|
|
|
R.id.action_settings -> requireContext().startActivity<SearchActivity>() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |