底部添加进度条样式调整
@@ -15,8 +15,10 @@ import android.widget.FrameLayout
|
||||
import android.widget.ListView
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst
|
||||
import com.mogo.och.taxi.passenger.event.FinishActivity
|
||||
import com.mogo.och.taxi.passenger.event.UIStatus
|
||||
import com.mogo.och.taxi.passenger.mulprocess.EmptyService
|
||||
@@ -143,7 +145,9 @@ object OverlayLeftViewUtils {
|
||||
override fun onSelect(isCurrentProcess:Boolean) {
|
||||
if(isCurrentProcess) {
|
||||
close(view, windowManager)
|
||||
VideoActivity.startActivity(context, VideoActivity.VIDEOTYPE_CONSULT)
|
||||
//计算订单起点和终点距离
|
||||
val sumDis = SharedPrefsMgr.getInstance(context).getInt(TaxiPassengerConst.SP_KEY_ORDER_SUM_DIS, 0)
|
||||
VideoActivity.startActivity(context, VideoActivity.VIDEOTYPE_CONSULT,sumDis)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,7 +156,8 @@ object OverlayLeftViewUtils {
|
||||
override fun onSelect(isCurrentProcess:Boolean) {
|
||||
if(isCurrentProcess) {
|
||||
close(view, windowManager)
|
||||
VideoActivity.startActivity(context, VideoActivity.VIDEOTYPE_MOIES)
|
||||
val sumDis = SharedPrefsMgr.getInstance(context).getInt(TaxiPassengerConst.SP_KEY_ORDER_SUM_DIS, 0)
|
||||
VideoActivity.startActivity(context, VideoActivity.VIDEOTYPE_CONSULT,sumDis)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,15 @@ import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.PixelFormat
|
||||
import android.os.Build
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.SeekBar
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.wigets.OCHGradientTextView
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
@@ -28,9 +31,11 @@ object FloatingDistanceInfoUtils {
|
||||
private var isShowing = false
|
||||
|
||||
private var params:WindowManager.LayoutParams?=null
|
||||
private var paramsBottom:WindowManager.LayoutParams?=null
|
||||
|
||||
|
||||
private var overlayView: View?=null
|
||||
private var orderInfoView: View?=null
|
||||
private var processView: SeekBar?=null
|
||||
|
||||
// 距离
|
||||
private var actvDistancew: OCHGradientTextView?=null
|
||||
@@ -48,7 +53,7 @@ object FloatingDistanceInfoUtils {
|
||||
* 添加覆盖View在Activity上面
|
||||
*/
|
||||
@JvmOverloads
|
||||
fun showOverlayView(context: Activity,ani: Int = -1) {
|
||||
fun showOverlayView(context: Activity,ani: Int = -1,sumDis:Int) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
@@ -56,9 +61,9 @@ object FloatingDistanceInfoUtils {
|
||||
windowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
||||
}
|
||||
|
||||
overlayView = LayoutInflater.from(context)
|
||||
orderInfoView = LayoutInflater.from(context)
|
||||
.inflate(R.layout.taxi_p_window_float_distance_info, null) as ConstraintLayout
|
||||
overlayView?.let { view ->
|
||||
orderInfoView?.let { view ->
|
||||
// 设置View显示模式,沉浸式的侵入到状态栏,导航栏
|
||||
view.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
@@ -89,13 +94,26 @@ object FloatingDistanceInfoUtils {
|
||||
actvArrivedTime?.setVertrial(true)
|
||||
actvArrivedTime?.setmColorList(intArrayOf)
|
||||
|
||||
processView = SeekBar(context)
|
||||
processView?.let {
|
||||
it.max = sumDis
|
||||
layoutParamsBottom(-1)
|
||||
it.setPadding(0,0,0,0)
|
||||
it.progressDrawable = ContextCompat.getDrawable(context,R.drawable.taxi_video_order_process)
|
||||
it.thumb = null
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
it.maxHeight = 14
|
||||
it.minHeight = 14
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 如果正在展示中,并且lastOverlayView不为null,先做移除操作,保证覆盖在最上面的View只有一个,防止叠加导致无法移除
|
||||
dismissOverlayView()
|
||||
|
||||
try {
|
||||
windowManager!!.addView(overlayView, params)
|
||||
windowManager!!.addView(orderInfoView, params)
|
||||
windowManager!!.addView(processView, paramsBottom)
|
||||
isShowing = true
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
@@ -130,6 +148,32 @@ object FloatingDistanceInfoUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private fun layoutParamsBottom(ani: Int) {
|
||||
if(paramsBottom ==null) {
|
||||
paramsBottom = WindowManager.LayoutParams()
|
||||
}
|
||||
paramsBottom = WindowManager.LayoutParams()
|
||||
paramsBottom?.let {
|
||||
it.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
it.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
it.alpha = 1.0f
|
||||
it.gravity = Gravity.START or Gravity.BOTTOM
|
||||
it.x = 0
|
||||
it.y = 0
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
// 设置窗口类型为应用子窗口,和PopupWindow同类型
|
||||
it.type = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL
|
||||
// 没有边界限制,允许窗口扩展到屏幕外
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS or
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE or
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
if (ani != -1) {
|
||||
it.windowAnimations = ani
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setSpeed(speed: Float) {
|
||||
val newSpeed: Int = (Math.abs(speed) * 3.6f).toInt() // 倒车时工控机反馈定位信息中speed为负值
|
||||
|
||||
@@ -138,12 +182,23 @@ object FloatingDistanceInfoUtils {
|
||||
}
|
||||
}
|
||||
|
||||
fun setDistance(remainDis: String?, disUnit: String, time: Int, arriveTime: String) {
|
||||
fun setDistance(meters:Long,remainDis: String?, disUnit: String, time: Int, arriveTime: String) {
|
||||
UiThreadHandler.getsUiHandler().post {
|
||||
actvDistancew?.text = "$remainDis"
|
||||
actvDistancewUnit?.text = "距离($disUnit)"
|
||||
actvSurplusTime?.text = "$time"
|
||||
actvArrivedTime?.text = arriveTime
|
||||
|
||||
processView?.let {
|
||||
val process = it.max - meters
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
it.setProgress(process.toInt(), true)
|
||||
}else{
|
||||
it.progress = process.toInt()
|
||||
}
|
||||
it.jumpDrawablesToCurrentState()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,13 +210,22 @@ object FloatingDistanceInfoUtils {
|
||||
return
|
||||
}
|
||||
try {
|
||||
if (windowManager != null && overlayView != null) {
|
||||
windowManager!!.removeViewImmediate(overlayView)
|
||||
windowManager = null
|
||||
if (windowManager != null && orderInfoView != null) {
|
||||
windowManager!!.removeViewImmediate(orderInfoView)
|
||||
params = null
|
||||
}
|
||||
if (overlayView!=null) {
|
||||
overlayView = null
|
||||
if (windowManager != null && processView != null) {
|
||||
windowManager!!.removeViewImmediate(processView)
|
||||
paramsBottom = null
|
||||
}
|
||||
if(windowManager!=null){
|
||||
windowManager = null
|
||||
}
|
||||
if (orderInfoView!=null) {
|
||||
orderInfoView = null
|
||||
}
|
||||
if(processView!=null){
|
||||
processView = null
|
||||
}
|
||||
isShowing = false
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.mogo.och.taxi.passenger.ui.video
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
@@ -13,15 +11,11 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.bumptech.glide.request.target.SimpleTarget
|
||||
import com.bumptech.glide.request.transition.Transition
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerVideoPlay
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst
|
||||
import com.mogo.och.taxi.passenger.mulprocess.ICallback
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.LeftMenuOpen
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils
|
||||
@@ -30,7 +24,6 @@ import com.mogo.och.taxi.passenger.ui.video.layoutmanage.CarouselLayoutManager
|
||||
import com.mogo.och.taxi.passenger.ui.video.layoutmanage.CarouselZoomPostLayoutListener
|
||||
import com.mogo.och.taxi.passenger.ui.video.layoutmanage.CenterScrollListener
|
||||
import com.mogo.och.taxi.passenger.utils.FixMemoryLeak
|
||||
import com.mogo.och.taxi.passenger.utils.blur.GlideBlurTransform
|
||||
import com.mogo.och.taxi.passenger.widget.ConsultVideoPlayer
|
||||
import com.mogo.och.taxi.passenger.widget.indicator.IndicatorView
|
||||
import com.mogo.och.taxi.passenger.widget.indicator.enums.IndicatorOrientation
|
||||
@@ -63,9 +56,10 @@ class VideoActivity : AppCompatActivity() {
|
||||
|
||||
const val EVENT_FINISH = 0
|
||||
|
||||
fun startActivity(context:Context,videoType:Int){
|
||||
fun startActivity(context:Context,videoType:Int,sumDis:Int){
|
||||
val intent = Intent(context, VideoActivity::class.java)
|
||||
intent.putExtra(VIDEOTYPE, videoType)
|
||||
intent.putExtra(TaxiPassengerConst.SP_KEY_ORDER_SUM_DIS,sumDis)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
@@ -96,7 +90,7 @@ class VideoActivity : AppCompatActivity() {
|
||||
beforeTime.add(Calendar.MINUTE, time)
|
||||
//到达时间
|
||||
val arriveTime = DateTimeUtil.formatCalendarToString(beforeTime, DateTimeUtil.TAXI_HH_mm)
|
||||
FloatingDistanceInfoUtils.setDistance(remainDis,disUnit,time,arriveTime)
|
||||
FloatingDistanceInfoUtils.setDistance(meters,remainDis,disUnit,time,arriveTime)
|
||||
}else{
|
||||
FloatingDistanceInfoUtils.setSpeed(speed)
|
||||
}
|
||||
@@ -221,12 +215,12 @@ class VideoActivity : AppCompatActivity() {
|
||||
indicatorView.setOrientation(IndicatorOrientation.INDICATOR_HORIZONTAL)
|
||||
indicatorView.setIndicatorStyle(IndicatorStyle.ROUND_RECT)
|
||||
indicatorView.setSliderColor(
|
||||
Color.parseColor("#80FFFFFF"), Color.parseColor("#2972FF"),
|
||||
Color.parseColor("#27C8FF")
|
||||
Color.parseColor("#FFFFFF"), Color.parseColor("#26C5FD"),
|
||||
Color.parseColor("#26C5FD")
|
||||
)
|
||||
indicatorView.setSliderWidth(16f, 101f)
|
||||
indicatorView.setSliderHeight(16f)
|
||||
indicatorView.setSliderGap(30f)
|
||||
indicatorView.setSliderWidth(9f, 54f)
|
||||
indicatorView.setSliderHeight(9f)
|
||||
indicatorView.setSliderGap(36f)
|
||||
rvVideoPlaylist?.addOnScrollListener(object : CenterScrollListener() {
|
||||
var prePlayerPosition = 0
|
||||
override fun pageSelect(recyclerView: RecyclerView?, newState: Int) {
|
||||
@@ -322,7 +316,8 @@ class VideoActivity : AppCompatActivity() {
|
||||
OverlayLeftViewUtils.showOverlayView(this,isOpen = false, checkIndex = OverlayLeftViewUtils.MOVIE)
|
||||
}
|
||||
}
|
||||
FloatingDistanceInfoUtils.showOverlayView(this)
|
||||
val sumDis = intent.getIntExtra(TaxiPassengerConst.SP_KEY_ORDER_SUM_DIS, 0)
|
||||
FloatingDistanceInfoUtils.showOverlayView(this,sumDis=sumDis)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
||||
@@ -79,6 +79,11 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
private fun addDrageAnchor(){
|
||||
vPpenLeft.visibility = VISIBLE
|
||||
OverlayLeftViewUtils.addDragTarget(vPpenLeft)
|
||||
layoutBottom.post {
|
||||
val layoutParams = layoutBottom.layoutParams as ConstraintLayout.LayoutParams
|
||||
layoutParams.setMargins(333,0,333,90)
|
||||
layoutBottom.layoutParams = layoutParams
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 749 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 939 KiB After Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 490 KiB After Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 749 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 939 KiB After Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 490 KiB After Width: | Height: | Size: 2.2 MiB |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:endColor="#99000000" android:startColor="#00000000" android:angle="90"/>
|
||||
<gradient android:endColor="#80000000" android:startColor="#00000000" android:angle="90"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="5px"/>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="5px"/>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="5px"/>
|
||||
<gradient android:startColor="@android:color/transparent" android:endColor="#54D7FF"/>
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -24,8 +24,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_title_icon"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_title_icon"
|
||||
android:text="蘑菇资讯"
|
||||
android:textStyle="bold"
|
||||
android:textSize="60px"
|
||||
android:textSize="48px"
|
||||
android:layout_marginStart="34px"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -34,9 +34,9 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_video_playlist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1294px"
|
||||
android:layout_height="940px"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="-40px"
|
||||
android:layout_marginTop="156px"
|
||||
android:layout_marginStart="24px"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -48,8 +48,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="172px"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rv_video_playlist"
|
||||
android:layout_marginTop="67px"
|
||||
app:vpi_orientation="horizontal"
|
||||
app:vpi_slide_mode="scale"
|
||||
app:vpi_slider_checked_color="@color/taxi_p_traffic_light_red_color_up"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="158px"
|
||||
android:layout_height="120px"
|
||||
android:background="@drawable/bg_taxi_p_video_bg_top"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -58,9 +58,9 @@
|
||||
app:layout_constraintTop_toTopOf="@+id/fullscreen"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/fullscreen"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="50px"
|
||||
android:layout_marginStart="40px"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="46px" />
|
||||
android:textSize="38px" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
android:background="@drawable/bg_taxi_p_video_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginStart="148px"
|
||||
android:layout_marginEnd="148px"
|
||||
android:layout_marginLeft="148px"
|
||||
android:layout_marginRight="148px"
|
||||
android:layout_marginBottom="51px"
|
||||
android:layout_height="99px"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||