diff --git a/app/src/main/java/io/legado/app/ui/about/DonateActivity.kt b/app/src/main/java/io/legado/app/ui/about/DonateActivity.kt index b5f6c7a8d..32c8d0172 100644 --- a/app/src/main/java/io/legado/app/ui/about/DonateActivity.kt +++ b/app/src/main/java/io/legado/app/ui/about/DonateActivity.kt @@ -13,7 +13,6 @@ import io.legado.app.base.BaseActivity import io.legado.app.lib.theme.ATH import io.legado.app.utils.ACache import kotlinx.android.synthetic.main.activity_donate.* -import kotlinx.android.synthetic.main.view_title_bar.* import org.jetbrains.anko.toast import java.net.URLEncoder @@ -25,7 +24,6 @@ import java.net.URLEncoder class DonateActivity : BaseActivity(R.layout.activity_donate) { override fun onActivityCreated(savedInstanceState: Bundle?) { - setSupportActionBar(toolbar) ATH.applyEdgeEffectColor(scroll_view) vw_zfb_tz.setOnClickListener { aliDonate(this) } cv_wx_gzh.setOnClickListener { diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt index 8e389bb37..47d15704e 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt @@ -26,7 +26,6 @@ import io.legado.app.ui.changesource.ChangeSourceDialog import io.legado.app.ui.chapterlist.ChapterListActivity import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_audio_play.* -import kotlinx.android.synthetic.main.view_title_bar.* import org.apache.commons.lang3.time.DateFormatUtils import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onLongClick @@ -43,7 +42,6 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a private var adjustProgress = false override fun onActivityCreated(savedInstanceState: Bundle?) { - setSupportActionBar(toolbar) AudioPlay.titleData.observe(this, Observer { title_bar.title = it }) AudioPlay.coverData.observe(this, Observer { upCover(it) }) viewModel.initData(intent) diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index ec3b3060a..81af03c04 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -30,7 +30,6 @@ import io.legado.app.utils.getViewModel import io.legado.app.utils.gone import io.legado.app.utils.visible import kotlinx.android.synthetic.main.activity_book_info.* -import kotlinx.android.synthetic.main.view_title_bar.* import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.startActivity import org.jetbrains.anko.toast @@ -46,7 +45,6 @@ class BookInfoActivity : get() = getViewModel(BookInfoViewModel::class.java) override fun onActivityCreated(savedInstanceState: Bundle?) { - setSupportActionBar(toolbar) title_bar.background.alpha = 0 viewModel.bookData.observe(this, Observer { showBook(it) }) viewModel.isLoadingData.observe(this, Observer { upLoading(it) }) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 11c9dc5cf..7b9daf6d2 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -40,7 +40,6 @@ import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_book_read.* import kotlinx.android.synthetic.main.view_book_page.* import kotlinx.android.synthetic.main.view_read_menu.* -import kotlinx.android.synthetic.main.view_title_bar.* import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.launch @@ -66,7 +65,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo override fun onActivityCreated(savedInstanceState: Bundle?) { Help.upLayoutInDisplayCutoutMode(window) - setSupportActionBar(toolbar) initView() ReadBook.callBack = this ReadBook.titleDate.observe(this, Observer { title_bar.title = it }) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 4623579b7..d2cc149e1 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -36,7 +36,6 @@ import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_book_source.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* import kotlinx.android.synthetic.main.view_search.* -import kotlinx.android.synthetic.main.view_title_bar.* import org.jetbrains.anko.startActivity import org.jetbrains.anko.startActivityForResult import org.jetbrains.anko.startService @@ -57,7 +56,6 @@ class BookSourceActivity : VMBaseActivity(R.layout.activity private var groupMenu: SubMenu? = null override fun onActivityCreated(savedInstanceState: Bundle?) { - setSupportActionBar(toolbar) initUriScheme() initRecyclerView() initSearchView() diff --git a/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListActivity.kt b/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListActivity.kt index e1175bc6a..86db52459 100644 --- a/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListActivity.kt +++ b/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListActivity.kt @@ -17,7 +17,6 @@ import io.legado.app.utils.gone import io.legado.app.utils.visible import kotlinx.android.synthetic.main.activity_chapter_list.* import kotlinx.android.synthetic.main.view_tab_layout.* -import kotlinx.android.synthetic.main.view_title_bar.* class ChapterListActivity : VMBaseActivity(R.layout.activity_chapter_list) { override val viewModel: ChapterListViewModel @@ -26,7 +25,6 @@ class ChapterListActivity : VMBaseActivity(R.layout.activi private var searchView: SearchView? = null override fun onActivityCreated(savedInstanceState: Bundle?) { - setSupportActionBar(toolbar) tab_layout.setSelectedTabIndicatorColor(accentColor) viewModel.bookUrl = intent.getStringExtra("bookUrl") viewModel.loadBook { diff --git a/app/src/main/java/io/legado/app/ui/config/ConfigActivity.kt b/app/src/main/java/io/legado/app/ui/config/ConfigActivity.kt index a926a8ae2..838b5c31d 100644 --- a/app/src/main/java/io/legado/app/ui/config/ConfigActivity.kt +++ b/app/src/main/java/io/legado/app/ui/config/ConfigActivity.kt @@ -5,7 +5,6 @@ import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_config.* -import kotlinx.android.synthetic.main.view_title_bar.* class ConfigActivity : VMBaseActivity(R.layout.activity_config) { override val viewModel: ConfigViewModel @@ -15,7 +14,6 @@ class ConfigActivity : VMBaseActivity(R.layout.activity_config) intent.getIntExtra("configType", -1).let { if (it != -1) viewModel.configType = it } - this.setSupportActionBar(toolbar) when (viewModel.configType) { ConfigViewModel.TYPE_CONFIG -> { diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt index 08f03ac8f..a75134288 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt @@ -35,7 +35,6 @@ import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_rss_source.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* import kotlinx.android.synthetic.main.view_search.* -import kotlinx.android.synthetic.main.view_title_bar.* import org.jetbrains.anko.startActivity import org.jetbrains.anko.startActivityForResult @@ -55,7 +54,6 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r private var groupMenu: SubMenu? = null override fun onActivityCreated(savedInstanceState: Bundle?) { - setSupportActionBar(toolbar) initRecyclerView() initSearchView() initLiveDataGroup() diff --git a/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt b/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt index d516601d9..7001c3999 100644 --- a/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt @@ -2,7 +2,6 @@ package io.legado.app.ui.widget import android.content.Context import android.content.res.ColorStateList -import android.graphics.Color import android.graphics.PorterDuff import android.graphics.drawable.Drawable import android.util.AttributeSet @@ -14,9 +13,7 @@ import androidx.appcompat.widget.Toolbar import androidx.core.graphics.drawable.DrawableCompat import com.google.android.material.appbar.AppBarLayout import io.legado.app.R -import io.legado.app.lib.theme.DrawableUtils import io.legado.app.lib.theme.primaryColor -import io.legado.app.lib.theme.primaryTextColor import io.legado.app.utils.activity import io.legado.app.utils.getNavigationBarHeight import io.legado.app.utils.getStatusBarHeight @@ -190,20 +187,6 @@ class TitleBar(context: Context, attrs: AttributeSet?) : AppBarLayout(context, a it.supportActionBar?.setDisplayHomeAsUpEnabled(displayHomeAsUp) } } - - val primaryTextColor = if (isInEditMode) Color.BLACK else context.primaryTextColor - DrawableUtils.setTint(toolbar.overflowIcon, primaryTextColor) - toolbar.setTitleTextColor(primaryTextColor) - - if (navigationIconTint != null) { - wrapDrawableTint(toolbar.navigationIcon, navigationIconTint, navigationIconTintMode) - } else { - wrapDrawableTint( - toolbar.navigationIcon, - ColorStateList.valueOf(primaryTextColor), - navigationIconTintMode - ) - } } private fun wrapDrawableTint(drawable: Drawable?, tintList: ColorStateList?, tintMode: Int) {