作者 liyan

修改状态栏

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
... ...
... ... @@ -64,7 +64,7 @@ abstract class BaseActivity : AppCompatActivity() {
}
// EventBus.getDefault().register(this)
ImmersionBar.with(this).transparentStatusBar().init()
ImmersionBar.with(this).transparentStatusBar().statusBarDarkFont(false).init()
// .transparentNavigationBar() //透明导航栏,不写默认黑色(设置此方法,fullScreen()方法自动为true)
// .transparentBar().navigationBarDarkIcon(true)
}
... ...
... ... @@ -13,6 +13,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.FragmentHomeBinding
import com.br_technology.securitytrain_master.ui.home.activity.DatabaseActivity
import com.br_technology.securitytrain_master.ui.home.activity.OnlineActivity
import com.br_technology.securitytrain_master.ui.home.activity.SearchActivity
import com.br_technology.securitytrain_master.ui.home.activity.TextCourseActivity
import com.br_technology.securitytrain_master.ui.home.adapter.RecommendDataAdapter
... ... @@ -23,6 +24,8 @@ import com.br_technology.securitytrain_master.ui.home.viewmodel.MineViewModel
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import com.gyf.immersionbar.ImmersionBar
import com.gyf.immersionbar.components.SimpleImmersionOwner
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
import com.youth.banner.Banner
import com.youth.banner.adapter.BannerAdapter
... ... @@ -37,7 +40,7 @@ import com.youth.banner.indicator.CircleIndicator
* des:
*/
class HomeFragment :
BaseLifeCycleFragment<MineViewModel, FragmentHomeBinding>(FragmentHomeBinding::inflate) {
BaseLifeCycleFragment<MineViewModel, FragmentHomeBinding>(FragmentHomeBinding::inflate) ,SimpleImmersionOwner{
override fun initDataObserver() {
}
... ... @@ -181,6 +184,13 @@ class HomeFragment :
}
override fun initImmersionBar() {
}
override fun immersionBarEnabled(): Boolean {
return true
}
}
//class HomeFragment : Fragment() {
// override fun onCreateView(
... ...
... ... @@ -34,12 +34,16 @@ class MainActivity :
home.setOnClickListener {
viewPage.currentItem = 0
ImmersionBar.with(this@MainActivity).statusBarDarkFont(false).init();
}
questionBank.setOnClickListener {
viewPage.currentItem = 1
ImmersionBar.with(this@MainActivity).statusBarDarkFont(true).init();
}
mine.setOnClickListener {
viewPage.currentItem = 2
ImmersionBar.with(this@MainActivity).statusBarDarkFont(false).init();
}
}
}
... ...
... ... @@ -3,4 +3,4 @@
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="24dp"
android:background="@color/color_25" />
\ No newline at end of file
android:background="@android:color/transparent" />
\ No newline at end of file
... ...