[fea]
[行程title]
This commit is contained in:
yangyakun
2024-10-08 17:41:27 +08:00
parent 7f13613bd3
commit 8c8ed56e15
9 changed files with 241 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ class SwitchBizView: WindowRelativeLayout, SwtichBizeModel.SwtichLineViewCallbac
// 展示loading页面
override fun showLoadingView(){
startLoading = System.currentTimeMillis()
loading_biz.visibility = VISIBLE
loading_biz.visibility = GONE
}

View File

@@ -0,0 +1,74 @@
package com.mogo.och.unmanned.taxi.wigets
import android.content.Context
import android.content.res.TypedArray
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.map.listener.IMogoMapListener
import com.mogo.och.unmanned.taxi.R
import kotlinx.android.synthetic.main.taxi_select_view.view.aciv_check_state
import kotlinx.android.synthetic.main.taxi_select_view.view.actv_server_name
class TaxiSelectView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr),IMogoMapListener {
companion object {
const val TAG = "LoadingMapStatusView"
}
private lateinit var taxiServerTitle:String
init {
LayoutInflater.from(context).inflate(R.layout.taxi_select_view, this, true)
try {
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TaxiSelectView)
taxiServerTitle = typedArray.getString(R.styleable.TaxiSelectView_taxi_server_title)?:""
typedArray.recycle()
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerLogger.d(TAG,"onAttachedToWindow")
actv_server_name.text = taxiServerTitle
actv_server_name.setOnCheckedChangeListener { buttonView, isChecked ->
if(buttonView.id==R.id.actv_server_name){
if(isChecked){
aciv_check_state.visibility = VISIBLE
}else{
aciv_check_state.visibility = GONE
}
}
}
}
fun setCheck(isCheck:Boolean){
actv_server_name.isChecked = isCheck
}
override fun onVisibilityAggregated(isVisible: Boolean) {
super.onVisibilityAggregated(isVisible)
if(isVisible){
}else{
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerLogger.d(TAG,"onDetachedFromWindow")
}
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/taxi_color_2eacff" android:state_checked="true"/>
<item android:color="@color/white" android:state_checked="false"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_loaing_view"
android:layout_width="@dimen/dp_253"
android:layout_height="@dimen/dp_113">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_check_state"
android:layout_width="@dimen/dp_253"
android:layout_height="@dimen/dp_113"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/taxi_selected_head" />
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/actv_server_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:button="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/task_current_itinerary"
android:textColor="@color/taxi_biz_text_color_selector"
android:textSize="@dimen/dp_45" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -6,6 +6,20 @@
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/taxi_biz_bg">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_h_top"
app:layout_constraintGuide_begin="@dimen/dp_20"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_v_left"
app:layout_constraintGuide_begin="@dimen/dp_41"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.appcompat.widget.AppCompatImageView
android:src="@drawable/taxi_biz_bg_header"
app:layout_constraintEnd_toEndOf="parent"
@@ -26,6 +40,20 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<com.mogo.och.unmanned.taxi.wigets.TaxiSelectView
app:taxi_server_title="@string/task_current_itinerary"
app:layout_constraintTop_toBottomOf="@+id/guideline_h_top"
app:layout_constraintStart_toEndOf="@+id/guideline_v_left"
android:layout_marginStart="@dimen/dp_24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<com.mogo.och.unmanned.taxi.wigets.TaxiSelectView
app:layout_constraintTop_toBottomOf="@+id/guideline_h_top"
app:layout_constraintStart_toEndOf="@+id/guideline_v_left"
app:taxi_server_title="@string/task_next_itinerary"
android:layout_marginStart="@dimen/dp_237"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--圆角ImageView布局 -->
<declare-styleable name="TaxiSelectView">
<attr name="taxi_server_title" format="string" />
</declare-styleable>
<!--阴影布局 -->
<declare-styleable name="ShadowLayout">
<!-- 阴影颜色-->
<attr name="shadowColor" format="color"/>
<!-- 圆角大小默认无圆角0-->
<attr name="shadowRadius" format="dimension"/>
<!-- 模糊半径 -->
<attr name="blurRadius" format="dimension" />
<!-- 是否有点击效果-->
<attr name="hasEffect" format="boolean"/>
<attr name="bgColor" format="color"/>
<!-- 水平位移-->
<attr name="xOffset" format="dimension"/>
<!--竖直位移 -->
<attr name="yOffset" format="dimension"/>
<!--横向修正 -->
<attr name="blurCorrectX" format="dimension"/>
<!--纵向向修正 -->
<attr name="blurCorrectY" format="dimension"/>
<!-- -->
<attr name="shadow_position" format="enum">
<enum name="normal" value="0" />
<enum name="solid" value="1" />
<enum name="outer" value="2" />
<enum name="inner" value="3" />
</attr>
</declare-styleable>
<!--CardView -->
<declare-styleable name="OCHCardViewCorner">
<attr name="och_card_left_top_radius" format="dimension" />
<attr name="och_card_right_top_radius" format="dimension" />
<attr name="och_card_right_bottom_radius" format="dimension" />
<attr name="och_card_left_bottom_radius" format="dimension" />
</declare-styleable>
<declare-styleable name="OCHRealtimeBlurView">
<attr name="och_realtime_blur_radius" format="dimension" />
<attr name="och_realtime_downsample_factor" format="float" />
<attr name="och_realtime_overlay_color" format="color" />
<attr name="och_realtime_onece" format="boolean" />
</declare-styleable>
<declare-styleable name="OCHShapeBlurView">
<attr name="och_realtime_start_color" format="color" />
<attr name="och_realtime_end_color" format="color" />
<attr name="och_realtime_radius" format="dimension" />
</declare-styleable>
<declare-styleable name="MarqueeTextView">
<attr name="customGap" format="float" />
<attr name="useCustomGap" format="boolean"/>
</declare-styleable>
<declare-styleable name="MapDirectionView">
<!-- 地图样式asset目录下的路径 -->
<attr name="mapStylePath" format="string" />
<attr name="mapStyleExtraPath" format="string" />
<!-- 自车模型图片 -->
<attr name="carDrawable" format="reference" />
<!-- 罗盘图片 -->
<attr name="compassDrawable" format="reference" />
<!-- 起点图片 -->
<attr name="startPointDrawable" format="reference" />
<!-- 终点图片 -->
<attr name="endPointDrawable" format="reference" />
<!-- 已走过路线的图片 -->
<attr name="arrivedDrawable" format="reference" />
<!-- 未走过路线的图片 -->
<attr name="unArrivedDrawable" format="reference" />
<!-- 重置位置图片右面margin -->
<attr name="resetDrawableMarginRight" format="dimension" />
<!-- 重置位置图片下面margin -->
<attr name="resetDrawableMarginBottom" format="dimension" />
<!-- 规定屏幕范围的padding -->
<attr name="leftPadding" format="integer" />
<attr name="topPadding" format="integer" />
<attr name="rightPadding" format="integer" />
<attr name="bottomPadding" format="integer" />
</declare-styleable>
<declare-styleable name="SlidePanelView">
<attr name="textSize" format="dimension" />
<attr name="NORMAL_TEXT_MARGIN_LEFT" format="dimension" />
<attr name="NORMAL_TEXT_MARGIN_RIGHT" format="dimension" />
<attr name="SHORT_TEXT_MARGIN_LEFT" format="dimension" />
<attr name="SHORT_TEXT_MARGIN_RIGHT" format="dimension" />
<attr name="BLOCK_START_X" format="dimension" />
<attr name="BLOCK_START_Y" format="dimension" />
</declare-styleable>
</resources>

View File

@@ -33,5 +33,6 @@
<color name="routing_verify_choose_line_bg">#F7151D41</color>
<color name="routing_verify_choose_line">#2966EC</color>
<color name="taxi_color_ccb9c3e9">#CCB9C3E9</color>
<color name="taxi_color_2eacff">#2EACFF</color>
<color name="taxi_color_4dffffff">#4Dffffff</color>
</resources>

View File

@@ -51,6 +51,8 @@
<string name="task_start_end_site">前往送驾</string>
<string name="task_start_start_site">前往接驾</string>
<string name="task_current_loc">当前位置</string>
<string name="task_current_itinerary">当前行程</string>
<string name="task_next_itinerary">待服务</string>
<string name="task_order">运营单</string>
<string name="task_exercise">演练单</string>
<string name="arrived_start_site">等待乘客</string>