[fea]
[ui调整]
This commit is contained in:
yangyakun
2025-05-13 12:03:38 +08:00
parent e0836a0170
commit 4b6e657650
19 changed files with 83 additions and 234 deletions

View File

@@ -3,6 +3,7 @@ package com.mogo.och.bridge
import android.annotation.SuppressLint
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.manager.loop.BizLoopManager
@@ -31,6 +32,7 @@ object BridgeServiceManager {
private var haveTrajectoryInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
bridgeService?.invokeTrajectoryHaveDataListener(newValue)
CallerLogger.d(TAG,"haveTrajectoryInfo 发生变化:${newValue}")
}
trajectoryTime = System.currentTimeMillis()
@@ -40,6 +42,7 @@ object BridgeServiceManager {
private var havePredictionInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
bridgeService?.invokePredictionHavaData(newValue)
CallerLogger.d(TAG,"havePredictionInfo 发生变化:${newValue}")
}
predictionTime = System.currentTimeMillis()
}

View File

@@ -125,11 +125,11 @@ class TaxiPassengerBaseFragment :
}else{
WakeUpManager.stopWakeup()
}
if(selectItem!=BottomBar.SelectView.MUSIC){
if(!MusicModel.isPlaying()){
musicBarView.visibility = View.GONE
}
}
// if(selectItem!=BottomBar.SelectView.MUSIC){
// if(!MusicModel.isPlaying()){
// musicBarView.visibility = View.GONE
// }
// }
when (selectItem) {
BottomBar.SelectView.PRECISIONMAP -> {
CallerHmiViewControlListenerManager.invokeMainPageViewVisible(View.VISIBLE)

View File

@@ -1,6 +1,7 @@
package com.mogo.och.unmanned.passenger.ui.homepage
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.och.common.module.biz.birdge.BridgeListener
import com.mogo.och.common.module.biz.birdge.BridgeManager
import com.mogo.och.common.module.manager.loop.BizLoopManager
@@ -53,6 +54,7 @@ class HomeViewModel : ViewModel(), BridgeListener, OrderListener {
}
fun checkScreenChange(){
CallerLogger.d(TAG,"havePredictionInfos:${havePredictionInfos}--havePredictionInfos:${havePredictionInfos}--order:${order}")
if(order!=null&&havePredictionInfos&&havePredictionInfos){
// 展示三联屏
BizLoopManager.runInMainThread{

View File

@@ -19,6 +19,7 @@ import com.mogo.och.common.module.manager.audition.PlayState
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.unmanned.taxi.passenger.R
import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_music_cover
import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_music_cover_bg
import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_music_point
import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_show_next
import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_show_pre
@@ -46,6 +47,7 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi
private var viewModel:MusicPlayingViewModel?=null
private var animator:ObjectAnimator?=null
private var animatorBg:ObjectAnimator?=null
private var animatorPoint:ObjectAnimator?=null
private var isSeekBarTouch = false
@@ -135,6 +137,16 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi
animator?.repeatMode = ValueAnimator.RESTART
animator?.interpolator = LinearInterpolator()
animator?.start()
if(animatorBg!=null){
animatorBg?.cancel()
animatorBg = null
}
animatorBg = ObjectAnimator.ofFloat(iv_music_cover_bg, "rotation", 0f, 360f)
animatorBg?.duration = 3000
animatorBg?.repeatCount = -1
animatorBg?.repeatMode = ValueAnimator.RESTART
animatorBg?.interpolator = LinearInterpolator()
animatorBg?.start()
if(animatorPoint!=null){
animatorPoint?.cancel()
animatorPoint = null
@@ -142,7 +154,7 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi
animatorPoint = ObjectAnimator.ofFloat(iv_music_point, "rotation", iv_music_point.rotation, 25f)
iv_music_point.pivotX = (centerWidth).toFloat()
iv_music_point.pivotY = (centerHeight).toFloat()
animatorPoint?.duration = 2000
animatorPoint?.duration = 1000
animatorPoint?.interpolator = LinearInterpolator()
animatorPoint?.start()
}
@@ -151,6 +163,10 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi
animator?.cancel()
animator = null
}
if(animatorBg!=null){
animatorBg?.cancel()
animatorBg = null
}
if(animatorPoint!=null){
animatorPoint?.cancel()
@@ -159,7 +175,7 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi
animatorPoint = ObjectAnimator.ofFloat(iv_music_point, "rotation", iv_music_point.rotation,0f)
iv_music_point.pivotX = (centerWidth).toFloat()
iv_music_point.pivotY = (centerHeight).toFloat()
animatorPoint?.duration = 2000
animatorPoint?.duration = 1000
animatorPoint?.interpolator = LinearInterpolator()
animatorPoint?.start()
}

View File

@@ -6,7 +6,7 @@ import android.graphics.drawable.GradientDrawable
import android.os.Bundle
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.RelativeLayout
import androidx.constraintlayout.widget.ConstraintLayout
import com.google.android.flexbox.AlignItems
import com.google.android.flexbox.FlexDirection
import com.google.android.flexbox.FlexWrap
@@ -24,7 +24,7 @@ class OverMapView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : RelativeLayout(context, attrs, defStyleAttr){
) : ConstraintLayout(context, attrs, defStyleAttr){
private var iconListItemAdapter:IconListItemAdapter?=null

View File

@@ -21,7 +21,7 @@ class LightSetting @JvmOverloads constructor(
override fun upDateLight(percentaget: Float) {
if (!Settings.System.canWrite(context)) {
CallerRequestActivityHandleManager.requestPermission(
TaxiPSettingView.TAG,
TAG,
Settings.ACTION_MANAGE_WRITE_SETTINGS
)
return
@@ -32,12 +32,11 @@ class LightSetting @JvmOverloads constructor(
} else {
BrightnessUtils.setAutoBrightnessEnabled(true)
}
setTextValue(NumberFormatUtil.percentage(percentaget,0))
}
override fun initLightAndVoice(){
val percentaget = BrightnessUtils.getBrightness().toFloat() / 255
setHeightBar(percentaget)
setHeightBar(1-percentaget)
setTextValue(NumberFormatUtil.percentage(percentaget,0))
}

View File

@@ -1,180 +0,0 @@
package com.mogo.och.unmanned.passenger.ui.setting
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.Drawable
import android.graphics.drawable.LayerDrawable
import android.media.AudioManager
import android.provider.Settings
import android.text.TextUtils
import android.util.AttributeSet
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.widget.SeekBar
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import com.mogo.commons.module.intent.IMogoIntentListener
import com.mogo.commons.module.intent.IntentManager
import com.mogo.commons.module.receiver.MogoReceiver
import com.mogo.commons.module.receiver.MogoReceiver.ACTION_VOLUME_CHANGE
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.setting.CallerRequestActivityHandleManager
import com.mogo.eagle.core.utilcode.util.BrightnessUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.common.module.wigets.MineGradientDrawable
import com.mogo.och.unmanned.taxi.passenger.R
import kotlinx.android.synthetic.main.taxi_p_setting_view.view.*
import me.jessyan.autosize.utils.AutoSizeUtils
class TaxiPSettingView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,
IMogoIntentListener {
companion object {
const val TAG = "TaxiPSettingView"
}
init {
LayoutInflater.from(context).inflate(R.layout.taxi_p_setting_view, this, true)
initView()
}
private var mAudioManager: AudioManager? = null
private var mMaxVolume: Int? = 15
@SuppressLint("NewApi")
private fun initView() {
sb_light_bar.setProgressDrawableTiled(getDrawable())
sb_light_bar.max = 100
sb_light_bar.min = 5
sb_light_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
tvSoundPer.text = "$progress%"
if (fromUser) {
if (!Settings.System.canWrite(context)) {
CallerRequestActivityHandleManager.requestPermission(
TAG,
Settings.ACTION_MANAGE_WRITE_SETTINGS
)
return
}
if (BrightnessUtils.isAutoBrightnessEnabled()) {
BrightnessUtils.setBrightness(((progress.toFloat() / 100) * 255).toInt())
} else {
BrightnessUtils.setAutoBrightnessEnabled(true)
}
}
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {}
override fun onStopTrackingTouch(seekBar: SeekBar?) {}
})
sb_light_bar.progress = (BrightnessUtils.getBrightness() * 100) / 255
sb_voice_bar.setProgressDrawableTiled(getDrawable())
sb_voice_bar.max = 100
sb_voice_bar.min = 5
sb_voice_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
tvVoicePer.text = "$progress%"
if (fromUser) {
mMaxVolume?.let {
var currentValue = ((progress.toFloat() / 100) * it).toInt()
if (currentValue <= 0) {
currentValue = 1
}
mAudioManager?.setStreamVolume(
AudioManager.STREAM_MUSIC,
currentValue,
AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE
)
}
}
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {}
override fun onStopTrackingTouch(seekBar: SeekBar?) {}
})
context?.let {
mAudioManager = it.getSystemService(Context.AUDIO_SERVICE) as AudioManager
mMaxVolume = mAudioManager?.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
updateVolume()
}
}
private fun updateVolume() {
val mCurrentVolume = mAudioManager?.getStreamVolume(AudioManager.STREAM_MUSIC)
mMaxVolume?.let { max ->
mCurrentVolume?.let { current ->
if (current == 1) {
sb_voice_bar.progress = 5
tvVoicePer.text = "5%"
} else {
val fl = current.toFloat() / max * 100
sb_voice_bar.progress = fl.toInt()
tvVoicePer.text = "${fl.toInt()}%"
}
}
}
}
private fun getDrawable(): Drawable {
val dp2px = AutoSizeUtils.dp2px(context, 26f)//进度条高度
val color2CBFFC = ContextCompat.getColor(context, R.color.taxi_cp_2CBFFC)
val color1060FF = ContextCompat.getColor(context, R.color.taxi_cp_1060ff)
val color96A5C2 = ContextCompat.getColor(context, R.color.taxi_cp_96a5c2)
val temp03 = MineGradientDrawable(color2CBFFC, color1060FF, dp2px)
val clipDrawable3 = ClipDrawable(temp03, Gravity.START, ClipDrawable.HORIZONTAL)
val temp01 = MineGradientDrawable(color96A5C2, color96A5C2, dp2px)
val arr = arrayOf(temp01, clipDrawable3)
val ld = LayerDrawable(arr)
ld.setDrawableByLayerId(android.R.id.background, temp01)
ld.setDrawableByLayerId(android.R.id.progress, clipDrawable3)
return ld
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
IntentManager.getInstance().registerIntentListener(ACTION_VOLUME_CHANGE, this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
IntentManager.getInstance().unregisterIntentListener(ACTION_VOLUME_CHANGE, this)
}
override fun onWindowVisibilityChanged(visibility: Int) {
super.onWindowVisibilityChanged(visibility)
if (visibility == View.VISIBLE) {
sb_light_bar.progress = (BrightnessUtils.getBrightness() * 100) / 255
}
}
override fun onWindowFocusChanged(hasWindowFocus: Boolean) {
super.onWindowFocusChanged(hasWindowFocus)
if (hasWindowFocus) {
sb_light_bar.progress = (BrightnessUtils.getBrightness() * 100) / 255
}
}
override fun onIntentReceived(intentStr: String?, intent: Intent?) {
if (TextUtils.equals(ACTION_VOLUME_CHANGE, intentStr)) {
if (intent!!.getIntExtra(
MogoReceiver.EXTRA_VOLUME_STREAM_TYPE, -1
) == AudioManager.STREAM_MUSIC
) {
ThreadUtils.runOnUiThread {
updateVolume()
}
}
}
}
}

View File

@@ -97,26 +97,31 @@ open class VerticalSeekBar @JvmOverloads constructor(
tempSet.applyTo(this)
CallerLogger.d(TAG,"新的dy:${draggableButton.translationY}")
setTextValue(NumberFormatUtil.percentage(getPercentaget(),0))
}
MotionEvent.ACTION_UP -> {
var percentaget = draggableButton.translationY/maxHeightValue
if(percentaget>0.99){
percentaget = 1.0f
draggableButton.translationY = maxHeightValue.toFloat()
}else if(percentaget<0.01){
percentaget = 0.0f
draggableButton.translationY = 0f
}
upDateLight(percentaget)
upDateLight(getPercentaget())
}
else -> {}
}
return true
}
private fun getPercentaget(): Float {
var percentaget = draggableButton.translationY / maxHeightValue
if (percentaget > 0.99) {
percentaget = 0.0f
draggableButton.translationY = maxHeightValue.toFloat()
} else if (percentaget < 0.01) {
percentaget = 1.0f
draggableButton.translationY = 0f
}else{
percentaget = 1-percentaget
}
return percentaget
}
open fun upDateLight(percentaget: Float) {
}

View File

@@ -49,7 +49,6 @@ class VoiceSetting @JvmOverloads constructor(
currentValue,
AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE
)
setTextValue(NumberFormatUtil.percentage(percentaget,0))
}
}
@@ -65,17 +64,9 @@ class VoiceSetting @JvmOverloads constructor(
mMaxVolume = it.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
}
val mCurrentVolume = it.getStreamVolume(AudioManager.STREAM_MUSIC)
val per = mCurrentVolume.toFloat() / mMaxVolume
val currentVolume = per * maxHeightValue
CallerLogger.d(TAG,"当前的声音:${mCurrentVolume}")
ObjectAnimator.ofFloat(
draggableButton, "translationY", draggableButton.translationY,
currentVolume
).apply {
duration = 500
}.start()
tv_current_value.text = "${(BrightnessUtils.getBrightness() * 100) / 255}"
setTextValue(NumberFormatUtil.percentage(per,0))
val percentaget = mCurrentVolume.toFloat() / mMaxVolume
setHeightBar(1-percentaget)
setTextValue(NumberFormatUtil.percentage(percentaget,0))
}
}

