[fea]
[登录页面添加statusbar]
This commit is contained in:
yangyakun
2024-09-03 12:20:05 +08:00
parent db2d1268eb
commit 709ded2a1a
4 changed files with 20 additions and 5 deletions

View File

@@ -15,12 +15,14 @@ import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.ActivityUtils import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.KeyboardUtils import com.mogo.eagle.core.utilcode.util.KeyboardUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.biz.BuildConfig import com.mogo.och.biz.BuildConfig
import com.mogo.och.biz.R import com.mogo.och.biz.R
import com.mogo.och.biz.login.callback.ILoginViewCallback import com.mogo.och.biz.login.callback.ILoginViewCallback
import com.mogo.och.biz.login.presenter.LoginPresenter import com.mogo.och.biz.login.presenter.LoginPresenter
import kotlinx.android.synthetic.main.biz_login_view.bg_start_bar
import kotlinx.android.synthetic.main.biz_login_view.biz_acbtn_login import kotlinx.android.synthetic.main.biz_login_view.biz_acbtn_login
import kotlinx.android.synthetic.main.biz_login_view.biz_ace_login_phone_value import kotlinx.android.synthetic.main.biz_login_view.biz_ace_login_phone_value
import kotlinx.android.synthetic.main.biz_login_view.biz_acet_phone_code_value import kotlinx.android.synthetic.main.biz_login_view.biz_acet_phone_code_value
@@ -77,7 +79,11 @@ class LoginFragment : MvpFragment<LoginFragment?, LoginPresenter?>(), ILoginView
} }
private fun initBg() { private fun initBg() {
bg_start_bar.post {
val params: ViewGroup.LayoutParams = bg_start_bar.getLayoutParams()
params.height = BarUtils.getStatusBarHeight()
bg_start_bar.layoutParams = params
}
} }
private fun initListener() { private fun initListener() {

View File

@@ -23,6 +23,13 @@
android:layout_width="1071dp" android:layout_width="1071dp"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<View
android:id="@+id/bg_start_bar"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/biz_login_171D2B"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_72"/>
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/biz_actv_welcome_login_title" android:id="@+id/biz_actv_welcome_login_title"

View File

@@ -4,5 +4,6 @@
<color name="biz_login_5F6582">#5F6582</color> <color name="biz_login_5F6582">#5F6582</color>
<color name="biz_login_72A7FF">#72A7FF</color> <color name="biz_login_72A7FF">#72A7FF</color>
<color name="biz_login_A0B3DA">#A0B3DA</color> <color name="biz_login_A0B3DA">#A0B3DA</color>
<color name="biz_login_171D2B">#171D2B</color>
</resources> </resources>

View File

@@ -58,13 +58,12 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
private fun showFragment() { private fun showFragment() {
val supportFragmentManager: FragmentManager? = activity?.supportFragmentManager val supportFragmentManager: FragmentManager? = activity?.supportFragmentManager
injectStatusBar()
val fragment = if (LoginStatusManager.isLogin()) { val fragment = if (LoginStatusManager.isLogin()) {
val fragment = getFragment() val fragment = getFragment()
injectStatusBar()
LoginStatusManager.resetFragment() LoginStatusManager.resetFragment()
fragment fragment
} else { } else {
removeStatusBar()
CallerHmiManager.hideToolsView() CallerHmiManager.hideToolsView()
ToggleDebugView.toggleDebugView.dismiss() ToggleDebugView.toggleDebugView.dismiss()
SopView.sopView.dismiss() SopView.sopView.dismiss()
@@ -200,8 +199,8 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
} }
override fun onBusinessChangeDebug(businessEnum: BusinessEnum) { override fun onBusinessChangeDebug(businessEnum: BusinessEnum) {
injectStatusBar()
if (businessEnum == BusinessEnum.None) { if (businessEnum == BusinessEnum.None) {
removeStatusBar()
CallerHmiManager.hideToolsView() CallerHmiManager.hideToolsView()
ToggleDebugView.toggleDebugView.dismiss() ToggleDebugView.toggleDebugView.dismiss()
SopView.sopView.dismiss() SopView.sopView.dismiss()
@@ -217,7 +216,6 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
onBusinessChange(businessEnum) onBusinessChange(businessEnum)
val supportFragmentManager: FragmentManager? = activity?.supportFragmentManager val supportFragmentManager: FragmentManager? = activity?.supportFragmentManager
val fragment = getFragment() val fragment = getFragment()
injectStatusBar()
d(TAG, "切换 fragment:${fragment}") d(TAG, "切换 fragment:${fragment}")
LoginStatusManager.resetFragment() LoginStatusManager.resetFragment()
if (supportFragmentManager != null) { if (supportFragmentManager != null) {
@@ -237,6 +235,9 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
contentView.fitsSystemWindows = false contentView.fitsSystemWindows = false
decorView.clipToPadding = false decorView.clipToPadding = false
var statusBarView = decorView.findViewWithTag<View>("status_bar") var statusBarView = decorView.findViewWithTag<View>("status_bar")
if(statusBarView!=null){
return
}
val statusBar = commonService?.getStatusBarView(it) val statusBar = commonService?.getStatusBarView(it)
statusBarView = statusBar ?: StatusBarView(it) statusBarView = statusBar ?: StatusBarView(it)
statusBarView.tag = "status_bar" statusBarView.tag = "status_bar"