Commit f6096946 by fengquan

feat: 图片/视频浏览页状态栏颜色

parent cbc5b96c
......@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager.widget.ViewPager
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.yidianling.consultant.R
import com.yidianling.consultant.preview.GPreviewBuilder.IndicatorType
import com.yidianling.consultant.preview.SmoothImageView.onTransformListener
......@@ -55,21 +56,17 @@ class GPreviewActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
initData()
setContentView(R.layout.consultant_image_preview_photo)
setWindowStatusBarColor()
initView()
initStatusBar()
}
/**
* 初始化状态栏位置
*/
private fun initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
window?.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window?.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window?.statusBarColor = Color.WHITE
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
private fun setWindowStatusBarColor() {
StatusBarUtils.Companion.setWindowStatusBarColor(this, R.color.black)
StatusBarUtils.Companion.setStatusBarLightMode(this, false)
}
private fun initView() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment