pull/32/head
Awesome 6 years ago
parent 34f9941b87
commit b4d56b0c92
  1. 7
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  2. 1
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt

@ -11,6 +11,7 @@ import androidx.appcompat.view.menu.MenuBuilder
import androidx.appcompat.view.menu.MenuItemImpl
import androidx.core.view.forEach
import androidx.lifecycle.ViewModel
import io.legado.app.R
import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.DrawableUtils
import io.legado.app.lib.theme.ThemeStore
@ -41,7 +42,7 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() {
}
val bool = onCompatCreateOptionsMenu(it)
val primaryTextColor = getPrimaryTextColor(ColorUtils.isColorLight(ThemeStore.primaryColor(this)))
val defaultTextColor = getCompatColor(io.legado.app.R.color.tv_text_default)
val defaultTextColor = getCompatColor(R.color.tv_text_default)
menu.forEach { item ->
(item as MenuItemImpl).let { impl ->
//overflow:展开的item
@ -76,9 +77,9 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() {
protected fun initTheme() {
if (ColorUtils.isColorLight(ThemeStore.primaryColor(this))) {
setTheme(io.legado.app.R.style.AppTheme_Light)
setTheme(R.style.AppTheme_Light)
} else {
setTheme(io.legado.app.R.style.AppTheme_Dark)
setTheme(R.style.AppTheme_Dark)
}
}

@ -6,7 +6,6 @@ import android.view.MenuItem
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager.widget.ViewPager
import com.google.android.material.bottomnavigation.BottomNavigationView
import io.legado.app.R

Loading…
Cancel
Save