[3.3.2]
[地图样式、到达目的地展示页面]
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
OCH/mogo-och-taxi-passenger/src/main/assets/style.data
Executable file
BIN
OCH/mogo-och-taxi-passenger/src/main/assets/style.data
Executable file
Binary file not shown.
BIN
OCH/mogo-och-taxi-passenger/src/main/assets/style_extra.data
Executable file
BIN
OCH/mogo-och-taxi-passenger/src/main/assets/style_extra.data
Executable file
Binary file not shown.
@@ -320,7 +320,6 @@ object TaxiPassengerModel {
|
||||
}
|
||||
TaxiPassengerOrderStatusEnum.UserArriveAtStart -> {
|
||||
//开启轮询司机是否已准备好开启自动驾驶的环境
|
||||
startDriverReadyToAutopilotLoop()
|
||||
setStation()
|
||||
}
|
||||
TaxiPassengerOrderStatusEnum.OnTheWayToEnd -> {
|
||||
@@ -383,12 +382,6 @@ object TaxiPassengerModel {
|
||||
}
|
||||
}
|
||||
|
||||
fun startDriverReadyToAutopilotLoop() {
|
||||
if (NetworkUtils.isConnected(mContext)) {
|
||||
startOrStopReadyToAutopilotLoop(true)
|
||||
}
|
||||
}
|
||||
|
||||
fun startOrStopReadyToAutopilotLoop(isStart: Boolean) {
|
||||
if (isStart) {
|
||||
BizLoopManager.setLoopFunction(STARTREADYTOAUTOPILOT, LoopInfo(1, TaxiPassengerModel::loopQueryPilotStatus))
|
||||
|
||||
@@ -88,7 +88,7 @@ class BaseTaxiPassengerPresenter(view: TaxiPassengerBaseFragment?) :
|
||||
|
||||
TaxiPassengerOrderStatusEnum.ArriveAtEnd -> {
|
||||
// 50 到达终点 乘客可以评价
|
||||
mView?.showOrHideArrivedEndLayout(true, order.endSiteAddr, order.orderNo)
|
||||
mView?.showOrHideArrivedEndLayout(true)
|
||||
mView?.showOrHideOverMapViewFragment(false)
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonValueCallback
|
||||
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter
|
||||
import com.mogo.och.taxi.passenger.ui.bottom.BottomBar
|
||||
import com.mogo.och.taxi.passenger.ui.comment.TaxiPassengerArrivedView
|
||||
import com.mogo.och.taxi.passenger.ui.arrived.ArrivedView
|
||||
import com.mogo.och.taxi.passenger.ui.startautopilot.StartAutopilotView
|
||||
import kotlinx.android.synthetic.main.taxi_p_base_fragment.bottom
|
||||
import kotlinx.android.synthetic.main.taxi_p_base_fragment.ck_setting
|
||||
@@ -42,7 +42,7 @@ class TaxiPassengerBaseFragment() :
|
||||
/**
|
||||
* 到达目的地
|
||||
*/
|
||||
private var mArrivedEndView: WeakReference<TaxiPassengerArrivedView?>? = null
|
||||
private var mArrivedEndView: WeakReference<ArrivedView?>? = null
|
||||
|
||||
/**
|
||||
* 手机号后四位验证
|
||||
@@ -126,7 +126,7 @@ class TaxiPassengerBaseFragment() :
|
||||
controller.changeZoom2(0.8f)
|
||||
}
|
||||
|
||||
showOrHideStartAutopilotView(true)
|
||||
showOrHideArrivedEndLayout(true)
|
||||
|
||||
}
|
||||
BottomBar.SelectView.OVERMAPVIEW -> {
|
||||
@@ -138,9 +138,6 @@ class TaxiPassengerBaseFragment() :
|
||||
|
||||
}
|
||||
}
|
||||
private fun initArrivedView() {
|
||||
mArrivedEndView = WeakReference(TaxiPassengerArrivedView(context))
|
||||
}
|
||||
|
||||
private fun initCheckView() {
|
||||
mArrivedCheckView = WeakReference(
|
||||
@@ -263,27 +260,23 @@ class TaxiPassengerBaseFragment() :
|
||||
* @param arrivedEndStation 目的地
|
||||
* @param orderNo 订单No
|
||||
*/
|
||||
fun showOrHideArrivedEndLayout(isShow: Boolean, arrivedEndStation: String?="", orderNo: String?="") {
|
||||
fun showOrHideArrivedEndLayout(isShow: Boolean) {
|
||||
if (isShow) {
|
||||
if (mArrivedEndView == null || mArrivedEndView!!.get() == null) {
|
||||
initArrivedView()
|
||||
mArrivedEndView = WeakReference(ArrivedView(context))
|
||||
}
|
||||
mArrivedEndView?.get()?.let {
|
||||
OverlayViewUtils.showOverlayView(activity, it, R.style.och_window_anim_alpha)
|
||||
UiThreadHandler.postDelayed({
|
||||
it.setDataAndStartAnimation()
|
||||
}, //如果在全屏 回收需要300毫秒 后期优化使用单独的播放器
|
||||
500
|
||||
)
|
||||
}
|
||||
OverlayViewUtils.showOverlayView(
|
||||
activity,
|
||||
mArrivedEndView!!.get(),
|
||||
R.style.och_window_anim_alpha
|
||||
)
|
||||
UiThreadHandler.postDelayed({
|
||||
mArrivedEndView!!.get()!!
|
||||
.setDataAndStartAnimation(arrivedEndStation, orderNo!!)
|
||||
}, //如果在全屏 回收需要300毫秒 后期优化使用单独的播放器
|
||||
500
|
||||
)
|
||||
} else {
|
||||
if (mArrivedEndView == null || mArrivedEndView!!.get() == null) {
|
||||
return
|
||||
mArrivedEndView?.get()?.let {
|
||||
OverlayViewUtils.dismissOverlayView(it)
|
||||
}
|
||||
OverlayViewUtils.dismissOverlayView(mArrivedEndView!!.get())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,271 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.widget.RelativeLayout
|
||||
import com.amap.api.maps.AMap
|
||||
import com.amap.api.maps.CameraUpdate
|
||||
import com.amap.api.maps.CameraUpdateFactory
|
||||
import com.amap.api.maps.TextureMapView
|
||||
import com.amap.api.maps.model.BitmapDescriptor
|
||||
import com.amap.api.maps.model.BitmapDescriptorFactory
|
||||
import com.amap.api.maps.model.CameraPosition
|
||||
import com.amap.api.maps.model.CustomMapStyleOptions
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.amap.api.maps.model.LatLngBounds
|
||||
import com.amap.api.maps.model.Marker
|
||||
import com.amap.api.maps.model.MarkerOptions
|
||||
import com.amap.api.maps.model.Polyline
|
||||
import com.amap.api.maps.model.PolylineOptions
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager.addListener
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerMapViewCallback
|
||||
import com.mogo.och.taxi.passenger.utils.TaxiPassengerMapAssetStyleUtil
|
||||
|
||||
/**
|
||||
* 乘客屏小地图
|
||||
*/
|
||||
class TaxiPassengerMapDirectionView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RelativeLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener,
|
||||
ITaxiPassengerMapDirectionView, AMap.OnCameraChangeListener {
|
||||
|
||||
companion object {
|
||||
//小地图名称
|
||||
const val TAG = "TaxiPassengerMapDirectionView"
|
||||
private const val zoomLevel = 13.0f
|
||||
}
|
||||
|
||||
private lateinit var mAMapNaviView: TextureMapView
|
||||
private lateinit var mAMap: AMap
|
||||
private lateinit var mCarMarker: Marker
|
||||
private lateinit var mStartMarker: Marker
|
||||
private lateinit var mEndMarker: Marker
|
||||
private lateinit var mArrivedRes: BitmapDescriptor
|
||||
private lateinit var mUnArrivedRes: BitmapDescriptor
|
||||
|
||||
private val mCoordinatesLatLng: MutableList<LatLng> = ArrayList()
|
||||
private var mPolyline: Polyline? = null
|
||||
private var mCameraUpdate: CameraUpdate? = null
|
||||
private var mContext: Context? = null
|
||||
var textureList: MutableList<BitmapDescriptor?> = ArrayList()
|
||||
var texIndexList: MutableList<Int> = ArrayList()
|
||||
private var mITaxiPassengerMapViewCallback: ITaxiPassengerMapViewCallback? = null
|
||||
|
||||
private val routeArrivied: MutableList<LatLng> = ArrayList()
|
||||
private val routeArriving: MutableList<LatLng> = ArrayList()
|
||||
private var location: MogoLocation? = null
|
||||
|
||||
init {
|
||||
initView(context)
|
||||
}
|
||||
|
||||
fun setTaxiPassengerMapViewCallback(ITaxiPassengerMapViewCallback: ITaxiPassengerMapViewCallback?) {
|
||||
mITaxiPassengerMapViewCallback = ITaxiPassengerMapViewCallback
|
||||
}
|
||||
|
||||
private fun initView(context: Context) {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
mContext = context
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_map_view, this)
|
||||
mAMapNaviView = findViewById(R.id.taxi_p_order_amap_view)
|
||||
initAMapView()
|
||||
|
||||
// 注册定位监听
|
||||
addListener(TAG, 10, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
private fun initAMapView() {
|
||||
mCameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel)
|
||||
mAMap = mAMapNaviView.map
|
||||
// 设置导航地图模式,aMap是地图控制器对象。
|
||||
mAMap.mapType = AMap.MAP_TYPE_NIGHT
|
||||
|
||||
// 关闭显示实时路况图层,aMap是地图控制器对象。
|
||||
mAMap.isTrafficEnabled = false
|
||||
|
||||
// 设置 锚点 图标
|
||||
mCarMarker = mAMap.addMarker(MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_car)).anchor(0.5f, 0.5f))
|
||||
mStartMarker = mAMap.addMarker(MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_view_dir_start)))
|
||||
mEndMarker = mAMap.addMarker(MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_view_dir_end)))
|
||||
mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_arrived)
|
||||
mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_un_arrive)
|
||||
|
||||
// 加载自定义样式
|
||||
val customMapStyleOptions = CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(TaxiPassengerMapAssetStyleUtil.getAssetsStyle(context, "map_style.data"))
|
||||
.setStyleExtraData(TaxiPassengerMapAssetStyleUtil.getAssetsExtraStyle(context, "map_style_extra.data"))
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(customMapStyleOptions)
|
||||
|
||||
//设置希望展示的地图缩放级别
|
||||
mAMap.moveCamera(mCameraUpdate)
|
||||
|
||||
// 设置地图的样式
|
||||
mAMap.uiSettings.apply {
|
||||
isZoomControlsEnabled = false // 地图缩放级别的交换按钮
|
||||
setAllGesturesEnabled(false) // 所有手势
|
||||
isMyLocationButtonEnabled = false // 显示默认的定位按钮
|
||||
setLogoBottomMargin(-150) //设置Logo下边界距离屏幕底部的边距,设置为负值即可
|
||||
}
|
||||
|
||||
mAMap.setOnMapLoadedListener {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "smp---onMapLoaded")
|
||||
// 加载自定义样式
|
||||
val options = CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(
|
||||
TaxiPassengerMapAssetStyleUtil.getAssetsStyle(context, "map_style.data")
|
||||
)
|
||||
.setStyleExtraData(
|
||||
TaxiPassengerMapAssetStyleUtil.getAssetsExtraStyle(context, "map_style_extra.data")
|
||||
)
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(options)
|
||||
mAMapNaviView.map.setPointToCenter(mAMapNaviView.width / 2, mAMapNaviView.height / 2)
|
||||
}
|
||||
|
||||
//设置地图状态的监听接口
|
||||
mAMap.setOnCameraChangeListener(this)
|
||||
}
|
||||
|
||||
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
if (mogoLocation == null) {
|
||||
return
|
||||
}
|
||||
val currentLatLng = LatLng(mogoLocation.latitude, mogoLocation.longitude)
|
||||
if (mPolyline!=null&&!mPolyline!!.points.isNullOrEmpty()) {
|
||||
//圈定地图显示范围
|
||||
val endLatLng = mPolyline!!.points.last()
|
||||
//存放经纬度
|
||||
val boundsBuilder = LatLngBounds.Builder().apply {
|
||||
include(currentLatLng)
|
||||
include(endLatLng)
|
||||
}
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 100, 100, 100, 100))
|
||||
} else {
|
||||
//设置希望展示的地图缩放级别
|
||||
val cameraPosition = CameraPosition.Builder()
|
||||
.target(mCarMarker.position)
|
||||
.tilt(0f)
|
||||
.bearing(mogoLocation.heading.toFloat())
|
||||
.zoom(zoomLevel).build()
|
||||
mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
}
|
||||
//更新车辆位置
|
||||
mCarMarker.rotateAngle = (360 - mogoLocation.heading).toFloat()
|
||||
mCarMarker.position = currentLatLng
|
||||
mCarMarker.setToTop()
|
||||
}
|
||||
|
||||
override fun setLineMarker(startStation:LatLng,endStation:LatLng) {
|
||||
mStartMarker.isVisible = false
|
||||
mEndMarker.isVisible = false
|
||||
mStartMarker.position = startStation
|
||||
mStartMarker.isVisible = true
|
||||
mEndMarker.position = endStation
|
||||
mEndMarker.isVisible = true
|
||||
}
|
||||
|
||||
override fun drawablePolyline() {
|
||||
if (routeArrivied.isEmpty() && routeArriving.isEmpty()) {
|
||||
d(SceneConstant.M_TAXI + TAG, "没有点")
|
||||
return
|
||||
}
|
||||
texIndexList.clear()
|
||||
val allPoints = ArrayList(routeArrivied)
|
||||
for (i in routeArrivied.indices) {
|
||||
if (routeArrivied.size > 1 && i < routeArrivied.size - 1) {
|
||||
texIndexList.add(0)
|
||||
}
|
||||
}
|
||||
texIndexList.add(0)
|
||||
allPoints.add(LatLng(location!!.latitude, location!!.longitude))
|
||||
allPoints.addAll(routeArriving)
|
||||
for (ignored in routeArrivied) {
|
||||
texIndexList.add(1)
|
||||
}
|
||||
if (mPolyline != null) {
|
||||
mPolyline!!.points = allPoints
|
||||
mPolyline!!.options.customTextureIndex = texIndexList
|
||||
return
|
||||
}
|
||||
if(textureList.isEmpty()) {
|
||||
textureList.add(mArrivedRes)
|
||||
textureList.add(mUnArrivedRes)
|
||||
}
|
||||
//设置线段纹理
|
||||
val polylineOptions = PolylineOptions().apply {
|
||||
addAll(allPoints)
|
||||
isUseTexture = true
|
||||
width(15f)
|
||||
lineCapType(PolylineOptions.LineCapType.LineCapRound)
|
||||
customTextureList = textureList
|
||||
customTextureIndex = texIndexList
|
||||
}
|
||||
|
||||
// 绘制线
|
||||
mPolyline = mAMap.addPolyline(polylineOptions)
|
||||
}
|
||||
|
||||
override fun clearPolyline() {
|
||||
if (mPolyline != null) {
|
||||
mPolyline!!.remove()
|
||||
mPolyline = null
|
||||
}
|
||||
mStartMarker.isVisible = false
|
||||
mEndMarker.isVisible = false
|
||||
}
|
||||
|
||||
fun onCreateView(savedInstanceState: Bundle?) {
|
||||
mAMapNaviView.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
fun onResume() {
|
||||
mAMapNaviView.onResume()
|
||||
}
|
||||
|
||||
fun onPause() {
|
||||
mAMapNaviView.onPause()
|
||||
}
|
||||
|
||||
fun onDestroy() {
|
||||
mAMapNaviView.onDestroy()
|
||||
}
|
||||
|
||||
fun setCoordinatesLatLng(routeArrivied: List<LatLng>?, routeArriving: List<LatLng>?, location: MogoLocation?) {
|
||||
this.routeArrivied.clear()
|
||||
this.routeArrivied.addAll(routeArrivied!!)
|
||||
this.routeArriving.clear()
|
||||
this.routeArriving.addAll(routeArriving!!)
|
||||
this.location = location
|
||||
}
|
||||
|
||||
override fun onCameraChange(cameraPosition: CameraPosition) {
|
||||
mITaxiPassengerMapViewCallback!!.onCameraChange(cameraPosition.bearing)
|
||||
}
|
||||
|
||||
override fun onCameraChangeFinish(cameraPosition: CameraPosition) {}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.mogo.och.taxi.passenger.ui.arrived
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RelativeLayout
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonCallback
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.aciv_close
|
||||
import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.svp_frame
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 评价View
|
||||
* Created on 2022/5/16
|
||||
*/
|
||||
class ArrivedView :RelativeLayout {
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
private var subscribe: Disposable?=null
|
||||
|
||||
private val gsyVideoOptionBuilder = GSYVideoOptionBuilder()
|
||||
|
||||
|
||||
var taxiPassengerCommonCallback: ITaxiPassengerCommonCallback?=null
|
||||
|
||||
private fun initView() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_arrived_end_panel, this, true)
|
||||
svp_frame.setBackgroundResource(R.drawable.tail_ani_0000)
|
||||
svp_frame.setIsTouchWiget(false)
|
||||
svp_frame.setIsTouchWigetFull(false)
|
||||
svp_frame.enableshowProgressDialog = false
|
||||
svp_frame.enableDoubleClick = false
|
||||
|
||||
val url = "android.resource://" + context.packageName + "/" + R.raw.end_video
|
||||
gsyVideoOptionBuilder.setUrl(url)
|
||||
.setCacheWithPlay(false)
|
||||
.setPlayTag("TaxiPassengerArrivedView")
|
||||
.build(svp_frame)
|
||||
|
||||
aciv_close.onClick {
|
||||
OverlayViewUtils.dismissOverlayView(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
svp_frame.setBackgroundResource(R.drawable.tail_ani_0000)
|
||||
svp_frame.setVideoAllCallBack(null)
|
||||
svp_frame.onVideoReset()
|
||||
svp_frame.release()
|
||||
|
||||
super.onDetachedFromWindow()
|
||||
subscribe?.let {
|
||||
if (!it.isDisposed) {
|
||||
it.dispose()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置目的地重置星星状态
|
||||
*/
|
||||
fun setDataAndStartAnimation() {
|
||||
svp_frame.setVideoAllCallBack(object : GSYSampleCallBack() {
|
||||
override fun onAutoComplete(url: String?, vararg objects: Any?) {
|
||||
svp_frame.setBackgroundResource(R.drawable.tail_ani_0090)
|
||||
}
|
||||
})
|
||||
svp_frame.startPlayLogic()
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论成功 向左移动并消失 消失后感谢页面透明度0-1 然后开始小手的动画
|
||||
*/
|
||||
fun scoreSuccess(){
|
||||
// 10s 后逻辑
|
||||
subscribe = Observable.timer(10000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
// 正在展示感谢页面
|
||||
if (taxiPassengerCommonCallback == null) {
|
||||
// 没有用户确定页面
|
||||
OverlayViewUtils.dismissOverlayView(this@ArrivedView)
|
||||
} else {
|
||||
// 有排队展示的用户确定页面
|
||||
taxiPassengerCommonCallback?.onCommonCallback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "TaxiPassengerArrivedView"
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,475 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.ui.comment
|
||||
|
||||
import android.animation.*
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.AnimationDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.ImageView
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.widget.AppCompatButton
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.amap.api.navi.view.PoiInputSearchWidget
|
||||
import com.google.android.flexbox.FlexWrap
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.flexbox.JustifyContent
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerAllStarWorld
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerScoreUpdateOrderReqBean
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonCallback
|
||||
import com.mogo.och.taxi.passenger.network.TaxiPassengerServiceManager
|
||||
import com.mogo.och.taxi.passenger.ui.comment.adapter.CommentAdapter
|
||||
import com.mogo.och.taxi.passenger.widget.ResizeAnimation
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 评价View
|
||||
* Created on 2022/5/16
|
||||
*/
|
||||
class TaxiPassengerArrivedView :RelativeLayout, View.OnClickListener {
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
private lateinit var mArrivedEndStation: TextView
|
||||
private lateinit var tvFeel: TextView
|
||||
private lateinit var ochShadowLayout: OCHBorderShadowLayout
|
||||
private lateinit var ochThankShadowLayout: OCHBorderShadowLayout
|
||||
private lateinit var ivStarFirst: ImageView
|
||||
private lateinit var ivStarSecond: ImageView
|
||||
private lateinit var ivStarThird: ImageView
|
||||
private lateinit var ivStarFourth: ImageView
|
||||
private lateinit var ivStarFifth: ImageView
|
||||
private lateinit var ivAnimalList: ImageView
|
||||
private lateinit var btnSubmit: AppCompatButton
|
||||
private lateinit var rvCommentList: RecyclerView
|
||||
private lateinit var acivClose: AppCompatImageView
|
||||
private lateinit var svpFrame: SimpleVideoPlayer
|
||||
private lateinit var clCommentContain: ConstraintLayout
|
||||
private var subscribe: Disposable?=null
|
||||
private var orderNo = ""
|
||||
private var currentFraction = 1
|
||||
|
||||
private val gsyVideoOptionBuilder = GSYVideoOptionBuilder()
|
||||
|
||||
|
||||
var taxiPassengerCommonCallback: ITaxiPassengerCommonCallback?=null
|
||||
var left2Right: Animation = AnimationUtils.loadAnimation(
|
||||
context, R.anim.left_to_right
|
||||
)
|
||||
var right2Left: Animation = AnimationUtils.loadAnimation(
|
||||
context, R.anim.right_to_left
|
||||
)
|
||||
var alphaAnimation: Animation = AnimationUtils.loadAnimation(
|
||||
context, R.anim.alpha_hide_show
|
||||
)
|
||||
|
||||
private var allStartOrdered = mutableListOf<ImageView>()
|
||||
|
||||
var showThanks:Boolean = false
|
||||
var allStarWithWorld: TaxiPassengerAllStarWorld?=null
|
||||
|
||||
private fun initView(context: Context) {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_arrived_end_panel, this, true)
|
||||
mArrivedEndStation = findViewById(R.id.arrived_end_station)
|
||||
tvFeel = findViewById(R.id.tv_feel)
|
||||
ochShadowLayout = findViewById(R.id.och_shadow_layout)
|
||||
ochThankShadowLayout = findViewById(R.id.och_thank_shadow_layout)
|
||||
ivAnimalList = findViewById(R.id.iv_animal_list)
|
||||
acivClose = findViewById(R.id.aciv_close)
|
||||
svpFrame = findViewById(R.id.svp_frame)
|
||||
rvCommentList = findViewById(R.id.rv_comment_list)
|
||||
clCommentContain = findViewById(R.id.cl_comment_contain)
|
||||
btnSubmit = findViewById(R.id.btn_submit)
|
||||
svpFrame.setBackgroundResource(R.drawable.tail_ani_0000)
|
||||
svpFrame.setIsTouchWiget(false)
|
||||
svpFrame.setIsTouchWigetFull(false)
|
||||
svpFrame.enableshowProgressDialog = false
|
||||
svpFrame.enableDoubleClick = false
|
||||
|
||||
allStartOrdered = mutableListOf()
|
||||
initCommentList()
|
||||
initScore()
|
||||
|
||||
findViewById<View>(R.id.tv_please_score).setOnClickListener(this)
|
||||
|
||||
|
||||
acivClose.setOnClickListener {
|
||||
ochShadowLayout.visibility = View.GONE
|
||||
OverlayViewUtils.dismissOverlayView(this@TaxiPassengerArrivedView)
|
||||
}
|
||||
|
||||
val url = "android.resource://" + context.packageName + "/" + R.raw.end_video
|
||||
gsyVideoOptionBuilder.setUrl(url)
|
||||
.setCacheWithPlay(false)
|
||||
.setPlayTag("TaxiPassengerArrivedView")
|
||||
.build(svpFrame)
|
||||
}
|
||||
|
||||
private fun initCommentList() {
|
||||
val recyclerVideoAdapter = CommentAdapter(context, mutableListOf())
|
||||
rvCommentList.adapter = recyclerVideoAdapter
|
||||
val manager = FlexboxLayoutManager(context)
|
||||
manager.justifyContent = JustifyContent.CENTER
|
||||
manager.flexWrap = FlexWrap.WRAP
|
||||
rvCommentList.layoutManager = manager
|
||||
btnSubmit.setOnClickListener(this)
|
||||
}
|
||||
|
||||
private fun initScore() {
|
||||
ivStarFirst = findViewById(R.id.iv_star_first)
|
||||
ivStarSecond = findViewById(R.id.iv_star_second)
|
||||
ivStarThird = findViewById(R.id.iv_star_third)
|
||||
ivStarFourth = findViewById(R.id.iv_star_fourth)
|
||||
ivStarFifth = findViewById(R.id.iv_star_fifth)
|
||||
ivStarFirst.setOnClickListener(this)
|
||||
ivStarSecond.setOnClickListener(this)
|
||||
ivStarThird.setOnClickListener(this)
|
||||
ivStarFourth.setOnClickListener(this)
|
||||
ivStarFifth.setOnClickListener(this)
|
||||
|
||||
allStartOrdered.add(ivStarFirst)
|
||||
allStartOrdered.add(ivStarSecond)
|
||||
allStartOrdered.add(ivStarThird)
|
||||
allStartOrdered.add(ivStarFourth)
|
||||
allStartOrdered.add(ivStarFifth)
|
||||
|
||||
// 请求文案
|
||||
requestStarWord()
|
||||
}
|
||||
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
svpFrame.setBackgroundResource(R.drawable.tail_ani_0000)
|
||||
svpFrame.setVideoAllCallBack(null)
|
||||
svpFrame.onVideoReset()
|
||||
svpFrame.release()
|
||||
tvFeel.text = ""
|
||||
rvCommentList.visibility = View.INVISIBLE
|
||||
btnSubmit.visibility = View.INVISIBLE
|
||||
clCommentContain.getLayoutParams().height = 748
|
||||
clCommentContain.requestLayout()
|
||||
super.onDetachedFromWindow()
|
||||
subscribe?.let {
|
||||
if (!it.isDisposed) {
|
||||
it.dispose()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.tv_please_score -> {
|
||||
//iTaxiPassengerScoreCallback?.onScoreCallback(2,orderNo)
|
||||
}
|
||||
R.id.iv_star_first -> {commitAndStartAnimation(1,"非常差")}
|
||||
R.id.iv_star_second -> {commitAndStartAnimation(2,"差")}
|
||||
R.id.iv_star_third -> {commitAndStartAnimation(3,"一般")}
|
||||
R.id.iv_star_fourth -> {commitAndStartAnimation(4,"舒适")}
|
||||
R.id.iv_star_fifth -> {commitAndStartAnimation(5,"非常棒")}
|
||||
R.id.btn_submit -> {submitScore()}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交到后台
|
||||
*/
|
||||
private fun submitScore() {
|
||||
val commentAdapter = rvCommentList.adapter as CommentAdapter
|
||||
val selectComment = commentAdapter.getSelectComment()
|
||||
if(selectComment.isEmpty()){
|
||||
ToastUtils.showLong("请选择评价内容")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
private fun commitAndStartAnimation(fraction: Int,title:String) {
|
||||
resetStar()
|
||||
allStartOrdered.forEach {
|
||||
it.isEnabled = false
|
||||
}
|
||||
currentFraction = fraction
|
||||
tvFeel.text = title
|
||||
if(allStarWithWorld!=null&&allStarWithWorld!!.data!=null&&allStarWithWorld!!.data!!.size>0){
|
||||
// 已经请求到总量了
|
||||
val filter = allStarWithWorld!!.data.filter {
|
||||
it.isSelect = false
|
||||
it.star == fraction.toString()
|
||||
}
|
||||
val commentAdapter = rvCommentList.adapter as CommentAdapter
|
||||
commentAdapter.addAll(filter.toMutableList())
|
||||
startStartAnimation(fraction)
|
||||
}else{
|
||||
// 总量请求失败 单独去取
|
||||
requestStarWordByStar(fraction)
|
||||
}
|
||||
}
|
||||
private var currentAnimarion = 0
|
||||
private var maxIndex = 0
|
||||
private fun startStartAnimation(fraction: Int) {
|
||||
currentAnimarion = 0
|
||||
maxIndex = fraction-1
|
||||
try {
|
||||
animation(fraction)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 星星动画
|
||||
*/
|
||||
private fun animation(fraction: Int) {
|
||||
|
||||
val showView = allStartOrdered[currentAnimarion]
|
||||
showView.setImageResource(R.drawable.taxi_p_passenger_star_check)
|
||||
val alpha = ObjectAnimator.ofFloat(showView, "alpha", 0.1f, 1f)
|
||||
.setDuration(120)
|
||||
alpha.addUpdateListener(object : ValueAnimator.AnimatorUpdateListener{
|
||||
var isStart = false
|
||||
override fun onAnimationUpdate(animation: ValueAnimator) {
|
||||
val animatedValue = animation?.getAnimatedValue("alpha")
|
||||
animatedValue as Float
|
||||
if(animatedValue>0.45&&!isStart){
|
||||
isStart = true
|
||||
//开始下一个
|
||||
if(currentAnimarion==maxIndex){
|
||||
return
|
||||
}
|
||||
currentAnimarion++
|
||||
animation(fraction)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
val keyframe1 = Keyframe.ofFloat(0f,1f)
|
||||
val keyframe3 = Keyframe.ofFloat(0.9f,1.2f)
|
||||
val keyframe4 = Keyframe.ofFloat(1f,1f)
|
||||
val holderX = PropertyValuesHolder.ofKeyframe(
|
||||
"scaleX", keyframe1, keyframe3, keyframe4
|
||||
)
|
||||
val holderY = PropertyValuesHolder.ofKeyframe(
|
||||
"scaleY", keyframe1, keyframe3, keyframe4
|
||||
)
|
||||
val scaleX = ObjectAnimator.ofPropertyValuesHolder(showView, holderX).setDuration(240)
|
||||
val scaleY = ObjectAnimator.ofPropertyValuesHolder(showView, holderY).setDuration(240)
|
||||
|
||||
|
||||
val set = AnimatorSet()
|
||||
set.play(scaleX).with(scaleY).with(alpha)
|
||||
if(currentAnimarion==maxIndex) {
|
||||
// 最后一个动画结束后提交积分
|
||||
set.addListener(object : AnimatorListenerAdapter() {
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
super.onAnimationEnd(animation)
|
||||
// 启动变高动画
|
||||
startChangeHeightAnimarion()
|
||||
}
|
||||
})
|
||||
}
|
||||
set.start()
|
||||
}
|
||||
|
||||
private fun startChangeHeightAnimarion() {
|
||||
// 815 除了 点评的高度
|
||||
val resizeAnimation = ResizeAnimation(clCommentContain,913+rvCommentList.height, clCommentContain.height)
|
||||
resizeAnimation.duration = 300
|
||||
resizeAnimation.setAnimationListener(object :Animation.AnimationListener{
|
||||
override fun onAnimationStart(animation: Animation?) {
|
||||
rvCommentList.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation?) {
|
||||
allStartOrdered.forEach {
|
||||
it.isEnabled = true
|
||||
}
|
||||
if(btnSubmit.visibility==View.GONE||btnSubmit.visibility==View.INVISIBLE) {
|
||||
btnSubmit.visibility = View.VISIBLE
|
||||
val showAnimator = ObjectAnimator.ofFloat(btnSubmit, "alpha", 0.1f, 1f)
|
||||
showAnimator.duration = 600
|
||||
showAnimator.start()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation?) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
clCommentContain.startAnimation(resizeAnimation)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置目的地重置星星状态
|
||||
*/
|
||||
fun setDataAndStartAnimation(endSiteAddr: String?,orderId:String) {
|
||||
mArrivedEndStation.text = endSiteAddr
|
||||
ochThankShadowLayout.visibility = View.GONE
|
||||
ivAnimalList.visibility = View.GONE
|
||||
svpFrame.setVideoAllCallBack(object : GSYSampleCallBack() {
|
||||
override fun onAutoComplete(url: String?, vararg objects: Any?) {
|
||||
svpFrame.setBackgroundResource(R.drawable.tail_ani_0090)
|
||||
}
|
||||
})
|
||||
svpFrame.startPlayLogic()
|
||||
postDelayed({
|
||||
ochShadowLayout.visibility = View.VISIBLE
|
||||
ochShadowLayout.startAnimation(left2Right)
|
||||
},1928)
|
||||
|
||||
showThanks = false
|
||||
this.orderNo = orderId
|
||||
resetStar()
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论成功 向左移动并消失 消失后感谢页面透明度0-1 然后开始小手的动画
|
||||
*/
|
||||
fun scoreSuccess(){
|
||||
right2Left.setAnimationListener(object :PoiInputSearchWidget.AnimationListenerAdapter(){
|
||||
override fun onAnimationEnd(p0: Animation?) {
|
||||
ochShadowLayout.visibility = View.GONE
|
||||
ochThankShadowLayout.startAnimation(alphaAnimation)
|
||||
ivAnimalList.startAnimation(alphaAnimation)
|
||||
alphaAnimation.setAnimationListener(object : PoiInputSearchWidget.AnimationListenerAdapter(){
|
||||
override fun onAnimationStart(p0: Animation?) {
|
||||
ochThankShadowLayout.visibility = View.VISIBLE
|
||||
ivAnimalList.visibility = View.VISIBLE
|
||||
showThanks = true
|
||||
}
|
||||
override fun onAnimationEnd(p0: Animation?) {
|
||||
val animationDrawable = ivAnimalList.drawable as AnimationDrawable
|
||||
animationDrawable.start()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
ochShadowLayout.startAnimation(right2Left)
|
||||
|
||||
// 10s 后逻辑
|
||||
subscribe = Observable.timer(10000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
// 正在展示感谢页面
|
||||
if (taxiPassengerCommonCallback == null) {
|
||||
// 没有用户确定页面
|
||||
OverlayViewUtils.dismissOverlayView(this@TaxiPassengerArrivedView)
|
||||
} else {
|
||||
// 有排队展示的用户确定页面
|
||||
taxiPassengerCommonCallback?.onCommonCallback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论失败 重置状态
|
||||
*/
|
||||
fun scoreFail(){
|
||||
scoreSuccess()
|
||||
// tvFeel.text = ""
|
||||
// resetStar()
|
||||
}
|
||||
|
||||
private fun resetStar() {
|
||||
allStartOrdered.forEach {
|
||||
it.setImageResource(R.drawable.taxi_p_passenger_star)
|
||||
it.isEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
private fun requestStarWord() {
|
||||
TaxiPassengerServiceManager.getAllScoreWorld(
|
||||
object : OchCommonServiceCallback<TaxiPassengerAllStarWorld> {
|
||||
override fun onError() {
|
||||
CallerLogger.e(
|
||||
SceneConstant.M_TAXI_P + TAG,
|
||||
"/autopilot-car-hailing/evaluation/label/driver/taxi/list 接口 onError"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
CallerLogger.e(
|
||||
SceneConstant.M_TAXI_P + TAG,
|
||||
"/autopilot-car-hailing/evaluation/label/driver/taxi/list 接口:${code}---${msg}"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(data: TaxiPassengerAllStarWorld?) {
|
||||
allStarWithWorld = data
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
private fun requestStarWordByStar(start:Int) {
|
||||
TaxiPassengerServiceManager.getWorldByStar(start.toString(),
|
||||
object : OchCommonServiceCallback<TaxiPassengerAllStarWorld> {
|
||||
override fun onError() {
|
||||
CallerLogger.e(
|
||||
SceneConstant.M_TAXI_P + TAG,
|
||||
"/autopilot-car-hailing/evaluation/label/driver/taxi/listByStar 接口 onError"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
CallerLogger.e(
|
||||
SceneConstant.M_TAXI_P + TAG,
|
||||
"/autopilot-car-hailing/evaluation/label/driver/taxi/listByStar 接口:${code}---${msg}"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(data: TaxiPassengerAllStarWorld?) {
|
||||
if(data?.data != null &&data.data!!.size>0){
|
||||
val commentAdapter = rvCommentList.adapter as CommentAdapter
|
||||
commentAdapter.addAll(data.data.toMutableList())
|
||||
startStartAnimation(start)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
const val TAG = "TaxiPassengerArrivedView"
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView(context)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.ui.comment.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerAllStarWorld.TaxiPassengerStarWorld
|
||||
|
||||
class CommentAdapter(private val context: Context?,private val itemDataList: MutableList<TaxiPassengerStarWorld>) :
|
||||
RecyclerView.Adapter<ItemCommentHolder>() {
|
||||
|
||||
fun add(taxiPassengerStarWorld: TaxiPassengerStarWorld) {
|
||||
itemDataList.add(taxiPassengerStarWorld)
|
||||
notifyItemInserted(itemDataList.size)
|
||||
}
|
||||
|
||||
fun addAll(itemDataList: MutableList<TaxiPassengerStarWorld>){
|
||||
this.itemDataList.clear()
|
||||
this.itemDataList.addAll(itemDataList)
|
||||
// region 临时代码
|
||||
var needMove:TaxiPassengerStarWorld?=null
|
||||
itemDataList.forEachIndexed { index, taxiPassengerStarWorld ->
|
||||
if(taxiPassengerStarWorld.labelInfo=="频繁急停急刹"){
|
||||
needMove = taxiPassengerStarWorld
|
||||
return@forEachIndexed
|
||||
}
|
||||
}
|
||||
needMove?.let {
|
||||
this.itemDataList.remove(it)
|
||||
this.itemDataList.add(this.itemDataList.size-1,it)
|
||||
}
|
||||
// endregion
|
||||
this.notifyDataSetChanged()
|
||||
}
|
||||
fun getSelectComment(): List<TaxiPassengerStarWorld> {
|
||||
return itemDataList.filter {
|
||||
if(it.isSelect==null){
|
||||
it.isSelect = false
|
||||
}
|
||||
it.isSelect
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemCommentHolder {
|
||||
val v = LayoutInflater.from(context).inflate(R.layout.list_comment_item, parent, false)
|
||||
return ItemCommentHolder(context, v)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ItemCommentHolder, position: Int) {
|
||||
val taxiPassengerStarWorld = itemDataList[position]
|
||||
holder.commentItem.text = taxiPassengerStarWorld.labelInfo
|
||||
if (taxiPassengerStarWorld.isSelect!=null&&taxiPassengerStarWorld.isSelect) {
|
||||
taxiPassengerStarWorld.isSelect = true
|
||||
holder.commentItem.setBackgroundResource(R.drawable.taxi_p_comment_selected)
|
||||
} else {
|
||||
taxiPassengerStarWorld.isSelect = false
|
||||
holder.commentItem.setBackgroundResource(R.drawable.taxi_p_comment_select)
|
||||
}
|
||||
holder.commentItem.setOnClickListener { v: View? ->
|
||||
taxiPassengerStarWorld.isSelect = !taxiPassengerStarWorld.isSelect
|
||||
notifyItemChanged(holder.bindingAdapterPosition)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return itemDataList.size
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "RecyclerBaseAdapter"
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.ui.comment.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.och.taxi.passenger.R;
|
||||
|
||||
public class ItemCommentHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public final static String TAG = "ItemCommentHolder";
|
||||
|
||||
protected Context context;
|
||||
|
||||
public CheckBox commentItem;
|
||||
|
||||
public ItemCommentHolder(Context context, View v) {
|
||||
super(v);
|
||||
this.context = context;
|
||||
commentItem = v.findViewById(R.id.tv_comment);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,300 +24,4 @@
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/och_shadow_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_109"
|
||||
android:layout_marginBottom="@dimen/dp_30"
|
||||
app:bgColor="@color/taxi_p_map_bg"
|
||||
app:blurRadius="@dimen/dp_60"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:shadowColor="#80000000"
|
||||
app:shadowRadius="60dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:shadow_position="outer"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_comment_contain"
|
||||
android:layout_width="@dimen/dp_867"
|
||||
android:layout_height="@dimen/dp_748"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@drawable/bg_taxi_p_arrived_info"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/taxi_p_arrived_end_light"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/bg_taxi_p_arrived_info_yello_v"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@drawable/bg_taxi_p_arrived_info_yello_v"
|
||||
android:layout_marginTop="@dimen/dp_86"
|
||||
android:layout_width="@dimen/dp_12"
|
||||
android:layout_height="@dimen/dp_140"/>
|
||||
<TextView
|
||||
android:id="@+id/arrived_end_station_title"
|
||||
app:layout_constraintTop_toTopOf="@+id/bg_taxi_p_arrived_info_yello_v"
|
||||
app:layout_constraintStart_toEndOf="@+id/bg_taxi_p_arrived_info_yello_v"
|
||||
android:text="已到达"
|
||||
android:layout_marginStart="@dimen/dp_41"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/arrived_end_station"
|
||||
android:layout_width="0dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/arrived_end_station_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/arrived_end_station_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_31"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/taxi_p_route_txt_color"
|
||||
android:textSize="@dimen/dp_56"
|
||||
android:textStyle="bold"
|
||||
tools:text="环球贸易中心-北门"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/arrived_end_wx_pay"
|
||||
android:layout_width="0dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/arrived_end_station"
|
||||
app:layout_constraintStart_toStartOf="@+id/arrived_end_station"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_31"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:textStyle="bold"
|
||||
android:text="行程结束,请在小程序端完成支付!"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/v_line"
|
||||
app:layout_constraintTop_toBottomOf="@+id/arrived_end_wx_pay"
|
||||
android:layout_marginTop="@dimen/dp_49"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_60"
|
||||
android:layout_marginEnd="@dimen/dp_60"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@drawable/bg_taxi_p_arrived_info_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_please_score"
|
||||
app:layout_constraintStart_toStartOf="@+id/arrived_end_station"
|
||||
app:layout_constraintTop_toBottomOf="@+id/v_line"
|
||||
android:layout_marginTop="@dimen/dp_52"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:text="请对本次行程评分"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_star_first"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
android:layout_marginStart="@dimen/dp_34"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:scaleType="fitStart"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_please_score"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_star_second"
|
||||
android:src="@drawable/taxi_p_passenger_star"
|
||||
android:layout_width="@dimen/dp_119"
|
||||
android:layout_height="@dimen/dp_148"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_star_second"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:scaleType="fitStart"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_star_first"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_star_first"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_star_third"
|
||||
android:src="@drawable/taxi_p_passenger_star"
|
||||
android:layout_width="@dimen/dp_119"
|
||||
android:layout_height="@dimen/dp_148"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_star_third"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:scaleType="fitStart"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_star_second"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_star_second"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_star_fourth"
|
||||
android:src="@drawable/taxi_p_passenger_star"
|
||||
android:layout_width="@dimen/dp_119"
|
||||
android:layout_height="@dimen/dp_148"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_star_fourth"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:scaleType="fitStart"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_star_third"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_star_third"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_star_fifth"
|
||||
android:src="@drawable/taxi_p_passenger_star"
|
||||
android:layout_width="@dimen/dp_119"
|
||||
android:layout_height="@dimen/dp_148"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_star_fifth"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:scaleType="fitStart"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_star_fourth"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_star_fourth"
|
||||
android:src="@drawable/taxi_p_passenger_star"
|
||||
android:layout_width="@dimen/dp_119"
|
||||
android:layout_height="@dimen/dp_148"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_star_hide"
|
||||
android:layout_marginEnd="3dp"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_star_fourth"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_star_fourth"
|
||||
android:src="@drawable/taxi_p_passenger_star"
|
||||
android:visibility="invisible"
|
||||
android:layout_width="@dimen/dp_119"
|
||||
android:layout_height="@dimen/dp_96"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_feel"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_star_hide"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_star_hide"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_53"
|
||||
android:textColor="#FFD868"
|
||||
android:textSize="46dp"
|
||||
tools:text="太差了"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_comment_list"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_star_hide"
|
||||
android:layout_marginTop="50dp"
|
||||
android:visibility="invisible"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_submit"
|
||||
android:text="提交"
|
||||
android:gravity="center"
|
||||
android:visibility="invisible"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iv_bottom_light"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/taxi_p_comment_submit"
|
||||
android:textSize="@dimen/dp_42"
|
||||
android:height="120dp"
|
||||
android:layout_width="450dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bottom_light"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="95dp"
|
||||
android:rotation="180"
|
||||
android:src="@drawable/taxi_p_arrived_end_light"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/och_thank_shadow_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_109"
|
||||
android:layout_marginBottom="@dimen/dp_30"
|
||||
app:bgColor="@color/taxi_p_map_bg"
|
||||
app:blurRadius="@dimen/dp_60"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:shadowColor="#80000000"
|
||||
app:shadowRadius="60dp"
|
||||
android:visibility="gone"
|
||||
app:shadow_position="outer"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_867"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@drawable/bg_taxi_p_arrived_info"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/taxi_p_arrived_end_light"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<ImageView
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:src="@drawable/taxi_p_arrived_end_light"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:rotation="180"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_thank_you"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_seeyou_next_time"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_seeyou_next_time"
|
||||
android:text="感谢您的反馈"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginBottom="@dimen/dp_21"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_seeyou_next_time"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_63"
|
||||
android:layout_marginBottom="@dimen/dp_74"
|
||||
android:text="期待与您下次相遇!"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_56"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_animal_list"
|
||||
android:layout_width="@dimen/dp_520"
|
||||
android:layout_height="@dimen/dp_800"
|
||||
android:src="@drawable/bg_taxi_score_success"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="@dimen/dp_89"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/och_thank_shadow_layout"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -10,7 +10,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:startPointDrawable="@drawable/taxi_p_map_view_dir_start"
|
||||
app:endPointDrawable="@drawable/taxi_p_map_view_dir_end" />
|
||||
app:endPointDrawable="@drawable/taxi_p_map_view_dir_end"
|
||||
app:mapStyleExtraPath="style_extra.data"
|
||||
app:mapStylePath="style.data"
|
||||
/>
|
||||
|
||||
<!-- 高精地图 -->
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
|
||||
@@ -137,6 +137,7 @@ class SimpleVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
removeCallbacks(runnable)
|
||||
mProgressBar?.progress = 0
|
||||
mFullPauseBitmap = null
|
||||
}
|
||||
@@ -151,6 +152,9 @@ class SimpleVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
private var runnable = object :Runnable {
|
||||
override fun run() {
|
||||
if(this@SimpleVideoPlayer==null){
|
||||
return
|
||||
}
|
||||
updateTimer++
|
||||
postDelayed(this, 1000)
|
||||
if (updateTimer >= 3) {
|
||||
|
||||
Reference in New Issue
Block a user