[v2.13.0][状态栏]状态窗口部分状态上移
This commit is contained in:
@@ -290,9 +290,9 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
setProxyTrafficLightView(viewTrafficLightVr)
|
||||
setProxyLimitingSpeedView(viewLimitingVelocity)
|
||||
setViewNotificationProvider(this)
|
||||
context?.also {
|
||||
CallerDevaToolsManager.showStatusBar(it, statusBarContainer)
|
||||
}
|
||||
// context?.also {
|
||||
// CallerDevaToolsManager.showStatusBar(it, statusBarContainer)
|
||||
// }
|
||||
}
|
||||
|
||||
override fun getNotificationView(): IViewNotification? =
|
||||
@@ -1580,7 +1580,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
?.commitAllowingStateLoss()
|
||||
context?.let { CallerDevaToolsManager.showStatusBar(it, statusBarContainer) }
|
||||
// context?.let { CallerDevaToolsManager.showStatusBar(it, statusBarContainer) }
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -2,10 +2,10 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import android.widget.RelativeLayout
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.devatools.*
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
@@ -17,13 +17,14 @@ class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RelativeLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener {
|
||||
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusBarView"
|
||||
}
|
||||
|
||||
init {
|
||||
orientation = HORIZONTAL
|
||||
LayoutInflater.from(context).inflate(R.layout.view_status_bar, this, true)
|
||||
}
|
||||
|
||||
@@ -31,18 +32,11 @@ class StatusBarView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
val layoutParamsLeft =
|
||||
LayoutParams(ScreenUtils.getScreenWidth() / 3, BarUtils.getStatusBarHeight())
|
||||
viewStatusBarLeft.layoutParams = layoutParamsLeft
|
||||
val layoutParamsRight =
|
||||
LayoutParams(ScreenUtils.getScreenWidth() / 3 * 2, BarUtils.getStatusBarHeight())
|
||||
layoutParamsRight.addRule(ALIGN_PARENT_END)
|
||||
layoutParamsRight.addRule(CENTER_HORIZONTAL)
|
||||
layoutParamsRight.addRule(CENTER_IN_PARENT)
|
||||
layoutParamsRight.marginEnd = context.resources.getDimension(R.dimen.dp_44).toInt()
|
||||
viewStatusBarRight.layoutParams = layoutParamsRight
|
||||
viewStatusBarRight.addView(BatteryGroupView(this.context))
|
||||
|
||||
//将状态窗口中的状态移到状态栏上
|
||||
CallerDevaToolsManager.showStatusBar(context, status_container)
|
||||
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
}
|
||||
@@ -84,7 +78,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
CallerDevaToolsManager.hideStatusBar()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,56 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_72">
|
||||
android:layout_height="@dimen/dp_72"
|
||||
tools:parentTag="android.widget.LinearLayout">
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/viewTextClock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_2C2E30"
|
||||
android:textSize="@dimen/dp_45"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/viewStatusBarTag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_27"
|
||||
android:gravity="center"
|
||||
android:text="@string/status_bar_tag"
|
||||
android:textColor="@color/color_2C2E30"
|
||||
android:textSize="@dimen/dp_35" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_18" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarLeft"
|
||||
android:id="@+id/status_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/dp_30"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_44"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/viewTextClock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_2C2E30"
|
||||
android:textSize="@dimen/dp_45"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/viewStatusBarTag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_27"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/status_bar_tag"
|
||||
android:textColor="@color/color_2C2E30"
|
||||
android:textSize="@dimen/dp_35" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_18" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_44"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</merge>
|
||||
Reference in New Issue
Block a user