From 597c57b6cb0897594a91c75a558222dba167b428 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 2 Jul 2024 19:20:27 +0800 Subject: [PATCH] =?UTF-8?q?[6.5.0]=20[fea]=20[=E7=A6=81=E7=94=A8=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wigets/map/switchvisual/SeekBarView.kt | 14 +++++++++++++- .../och/taxi/passenger/ui/bar/LeftBarView.kt | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/SeekBarView.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/SeekBarView.kt index 5e7d3e3938..20323a5fce 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/SeekBarView.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/SeekBarView.kt @@ -45,6 +45,8 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { private var viewModel: VisualViewModel? = null + var enableCallback:EnableCallback?=null + override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { super.onLayout(changed, left, top, right, bottom) } @@ -132,6 +134,13 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { private var value: VisualViewModel.Visualangle by Delegates.observable(VisualViewModel.Visualangle.None) { _, oldValue, newValue -> if (oldValue != newValue) { viewModel?.changeVisualView(newValue) + if(newValue==VisualViewModel.Visualangle.UnChange){ + this.enableCallback?.enableChangeListener(false) + }else{ + if (oldValue==VisualViewModel.Visualangle.UnChange) { + this.enableCallback?.enableChangeListener(true) + } + } } } @@ -162,7 +171,6 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { ).apply { duration = 100 }.start() - alpha = 0.5f } } } @@ -217,4 +225,8 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { translationByValue(VisualViewModel.Visualangle.Middle) }, UiThreadHandler.MODE.QUEUE) } + + interface EnableCallback{ + fun enableChangeListener(enable:Boolean) + } } \ No newline at end of file diff --git a/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/bar/LeftBarView.kt b/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/bar/LeftBarView.kt index ce7e9fee79..99618fa399 100644 --- a/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/bar/LeftBarView.kt +++ b/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/bar/LeftBarView.kt @@ -6,9 +6,12 @@ import android.util.AttributeSet import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.utilcode.kotlin.onClick +import com.mogo.och.common.module.wigets.map.switchvisual.SeekBarView import com.mogo.och.taxi.passenger.common.R import kotlinx.android.synthetic.main.taxi_p_leftbar.view.iv_center_location import kotlinx.android.synthetic.main.taxi_p_leftbar.view.iv_center_location_bg +import kotlinx.android.synthetic.main.taxi_p_leftbar.view.iv_visual_angle_title_bottom +import kotlinx.android.synthetic.main.taxi_p_leftbar.view.iv_visual_angle_title_head import kotlinx.android.synthetic.main.taxi_p_leftbar.view.iv_visual_angle_title_value_bg @@ -35,6 +38,21 @@ class LeftBarView : ConstraintLayout { iv_center_location_bg.onClick { this.rightBarCallback?.setGo2CenterClick() } + + iv_visual_angle_title_value_bg.enableCallback = object :SeekBarView.EnableCallback{ + override fun enableChangeListener(enable: Boolean) { + if (enable){ + iv_visual_angle_title_head.alpha = 1f + iv_visual_angle_title_bottom.alpha = 1f + iv_visual_angle_title_value_bg.alpha = 1f + }else{ + iv_visual_angle_title_head.alpha = 0.5f + iv_visual_angle_title_bottom.alpha = 0.5f + iv_visual_angle_title_value_bg.alpha = 0.5f + } + } + + } } override fun onVisibilityAggregated(isVisible: Boolean) {