Commit f6096946 by fengquan

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

parent cbc5b96c
...@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment ...@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.yidianling.consultant.R import com.yidianling.consultant.R
import com.yidianling.consultant.preview.GPreviewBuilder.IndicatorType import com.yidianling.consultant.preview.GPreviewBuilder.IndicatorType
import com.yidianling.consultant.preview.SmoothImageView.onTransformListener import com.yidianling.consultant.preview.SmoothImageView.onTransformListener
...@@ -55,21 +56,17 @@ class GPreviewActivity : AppCompatActivity() { ...@@ -55,21 +56,17 @@ class GPreviewActivity : AppCompatActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
initData() initData()
setContentView(R.layout.consultant_image_preview_photo) setContentView(R.layout.consultant_image_preview_photo)
setWindowStatusBarColor()
initView() initView()
initStatusBar()
} }
/** /**
* 初始化状态栏位置 * 初始化状态栏位置
*/ */
private fun initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { private fun setWindowStatusBarColor() {
window?.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) StatusBarUtils.Companion.setWindowStatusBarColor(this, R.color.black)
window?.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) StatusBarUtils.Companion.setStatusBarLightMode(this, false)
window?.statusBarColor = Color.WHITE
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
} }
private fun initView() { 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