View File

@@ -557,10 +557,6 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
}
fun showOrHideStartPlayButton(isShow: Boolean) {
if (fileType == MediaItem.MEDIA_TYPE_IMAGE) {
aivStartPlay?.visibility = View.GONE
return
}
aivStartPlay?.visibility = if (isShow ) View.VISIBLE else View.GONE
}
fun playStatusListener(){

View File

@@ -116,7 +116,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginEnd="@dimen/dp_33"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -41,15 +41,17 @@
android:max="100"
android:progress="0"
android:id="@+id/sb_musuc_bar_progess"
android:thumb="@drawable/taxi_p_music_seekbar_thumb"
android:thumb="@null"
app:layout_constraintBottom_toBottomOf="parent"
android:paddingStart="@dimen/dp_0"
app:layout_constraintStart_toEndOf="@+id/aciv_music_bottom"
android:layout_marginBottom="@dimen/dp_46"
android:duplicateParentState="true"
android:paddingTop="@dimen/dp_8"
android:paddingBottom="@dimen/dp_8"
android:progressDrawable="@drawable/taxt_p_music_seekbar_style"
android:layout_width="@dimen/dp_300"
android:layout_height="@dimen/dp_8"/>
android:layout_height="@dimen/dp_24"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_music_toggle_bar"

View File

@@ -117,6 +117,7 @@
app:layout_constraintTop_toBottomOf="@+id/iv_toggle"
android:layout_marginTop="@dimen/dp_53"
android:duplicateParentState="true"
android:splitTrack="false"
android:progressDrawable="@drawable/taxt_p_music_seekbar_style"
android:paddingTop="@dimen/dp_16"
android:paddingBottom="@dimen/dp_16"

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:parentTag="RelativeLayout">
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<com.mogo.eagle.core.function.view.TravelRealityView
android:id="@+id/travelRealityView"
@@ -29,8 +29,8 @@
android:paddingBottom="@dimen/dp_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="@dimen/dp_46"
android:layout_marginBottom="@dimen/dp_198"/>
@@ -53,4 +53,24 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_only_center_bg"
android:src="@drawable/taxi_p_only_center_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/ovbv_bottom_icons"
android:layout_marginEnd="@dimen/dp_46"
android:layout_marginBottom="@dimen/dp_46"
android:layout_width="@dimen/dp_103"
android:layout_height="@dimen/dp_103"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_only_center"
android:src="@drawable/taxi_p_center_location_selector"
app:layout_constraintTop_toTopOf="@+id/aciv_only_center_bg"
app:layout_constraintBottom_toBottomOf="@+id/aciv_only_center_bg"
app:layout_constraintStart_toStartOf="@+id/aciv_only_center_bg"
app:layout_constraintEnd_toEndOf="@+id/aciv_only_center_bg"
android:layout_width="@dimen/dp_42"
android:layout_height="@dimen/dp_42" />
</merge>

View File

@@ -91,9 +91,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="MogoMind"
android:textColor="#63707D"
android:textSize="@dimen/dp_42"
android:textStyle="bold"
android:textColor="@color/taxi_cp_394047"
android:textSize="@dimen/dp_32"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -14,8 +14,8 @@
app:layout_constraintEnd_toEndOf="parent"
android:src="@drawable/taxt_p_bottom_precisionmap_normal"
android:layout_marginTop="@dimen/dp_16"
android:layout_width="@dimen/dp_81"
android:layout_height="@dimen/dp_81"/>
android:layout_width="@dimen/dp_70"
android:layout_height="@dimen/dp_71"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_title"

View File

@@ -101,7 +101,6 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_71"
android:textSize="@dimen/dp_36"
android:fontFamily="@font/taxt_u_p_din"
android:textColor="@color/color_white"
tools:textColor="@color/result_view"
app:layout_constraintStart_toStartOf="parent"

View File

@@ -5,7 +5,6 @@
android:id="@+id/infoContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/taxt_u_p_video_light_bg"
tools:ignore="MissingDefaultResource">

View File

@@ -13,7 +13,6 @@
android:textColor="@color/taxi_p_303C52"
android:textSize="@dimen/dp_85"
android:layout_marginEnd="@dimen/dp_6"
android:fontFamily="@font/taxt_u_p_din"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -26,7 +25,6 @@
android:layout_height="wrap_content"
android:textColor="@color/taxi_p_303C52"
android:textSize="@dimen/dp_24"
android:fontFamily="@font/taxt_u_p_din"
app:layout_constraintTop_toBottomOf="@+id/actv_speed_value"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/actv_speed_value"