...
|
...
|
@@ -43,7 +43,7 @@ abstract class BaseFragment : Fragment() { |
|
|
if (Date().month + 1 == 4 && Date().date == 4) {
|
|
|
// initStatusColor(getColor(requireContext(), R.color.colorGray666))
|
|
|
} else {
|
|
|
initStatusColor(0)
|
|
|
// initStatusColor(0)
|
|
|
}
|
|
|
initView()
|
|
|
initData()
|
...
|
...
|
@@ -58,20 +58,20 @@ abstract class BaseFragment : Fragment() { |
|
|
|
|
|
|
|
|
|
|
|
private fun initStatusColor(color: Int) {
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
// requireActivity().window.statusBarColor = if (color == 0) ColorUtil.getColor(requireContext()) else color
|
|
|
}
|
|
|
if (ColorUtils.calculateLuminance(Color.TRANSPARENT) >= 0.5) {
|
|
|
// 设置状态栏中字体的颜色为黑色
|
|
|
requireActivity().window.decorView.systemUiVisibility =
|
|
|
View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
|
|
} else {
|
|
|
// 跟随系统
|
|
|
requireActivity().window.decorView.systemUiVisibility =
|
|
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
|
}
|
|
|
}
|
|
|
// private fun initStatusColor(color: Int) {
|
|
|
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
//// requireActivity().window.statusBarColor = if (color == 0) ColorUtil.getColor(requireContext()) else color
|
|
|
// }
|
|
|
// if (ColorUtils.calculateLuminance(Color.TRANSPARENT) >= 0.5) {
|
|
|
// // 设置状态栏中字体的颜色为黑色
|
|
|
// requireActivity().window.decorView.systemUiVisibility =
|
|
|
// View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
|
|
// } else {
|
|
|
// // 跟随系统
|
|
|
// requireActivity().window.decorView.systemUiVisibility =
|
|
|
// View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
override fun onDestroyView() {
|
|
|
super.onDestroyView()
|
...
|
...
|
|