diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/music/playing/MusicPlayingView.kt b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/music/playing/MusicPlayingView.kt index b497e339c3..aef03f3d33 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/music/playing/MusicPlayingView.kt +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/music/playing/MusicPlayingView.kt @@ -126,14 +126,14 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi sb_musuc_progess.progress=0.toInt() } - Glide.with(context) - .load(musicData.coverHeadImageUrl) - .apply(RequestOptions().placeholder(R.drawable.charter_p_music_bg_relax_head)) - .into(iv_music_cover) - Glide.with(context) - .load(musicData.coverBottomImageUrl) - .apply(RequestOptions().placeholder(R.drawable.charter_p_music_bg_relax_bottom)) - .into(iv_music_cover_bg) +// Glide.with(context) +// .load(musicData.coverHeadImageUrl) +// .apply(RequestOptions().placeholder(R.drawable.charter_p_music_bg_relax_head)) +// .into(iv_music_cover) +// Glide.with(context) +// .load(musicData.coverBottomImageUrl) +// .apply(RequestOptions().placeholder(R.drawable.charter_p_music_bg_relax_bottom)) +// .into(iv_music_cover_bg) } private fun startAnimal(){ @@ -142,8 +142,8 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi animator = null } animator = ObjectAnimator.ofFloat(iv_music_cover, "rotation", 0f, 360f) - iv_music_cover.pivotX = (iv_music_cover.getWidth() / 2).toFloat() - iv_music_cover.pivotY = iv_music_cover.height*174.5f/390f + iv_music_cover.pivotX = (iv_music_cover.width / 2).toFloat() + iv_music_cover.pivotY = (iv_music_cover.height / 2).toFloat() animator?.duration = 4000 animator?.repeatCount = -1 animator?.repeatMode = ValueAnimator.RESTART diff --git a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_music_bg_relax_head.png b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_music_bg_relax_head.png index f725b43295..cb0afed17d 100755 Binary files a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_music_bg_relax_head.png and b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_music_bg_relax_head.png differ diff --git a/OCH/charter/passenger/src/main/res/drawable/charter_p_music_bg_relax_head.png b/OCH/charter/passenger/src/main/res/drawable/charter_p_music_bg_relax_head.png deleted file mode 100755 index f725b43295..0000000000 Binary files a/OCH/charter/passenger/src/main/res/drawable/charter_p_music_bg_relax_head.png and /dev/null differ diff --git a/OCH/charter/passenger/src/main/res/drawable/taxt_p_music_seekbar_style.xml b/OCH/charter/passenger/src/main/res/drawable/charter_p_music_seekbar_style.xml similarity index 84% rename from OCH/charter/passenger/src/main/res/drawable/taxt_p_music_seekbar_style.xml rename to OCH/charter/passenger/src/main/res/drawable/charter_p_music_seekbar_style.xml index 7f1666f670..9bbb4cb0c0 100644 --- a/OCH/charter/passenger/src/main/res/drawable/taxt_p_music_seekbar_style.xml +++ b/OCH/charter/passenger/src/main/res/drawable/charter_p_music_seekbar_style.xml @@ -4,14 +4,14 @@ - + - + diff --git a/OCH/charter/passenger/src/main/res/layout/charter_p_music_playing.xml b/OCH/charter/passenger/src/main/res/layout/charter_p_music_playing.xml index ca124815ad..89bd56d279 100644 --- a/OCH/charter/passenger/src/main/res/layout/charter_p_music_playing.xml +++ b/OCH/charter/passenger/src/main/res/layout/charter_p_music_playing.xml @@ -13,27 +13,29 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:src="@drawable/charter_p_music_bg_relax_bottom" - android:layout_width="@dimen/dp_358" - android:layout_height="@dimen/dp_440"/> - - + android:layout_width="@dimen/dp_197" + android:layout_height="@dimen/dp_242"/> + android:layout_width="@dimen/dp_140_4" + android:layout_height="@dimen/dp_140_4"/> + + + + #425877 #576887 #488ED0 + #1A488ED0 + #598CFF #4D6A83A5 #6A83A5 diff --git a/OCH/taxi/passenger/src/main/res/layout/taxi_p_itinerary.xml b/OCH/taxi/passenger/src/main/res/layout/taxi_p_itinerary.xml index 0c48cb0976..b0bb507e99 100644 --- a/OCH/taxi/passenger/src/main/res/layout/taxi_p_itinerary.xml +++ b/OCH/taxi/passenger/src/main/res/layout/taxi_p_itinerary.xml @@ -36,7 +36,7 @@ android:layout_marginEnd="@dimen/dp_12" android:layout_marginStart="@dimen/dp_93" android:textColor="@color/taxi_p_004DC4" - android:textSize="@dimen/dp_35" + android:textSize="@dimen/dp_38" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/gl_horizontal_top" app:layout_constraintBottom_toBottomOf="@+id/gl_horizontal_center" @@ -44,19 +44,44 @@ + + + + @@ -111,30 +136,60 @@ app:layout_constraintStart_toStartOf="@+id/actv_surplus_time" app:layout_constraintEnd_toEndOf="@+id/actv_surplus_time" /> - + app:layout_constraintTop_toTopOf="@+id/gl_horizontal_center"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + () + var nextLineData = mutableListOf() + + val bmBlock = BitmapFactory.decodeResource(resources, R.drawable.taxi_navi_arrow_icon).also { + bmBlockWidth = it.width + bmBlockHeight = it.height + } + + val matrixArrow = Matrix() + + var evaluator = ArgbEvaluator() + + private var viewModel: SimpleMapViewModel?=null + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + viewModel = findViewTreeViewModelStoreOwner()?.let { + ViewModelProvider(it).get(SimpleMapViewModel::class.java) + } + viewModel?.setViewCallback(this) + } + + override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { + super.onLayout(changed, left, top, right, bottom) + widthView = width + heighView = height + proportion = widthView / 500f + matrixArrow.setTranslate( + (width / 2 - bmBlockWidth / 2).toFloat(), + (height / 2 - bmBlockHeight / 2).toFloat() + ) + } + + override fun onDraw(canvas: Canvas) { + super.onDraw(canvas) + + var startPointNextUse:NearPointView? = null + var secondPointNextUse:NearPointView? = null + nextLineData.forEachIndexed { index, lineData -> + val startPoint = lineData.startPoint + val endPoint = lineData.endPoint + if(index==0) { + val line4Point = getLine4Point(startPoint, endPoint, true) + Log.d( + "DrawLineView_startPoint", + "${startPoint.x}------${startPoint.y}--${startPoint.distance}--------${endPoint.x}------${endPoint.y}----${endPoint.distance}" + ) + val path = Path() + val D = line4Point[0] + val F = line4Point[1] + val I = line4Point[2] + val G = line4Point[3] + path.moveTo(D.x,D.y) + path.lineTo(F.x,F.y) + path.lineTo(I.x,I.y) + path.lineTo(G.x,G.y) + startPointNextUse = I + secondPointNextUse = G + path.close() + canvas.drawPath(path,lineData.paint) + }else{ + val line4Point = getLine4Point(startPoint, endPoint, false) + val path = Path() + path.moveTo(startPointNextUse!!.x,startPointNextUse!!.y) + path.lineTo(secondPointNextUse!!.x,secondPointNextUse!!.y) + val tempStart = line4Point[0] + val tempEnd = line4Point[1] + path.lineTo(tempStart.x,tempStart.y) + path.lineTo(tempEnd.x,tempEnd.y) + startPointNextUse = tempEnd + secondPointNextUse = tempStart + canvas.drawPath(path,lineData.paint) + + } + + } + + preLineData.forEachIndexed { index, lineData -> + val startPoint = lineData.startPoint + val endPoint = lineData.endPoint + if(index==0) { + val line4Point = getLine4Point(startPoint, endPoint, true) + val path = Path() + val D = line4Point[0] + val F = line4Point[1] + val I = line4Point[2] + val G = line4Point[3] + path.moveTo(D.x,D.y) + path.lineTo(F.x,F.y) + path.lineTo(I.x,I.y) + path.lineTo(G.x,G.y) + startPointNextUse = I + secondPointNextUse = G + path.close() + canvas.drawPath(path,lineData.paint) + }else{ + val line4Point = getLine4Point(startPoint, endPoint, false) + val path = Path() + path.moveTo(startPointNextUse!!.x,startPointNextUse!!.y) + path.lineTo(secondPointNextUse!!.x,secondPointNextUse!!.y) + val tempStart = line4Point[0] + val tempEnd = line4Point[1] + path.lineTo(tempStart.x,tempStart.y) + path.lineTo(tempEnd.x,tempEnd.y) + startPointNextUse = tempEnd + secondPointNextUse = tempStart + canvas.drawPath(path,lineData.paint) + + } + } + + canvas.drawBitmap(bmBlock, matrixArrow, p) + + } + + fun getLine4Point(A: NearPointView, B: NearPointView, isFirst: Boolean):List { + + val reuslt = mutableListOf() + + // 120 80 120 80 (80,80) (120,120) + if (B.y > A.y && B.x > A.x) { + val AD = 5f + val BG = 5f + val BC = B.x-A.x + val AB = B.distance + val AC = B.y-A.y + val DE=AD*BC/AB + val GH=BG*BC/AB + + val AE=AD*AC/AB + val BH=BG*AC/AB + + val gx = B.x-BH + val gy = B.y+GH + + val Ix = B.x+BH + val Iy = B.y-GH + + // D点坐吧 + val dx = A.x-AE + val dy = A.y+DE + + val fx = A.x+AE + val fy = A.y-DE + + + if(isFirst){ + reuslt.add(NearPointView(dx,dy,0f)) + reuslt.add(NearPointView(fx,fy,0f)) + reuslt.add(NearPointView(Ix,Iy,0f)) + reuslt.add(NearPointView(gx,gy,0f)) + }else{ + reuslt.add(NearPointView(gx,gy,0f)) + reuslt.add(NearPointView(Ix,Iy,0f)) + } + } + + // 120 80 80 120 (120,80) (80,120) + if (B.y > A.y && B.x < A.x) { + val AD = 5f + val BC = A.x-B.x + val AB = B.distance + val BG = 5f + val AC = B.y-A.y + val DE=AD*BC/AB + val GH=BG*BC/AB + + val AE=AD*AC/AB + val BH=BG*AC/AB + + val gx = B.x+BH + val gy = B.y+GH + + val Ix = B.x-BH + val Iy = B.y-GH + + // D点坐吧 + val dx = A.x-AE + val dy = A.y-DE + + val fx = A.x+AE + val fy = A.y+DE + + if(isFirst){ + reuslt.add(NearPointView(dx,dy,0f)) + reuslt.add(NearPointView(fx,fy,0f)) + reuslt.add(NearPointView(gx,gy,0f)) + reuslt.add(NearPointView(Ix,Iy,0f)) + }else{ + reuslt.add(NearPointView(Ix,Iy,0f)) + reuslt.add(NearPointView(gx,gy,0f)) + } + } + + // 80 120 80 120 (120,120) (80,80) + if (B.y < A.y && B.x < A.x) { + val AD = 5f + val BC = A.y-B.y + val AB = B.distance + val AC = A.x-B.x + + val AE=AD*BC/AB + val DE=AD*AC/AB + + // D点坐吧 + val dx = A.x-AE + val dy = A.y+DE + + val fx = A.x+AE + val fy = A.y-DE + + val BG = 5f + val GH= BG*BC/AB + val BH= BG*AC/AB + + val gx = B.x-GH + val gy = B.y+BH + + val Ix = B.x+GH + val Iy = B.y-BH + + if(isFirst){ + reuslt.add(NearPointView(fx,fy,0f)) + reuslt.add(NearPointView(dx,dy,0f)) + reuslt.add(NearPointView(gx,gy,0f)) + reuslt.add(NearPointView(Ix,Iy,0f)) + }else{ + reuslt.add(NearPointView(Ix,Iy,0f)) + reuslt.add(NearPointView(gx,gy,0f)) + } + } + + // 80 120 120 80 (80,120) (120,80) + if (B.y < A.y && B.x > A.x) { + val AD = 5f + val AC = B.x-A.x + val AB = B.distance + val BG = 5f + val BC = A.y-B.y + val DE=AD*AC/AB + val GH=BG*AC/AB + + val AE=AD*BC/AB + val BH=BG*BC/AB + + // D点坐吧 + val dx = A.x-AE + val dy = A.y-DE + + val fx = A.x+AE + val fy = A.y+DE + + + val gx = B.x+BH + val gy = B.y+GH + + val Ix = B.x-BH + val Iy = B.y-GH + + if(isFirst){ + reuslt.add(NearPointView(fx,fy,0f)) + reuslt.add(NearPointView(dx,dy,0f)) + reuslt.add(NearPointView(Ix,Iy,0f)) + reuslt.add(NearPointView(gx,gy,0f)) + }else{ + reuslt.add(NearPointView(gx,gy,0f)) + reuslt.add(NearPointView(Ix,Iy,0f)) + } + + } + return reuslt + + + } + + /** + * 获取两条线的夹角 + * @param centerX + * @param centerY + * @param xInView + * @param yInView + * @return + */ + fun getRotationBetweenLines( + prePoint: NearPointView, + current: NearPointView, + nextPoint: NearPointView, + ): Pair? { + + val degreesAB = Math.toDegrees( + Math.atan2( + (prePoint.y - current.y).toDouble(), + (prePoint.x - current.x).toDouble() + ) + ) + val degreesBC = Math.toDegrees( + Math.atan2( + (current.y - nextPoint.y).toDouble(), + (current.x - nextPoint.x).toDouble() + ) + ) + + // 120 80 120 80 (80,80) (120,120) + if (current.y > prePoint.y && current.x > prePoint.x) { + if (degreesAB > degreesBC) { + return Pair(degreesAB - 90, true) + } else { + return Pair(degreesAB + 90, false) + } + } + + // 120 80 80 120 (120,80) (80,120) + if (current.y > prePoint.y && current.x < prePoint.x) { + if (degreesAB > degreesBC) { + return Pair(270-degreesAB, false) + } else { + return Pair(degreesAB-90, false) + } + } + + // 80 120 80 120 (120,120) (80,80) + if (current.y < prePoint.y && current.x < prePoint.x) { + if(degreesBC>0&°reesBCdegreesAB+180&°reesBC<180){ + return Pair(degreesAB + 90, false) + }else if(degreesBC>-180&°reesBCdegreesAB){ + return Pair(270-degreesAB, true) + } + } + + // 80 120 120 80 (80,120) (120,80) + if (current.y < prePoint.y && current.x > prePoint.x) { + if (degreesAB > degreesBC) { + return Pair(degreesAB + 90, false) + } else { + return Pair(degreesAB - 90, true) + } + } + return null + } + + @Synchronized + override fun setData(carLocation: MogoLocation, nextList: MutableList, preList: MutableList) { + var nextPointMaxLength = 0f + var prePointMaxLength = 0f + + val nextPointList = mutableListOf() + nextLineData.clear() + nextList.forEachIndexed { index, currentPoint -> + val headingAngle = CoordinateCalculateRouteUtil.getHeadingAngle( + carLocation.longitude, + carLocation.latitude, + currentPoint.location.longitude, + currentPoint.location.latitude + ) + val distancePx = currentPoint.distance * proportion + var x = 0f + var y = 0f + if (headingAngle == 0.0) { + x = (widthView / 2).toFloat() + y = (heighView / 2) - distancePx + } else if (headingAngle > 0 && headingAngle < 90) { + val xDistance = distancePx * sin(Math.toRadians(headingAngle)) + val yDistance = distancePx * cos(Math.toRadians(headingAngle)) + x = ((widthView / 2) + xDistance).toFloat() + y = ((heighView / 2) - yDistance).toFloat() + } else if (headingAngle == 90.0) { + x = widthView / 2 + distancePx + y = (heighView / 2).toFloat() + } else if (headingAngle > 90 && headingAngle < 180) { + val xDistance = distancePx * sin(Math.toRadians(180 - headingAngle)) + val yDistance = distancePx * cos(Math.toRadians(180 - headingAngle)) + x = (widthView / 2 + xDistance).toFloat() + y = (heighView / 2 + yDistance).toFloat() + } else if (headingAngle == 180.0) { + x = (widthView / 2).toFloat() + y = (heighView / 2) + distancePx + } else if (headingAngle > 180 && headingAngle < 270) { + val xDistance = distancePx * sin(Math.toRadians(headingAngle - 180)) + val yDistance = distancePx * cos(Math.toRadians(headingAngle - 180)) + x = (widthView / 2 - xDistance).toFloat() + y = (heighView / 2 + yDistance).toFloat() + } else if (headingAngle == 270.0) { + x = (widthView / 2) - distancePx + y = (heighView / 2).toFloat() + } else if (headingAngle > 270 && headingAngle < 360) { + val xDistance = distancePx * sin(Math.toRadians(360 - headingAngle)) + val yDistance = distancePx * cos(Math.toRadians(360 - headingAngle)) + x = (widthView / 2 - xDistance).toFloat() + y = (heighView / 2 - yDistance).toFloat() + } else if (headingAngle == 360.0) { + x = (widthView / 2).toFloat() + y = (heighView / 2) - distancePx + + } + if (index == 0) { + val distancePx = CoordinateUtils.calculateLineDistance( + carLocation.longitude, + carLocation.latitude, + currentPoint.location.longitude, + currentPoint.location.latitude + ) * proportion + nextPointList.add(NearPointView(x, y, distancePx)) + nextPointMaxLength += distancePx + } else { + val prePoint = nextList[index - 1] + val distancePx = CoordinateUtils.calculateLineDistance( + prePoint.location.longitude, + prePoint.location.latitude, + currentPoint.location.longitude, + currentPoint.location.latitude + ) * proportion + nextPointList.add(NearPointView(x, y, distancePx)) + nextPointMaxLength += distancePx + } + + + } + val prePointList = mutableListOf() + preLineData.clear() + preList.forEachIndexed { index, currentPoint -> + val headingAngle = CoordinateCalculateRouteUtil.getHeadingAngle( + carLocation.longitude, + carLocation.latitude, + currentPoint.location.longitude, + currentPoint.location.latitude + ) + val distancePx = currentPoint.distance * proportion + var x = 0f + var y = 0f + if (headingAngle == 0.0) { + x = (widthView / 2).toFloat() + y = (heighView / 2) - distancePx + } else if (headingAngle > 0 && headingAngle < 90) { + val xDistance = distancePx * sin(Math.toRadians(headingAngle)) + val yDistance = distancePx * cos(Math.toRadians(headingAngle)) + x = (widthView / 2 + xDistance).toFloat() + y = (heighView / 2 - yDistance).toFloat() + } else if (headingAngle == 90.0) { + x = widthView / 2 + distancePx + y = (heighView / 2).toFloat() + } else if (headingAngle > 90 && headingAngle < 180) { + val xDistance = distancePx * sin(Math.toRadians(180 - headingAngle)) + val yDistance = distancePx * cos(Math.toRadians(180 - headingAngle)) + x = (widthView / 2 + xDistance).toFloat() + y = (heighView / 2 + yDistance).toFloat() + } else if (headingAngle == 180.0) { + x = (widthView / 2).toFloat() + y = (heighView / 2) + distancePx + } else if (headingAngle > 180 && headingAngle < 270) { + val xDistance = distancePx * sin(Math.toRadians(headingAngle - 180)) + val yDistance = distancePx * cos(Math.toRadians(headingAngle - 180)) + x = (widthView / 2 - xDistance).toFloat() + y = (heighView / 2 + yDistance).toFloat() + } else if (headingAngle == 270.0) { + x = (widthView / 2) - distancePx + y = (heighView / 2).toFloat() + } else if (headingAngle > 270 && headingAngle < 360) { + val xDistance = distancePx * sin(Math.toRadians(360 - headingAngle)) + val yDistance = distancePx * cos(Math.toRadians(360 - headingAngle)) + x = ((widthView / 2) - xDistance).toFloat() + y = ((heighView / 2) - yDistance).toFloat() + } else if (headingAngle == 360.0) { + x = (widthView / 2).toFloat() + y = (heighView / 2) - distancePx + } + if (index == 0) { + prePointList.add(NearPointView(x, y, distancePx)) + prePointMaxLength += distancePx + } else { + val prePoint = preList[index - 1] + val distancePx = CoordinateUtils.calculateLineDistance( + prePoint.location.longitude, + prePoint.location.latitude, + currentPoint.location.longitude, + currentPoint.location.latitude + ) * proportion + prePointList.add(NearPointView(x, y, distancePx)) + prePointMaxLength += distancePx + } + } + + + var hasDraw = 0f + var lastColor = Color.parseColor("#2ED3FF") + nextPointList.forEachIndexed { index, triple -> + + val paint = Paint() + paint.apply { + strokeWidth = 20f + isAntiAlias = true + } + val colorPencent = if (index == nextPointList.size - 1) { + 1f + } else { + (triple.distance + hasDraw) / nextPointMaxLength + } + + val evaluateColor = evaluator.evaluate( + colorPencent, + Color.parseColor("#2ED3FF"), + Color.parseColor("#002ED3FF") + ) as Int + + if (index == 0) { + paint.shader = LinearGradient( + widthView / 2f, + heighView / 2f, + triple.x, + triple.y, + lastColor, + evaluateColor, + Shader.TileMode.CLAMP + ) + nextLineData.add( + LineData( + NearPointView(widthView / 2f, heighView / 2f, 0f), + triple, triple.distance, paint + ) + ) + } else { + val prePoint = nextPointList[index - 1] + paint.shader = LinearGradient( + prePoint.x, + prePoint.y, + triple.x, + triple.y, + lastColor, + evaluateColor, + Shader.TileMode.CLAMP + ) + nextLineData.add(LineData(prePoint, triple, triple.distance, paint)) + } + hasDraw += triple.distance + Log.d( + "DrawLineViewdrawNext", + "颜色百分比:${colorPencent}-颜色:${colorPencent}---长度${nextPointMaxLength}-----${hasDraw}" + ) + if (hasDraw > nextPointMaxLength) { + hasDraw = nextPointMaxLength + } + lastColor = evaluateColor + } + + Log.d("DrawLineViewdrawPre", "---------------------------") + + hasDraw = 0f + lastColor = Color.parseColor("#2ED3FF") + prePointList.forEachIndexed { index, triple -> + val paint = Paint() + paint.apply { + strokeWidth = 20f + isAntiAlias = true + color = Color.RED + } + + val colorPencent = if (index == prePointList.size - 1) { + 1f + } else { + (triple.distance + hasDraw) / prePointMaxLength + } + + val evaluateColor = evaluator.evaluate( + colorPencent, + Color.parseColor("#FF2ED3FF"), + Color.parseColor("#002ED3FF") + ) as Int + + if (index == 0) { + paint.shader = LinearGradient( + widthView / 2f, + heighView / 2f, + triple.x, + triple.y, + lastColor, + evaluateColor, + Shader.TileMode.CLAMP + ) + preLineData.add( + LineData( + NearPointView(widthView / 2f, heighView / 2f, 0f), + triple, triple.distance, paint + ) + ) + } else { + val prePoint = prePointList[index - 1] + paint.shader = LinearGradient( + prePoint.x, + prePoint.y, + triple.x, + triple.y, + lastColor, + evaluateColor, + Shader.TileMode.CLAMP + ) + preLineData.add(LineData(prePoint, triple, triple.distance, paint)) + } + hasDraw += triple.distance + Log.d( + "DrawLineViewdrawPre", + "颜色百分比:${colorPencent}-颜色:${colorPencent}---长度${prePointMaxLength}-----${hasDraw}" + ) + if (hasDraw > prePointMaxLength) { + hasDraw = prePointMaxLength + } + lastColor = evaluateColor + } + + Log.d("DrawLineViewdrawPre", "---------------------------") + ThreadUtils.runOnUiThread { + matrixArrow.setTranslate( + (width / 2 - bmBlockWidth / 2).toFloat(), + (height / 2 - bmBlockHeight / 2).toFloat() + ) + carLocation.heading.let { + matrixArrow.preRotate(it.toFloat(), bmBlockWidth / 2f, bmBlockHeight / 2f) + } + invalidate() + } + } + + +} \ No newline at end of file diff --git a/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/simplemap/SimpleMapViewModel.kt b/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/simplemap/SimpleMapViewModel.kt new file mode 100644 index 0000000000..b97c159bff --- /dev/null +++ b/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/simplemap/SimpleMapViewModel.kt @@ -0,0 +1,82 @@ +package com.mogo.och.taxi.passenger.ui.simplemap + +import androidx.lifecycle.ViewModel +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.util.CoordinateUtils +import com.mogo.och.common.module.manager.distancemamager.ITrajectoryListener +import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager + +class SimpleMapViewModel : ViewModel(), ITrajectoryListener { + + private val TAG = SimpleMapViewModel::class.java.simpleName + + private val orderShowEvaluate = "SHOWEVALUATE" + + private var simpleMapCallback: SimpleMapCallback?=null + + init { + TrajectoryAndDistanceManager.addTrajectoryListener(TAG,this) + } + + + fun setViewCallback(viewCallback: SimpleMapCallback) { + this.simpleMapCallback = viewCallback + } + + override fun onCleared() { + super.onCleared() + this.simpleMapCallback = null + } + + interface SimpleMapCallback { + fun setData( + carLocation: MogoLocation, + nextList: MutableList, + preList: MutableList + ) + } + + override fun trajectoryCallback( + routeArrivied: MutableList, + routeArriving: MutableList, + location: MogoLocation + ) { + val nextList = mutableListOf() + val preList = mutableListOf() + + looper@ for(index in routeArrivied.size-1 downTo 0){ + val tempMogLocation = routeArrivied[index] + val distance = CoordinateUtils.calculateLineDistance( + location.longitude, + location.latitude, + tempMogLocation.longitude, + tempMogLocation.latitude + ) + if (distance >= 250) { + nextList.add(NearPoint(index,tempMogLocation,distance)) + break@looper + } else { + nextList.add(NearPoint(index,tempMogLocation,distance)) + } + } + + looper@ for(index in 0 until routeArriving.size){ + val tempMogLocation = routeArriving[index] + val distance = CoordinateUtils.calculateLineDistance( + location.longitude, + location.latitude, + tempMogLocation.longitude, + tempMogLocation.latitude + ) + if (distance >= 250) { + preList.add(NearPoint(index,tempMogLocation,distance)) + break@looper + } else { + preList.add(NearPoint(index,tempMogLocation,distance)) + } + } + CallerLogger.d(TAG,"nextList:${nextList.size}---preList:${preList.size}") + this.simpleMapCallback?.setData(location,nextList,preList) + } +} \ No newline at end of file diff --git a/OCH/taxi/pcommon/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_head.png b/OCH/taxi/pcommon/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_head.png index f725b43295..cb0afed17d 100755 Binary files a/OCH/taxi/pcommon/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_head.png and b/OCH/taxi/pcommon/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_head.png differ diff --git a/OCH/taxi/pcommon/src/main/res/drawable/taxt_p_music_seekbar_style.xml b/OCH/taxi/pcommon/src/main/res/drawable/taxt_p_music_seekbar_style.xml index 742f57fd2d..21b139e6e3 100644 --- a/OCH/taxi/pcommon/src/main/res/drawable/taxt_p_music_seekbar_style.xml +++ b/OCH/taxi/pcommon/src/main/res/drawable/taxt_p_music_seekbar_style.xml @@ -4,14 +4,14 @@ - + - + diff --git a/OCH/taxi/pcommon/src/main/res/layout/taxi_p_music_playing.xml b/OCH/taxi/pcommon/src/main/res/layout/taxi_p_music_playing.xml index cd457e1b17..b74637d229 100644 --- a/OCH/taxi/pcommon/src/main/res/layout/taxi_p_music_playing.xml +++ b/OCH/taxi/pcommon/src/main/res/layout/taxi_p_music_playing.xml @@ -28,42 +28,35 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" - android:layout_marginTop="@dimen/dp_127" + android:layout_marginTop="@dimen/dp_146" android:src="@drawable/taxt_p_music_bg_relax_head" - android:layout_width="@dimen/dp_390" - android:layout_height="@dimen/dp_390"/> + android:layout_width="@dimen/dp_310" + android:layout_height="@dimen/dp_310"/> - @@ -76,7 +69,7 @@ android:thumb="@null" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tv_author" + app:layout_constraintTop_toBottomOf="@+id/tv_tag" android:layout_marginTop="@dimen/dp_31" android:progressDrawable="@drawable/taxt_p_music_seekbar_style" android:paddingTop="3dp" diff --git a/OCH/taxi/pcommon/src/main/res/values/colors.xml b/OCH/taxi/pcommon/src/main/res/values/colors.xml index 2e08eb7c65..524c105c98 100644 --- a/OCH/taxi/pcommon/src/main/res/values/colors.xml +++ b/OCH/taxi/pcommon/src/main/res/values/colors.xml @@ -7,6 +7,7 @@ #576887 #4DFFFFFF #44488ED0 + #1A488ED0 #598CFF #2CBFFC #1060ff diff --git a/OCH/taxi/unmanned-passenger/src/main/res/layout/taxt_u_p_itinerary.xml b/OCH/taxi/unmanned-passenger/src/main/res/layout/taxt_u_p_itinerary.xml index 8190e1fee5..0a238c9e36 100644 --- a/OCH/taxi/unmanned-passenger/src/main/res/layout/taxt_u_p_itinerary.xml +++ b/OCH/taxi/unmanned-passenger/src/main/res/layout/taxt_u_p_itinerary.xml @@ -36,7 +36,7 @@ android:layout_marginEnd="@dimen/dp_12" android:layout_marginStart="@dimen/dp_93" android:textColor="@color/taxi_p_004DC4" - android:textSize="@dimen/dp_35" + android:textSize="@dimen/dp_38" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/gl_horizontal_top" app:layout_constraintBottom_toBottomOf="@+id/gl_horizontal_center" @@ -44,19 +44,44 @@ + + + + @@ -111,30 +136,26 @@ app:layout_constraintStart_toStartOf="@+id/actv_surplus_time" app:layout_constraintEnd_toEndOf="@+id/actv_surplus_time" /> - + app:layout_constraintTop_toTopOf="@+id/gl_horizontal_center"> - + + + 138dp 139dp 140dp + 140.4dp 141dp 141.5dp 142dp