Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Jan 30, 2025
1 parent 1360272 commit 9d9a754
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/java/io/legado/app/base/BaseActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.view.MenuItem
import android.view.MotionEvent
import android.view.View
import android.widget.FrameLayout
import androidx.activity.addCallback
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
Expand Down Expand Up @@ -87,6 +88,9 @@ abstract class BaseActivity<VB : ViewBinding>(
findViewById<TitleBar>(R.id.title_bar)
?.onMultiWindowModeChanged(isInMultiWindowMode, fullScreen)
}
onBackPressedDispatcher.addCallback(this) {
finish()
}
observeLiveBus()
onActivityCreated(savedInstanceState)
}
Expand Down Expand Up @@ -138,10 +142,12 @@ abstract class BaseActivity<VB : ViewBinding>(
setTheme(R.style.AppTheme_Dark)
window.decorView.applyBackgroundTint(backgroundColor)
}

Theme.Light -> {
setTheme(R.style.AppTheme_Light)
window.decorView.applyBackgroundTint(backgroundColor)
}

else -> {
if (ColorUtils.isColorLight(primaryColor)) {
setTheme(R.style.AppTheme_Light)
Expand Down

0 comments on commit 9d9a754

Please sign in to comment.