评论部分动画时禁用星星点击
添加全程概览 添加进度
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.och.taxi.passenger">
|
||||
|
||||
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
|
||||
<application>
|
||||
<activity
|
||||
android:name=".ui.video.VideoActivity"
|
||||
@@ -9,6 +10,8 @@
|
||||
android:process=":video"
|
||||
android:theme="@style/ActivityTranslucentVideo"
|
||||
android:exported="false" />
|
||||
<service android:name=".mulprocess.EmptyService"
|
||||
android:process=":video" />
|
||||
<provider
|
||||
android:name=".mulprocess.BinderProvider"
|
||||
android:authorities="com.mogo.och.taxi.passenger.leftmenu"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// ICallback.aidl
|
||||
package com.mogo.och.taxi.passenger.mulprocess;
|
||||
|
||||
// Declare any non-default types here with import statements
|
||||
|
||||
interface ICallback {
|
||||
|
||||
void onResult(long meters, long timeInSecond,float speed);
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
// ILeftMenuService.aidl
|
||||
package com.mogo.och.taxi.passenger.mulprocess;
|
||||
|
||||
import com.mogo.och.taxi.passenger.mulprocess.ICallback;
|
||||
|
||||
// Declare any non-default types here with import statements
|
||||
|
||||
interface ILeftMenuService {
|
||||
@@ -10,4 +12,8 @@ interface ILeftMenuService {
|
||||
*/
|
||||
void transmissionIndex(int index);
|
||||
|
||||
void registerCallback(in ICallback cb);
|
||||
|
||||
void unRegisterCallback(in ICallback cb);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.och.taxi.passenger.mulprocess
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
|
||||
class EmptyService: Service() {
|
||||
|
||||
companion object{
|
||||
fun startService(context: Context){
|
||||
//预加载视频进程
|
||||
val intent = Intent(context, EmptyService::class.java)
|
||||
context.startService(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? {
|
||||
// 加载进程的空Service
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,14 @@ public class OrderServiceImpl extends ILeftMenuService.Stub {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCallback(ICallback cb) throws RemoteException {
|
||||
LeftMenuOpen.INSTANCE.registerCallbackHost(cb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unRegisterCallback(ICallback cb) throws RemoteException {
|
||||
LeftMenuOpen.INSTANCE.unregisterCallbackHost(cb);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum;
|
||||
import com.mogo.och.taxi.passenger.model.TaxiPassengerGeocodeSearchModel;
|
||||
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel;
|
||||
import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.LeftMenuOpen;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -118,6 +119,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
LeftMenuOpen.INSTANCE.callCallBack(-1,-1,location.getSpeed());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,7 +136,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
|
||||
@Override
|
||||
public void onCurrentOrderDistToEndChanged(long meters, long timeInSecond) {
|
||||
|
||||
LeftMenuOpen.INSTANCE.callCallBack(meters,timeInSecond,-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.och.taxi.passenger.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.View;
|
||||
@@ -29,7 +28,7 @@ import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback;
|
||||
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter;
|
||||
import com.mogo.och.taxi.passenger.ui.comment.TaxiPassengerArrivedView;
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils;
|
||||
import com.mogo.och.taxi.passenger.ui.video.VideoActivity;
|
||||
import com.mogo.och.taxi.passenger.mulprocess.EmptyService;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
@@ -99,7 +98,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
switchVRFlatMode(false);
|
||||
}
|
||||
//预加载视频进程
|
||||
VideoActivity.Companion.startActivity(getContext(),VideoActivity.VIDEOTYPE_CLOSE);
|
||||
EmptyService.Companion.startService(getContext());
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon(){
|
||||
@@ -277,7 +276,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
if (ochServingOrderFragment != null){
|
||||
transaction.hide(ochServingOrderFragment).commitAllowingStateLoss();
|
||||
}
|
||||
OverlayLeftViewUtils.INSTANCE.dismissOverlayView();
|
||||
OverlayLeftViewUtils.INSTANCE.dismissOverlayView(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
||||
import android.content.ContentResolver
|
||||
import android.database.Cursor
|
||||
import android.os.IBinder
|
||||
import android.os.RemoteCallbackList
|
||||
import android.os.RemoteException
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
@@ -12,8 +13,10 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import com.mogo.och.taxi.passenger.mulprocess.BinderCursor
|
||||
import com.mogo.och.taxi.passenger.mulprocess.BinderProvider
|
||||
import com.mogo.och.taxi.passenger.mulprocess.ICallback
|
||||
import com.mogo.och.taxi.passenger.mulprocess.ILeftMenuService
|
||||
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object LeftMenuOpen {
|
||||
|
||||
@@ -31,6 +34,8 @@ object LeftMenuOpen {
|
||||
|
||||
private var orderService: ILeftMenuService? = null
|
||||
|
||||
private var icallbacks: RemoteCallbackList<ICallback> = RemoteCallbackList<ICallback>()
|
||||
|
||||
fun setValue(
|
||||
windowView: View,
|
||||
wl: WindowManager.LayoutParams?,
|
||||
@@ -177,6 +182,49 @@ object LeftMenuOpen {
|
||||
orderService?.transmissionIndex(index)
|
||||
}
|
||||
|
||||
fun registerCallbackHost(cb:ICallback?){
|
||||
if (orderService == null) {
|
||||
registerC()
|
||||
}
|
||||
cb?.let {
|
||||
icallbacks?.register(it)
|
||||
}
|
||||
}
|
||||
|
||||
fun unregisterCallbackHost(cb:ICallback?){
|
||||
cb?.let {
|
||||
icallbacks?.unregister(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun registerCallback(cb:ICallback?){
|
||||
if (orderService == null) {
|
||||
registerC()
|
||||
}
|
||||
cb?.let {
|
||||
orderService?.registerCallback(it)
|
||||
}
|
||||
}
|
||||
|
||||
fun unregisterCallback(cb:ICallback?){
|
||||
cb?.let {
|
||||
orderService?.unRegisterCallback(it)
|
||||
}
|
||||
}
|
||||
|
||||
fun callCallBack(meters: Long,timeInSecond: Long,speed:Float){
|
||||
val len = icallbacks.beginBroadcast()
|
||||
for (i in 0 until len) {
|
||||
try {
|
||||
icallbacks.getBroadcastItem(i).onResult(meters,timeInSecond,speed)
|
||||
} catch (e: RemoteException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
icallbacks.finishBroadcast()
|
||||
}
|
||||
|
||||
/**
|
||||
* 主进程、video进程都得调用
|
||||
* 主进程在显示是主动调用
|
||||
|
||||
@@ -14,9 +14,10 @@ import android.view.animation.LinearInterpolator
|
||||
import android.widget.ListView
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.model.LeftMenuModel
|
||||
import com.mogo.och.taxi.passenger.mulprocess.EmptyService
|
||||
import com.mogo.och.taxi.passenger.ui.video.VideoActivity
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@@ -77,7 +78,7 @@ object OverlayLeftViewUtils {
|
||||
layoutParams(ani,view, isOpen)
|
||||
|
||||
// 如果正在展示中,并且lastOverlayView不为null,先做移除操作,保证覆盖在最上面的View只有一个,防止叠加导致无法移除
|
||||
dismissOverlayView()
|
||||
dismissOverlayView(false)
|
||||
|
||||
val vDragField = view.findViewById<View>(R.id.v_drag_field)
|
||||
acivOpenClose = view.findViewById(R.id.aciv_open_close)
|
||||
@@ -136,6 +137,7 @@ object OverlayLeftViewUtils {
|
||||
LeftMenuOpen.setValue(view, params, windowManager,::close,::open)
|
||||
try {
|
||||
windowManager!!.addView(overlayView, params)
|
||||
checkProcess()
|
||||
isShowing = true
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
@@ -147,6 +149,7 @@ object OverlayLeftViewUtils {
|
||||
* 打开状态栏
|
||||
*/
|
||||
private fun open(overlayView: View,windowManager: WindowManager?) {
|
||||
checkProcess()
|
||||
val valueAnimator = ValueAnimator.ofInt(params!!.x, 0)
|
||||
valueAnimator.duration = 100
|
||||
valueAnimator.interpolator = LinearInterpolator()
|
||||
@@ -174,6 +177,27 @@ object OverlayLeftViewUtils {
|
||||
valueAnimator.start()
|
||||
}
|
||||
|
||||
private fun checkProcess() {
|
||||
ThreadPoolService.execute {
|
||||
val currentProcessName = ProcessUtils.getCurrentProcessName()
|
||||
if (currentProcessName.contains(":video")) {
|
||||
return@execute
|
||||
}
|
||||
val allBackgroundProcesses = ProcessUtils.getAllBackgroundProcesses()
|
||||
var haveProcess = false
|
||||
allBackgroundProcesses.forEach {
|
||||
if (it.contains(":video")) {
|
||||
haveProcess = true
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
System.err.println("进程是否存在---$haveProcess----")
|
||||
if (!haveProcess) {
|
||||
EmptyService.startService(Utils.getApp())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun addDragTarget(view :View?){
|
||||
LeftMenuOpen.registerDragView(view)
|
||||
}
|
||||
@@ -186,7 +210,9 @@ object OverlayLeftViewUtils {
|
||||
*
|
||||
*/
|
||||
fun transmissionIndex(index:Int){
|
||||
LeftMenuOpen.transmissionIndex(index)
|
||||
if(!ProcessUtils.isMainProcess(Utils.getApp())) {
|
||||
LeftMenuOpen.transmissionIndex(index)
|
||||
}
|
||||
}
|
||||
|
||||
fun transmissionIndexGet(index: Int){
|
||||
@@ -285,7 +311,7 @@ object OverlayLeftViewUtils {
|
||||
/**
|
||||
* 移除覆盖View在Activity上面
|
||||
*/
|
||||
fun dismissOverlayView() {
|
||||
fun dismissOverlayView(isMain:Boolean) {
|
||||
if (!isShowing) {
|
||||
return
|
||||
}
|
||||
@@ -295,7 +321,9 @@ object OverlayLeftViewUtils {
|
||||
}
|
||||
}
|
||||
// 管理的要关闭都得关闭
|
||||
VideoActivity.startActivity(overlayView!!.context,VideoActivity.VIDEOTYPE_CLOSE)
|
||||
if(isMain) {
|
||||
VideoActivity.startActivity(overlayView!!.context, VideoActivity.VIDEOTYPE_CLOSE)
|
||||
}
|
||||
subscribe = null
|
||||
LeftMenuOpen.clearValue()
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.mogo.och.taxi.passenger.ui.video
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.PixelFormat
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.ItemViewTouchListener
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.lang.Exception
|
||||
|
||||
/**
|
||||
* 视频全屏播放
|
||||
*
|
||||
* @author yangyakun
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object FloatingDistanceInfoUtils {
|
||||
private const val TAG = "OverlayViewUtils"
|
||||
private var windowManager: WindowManager? = null
|
||||
|
||||
@Volatile
|
||||
private var isShowing = false
|
||||
|
||||
private var params:WindowManager.LayoutParams?=null
|
||||
|
||||
|
||||
private var overlayView: View?=null
|
||||
|
||||
/**
|
||||
* 添加覆盖View在Activity上面
|
||||
*/
|
||||
@JvmOverloads
|
||||
fun showOverlayView(context: Activity,ani: Int = -1) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
if (windowManager == null) {
|
||||
windowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
||||
}
|
||||
|
||||
overlayView = LayoutInflater.from(context)
|
||||
.inflate(R.layout.taxi_p_window_float_distance_info, null) as ConstraintLayout
|
||||
overlayView?.let { view ->
|
||||
// 设置View显示模式,沉浸式的侵入到状态栏,导航栏
|
||||
view.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
|
||||
layoutParams(ani)
|
||||
|
||||
// 如果正在展示中,并且lastOverlayView不为null,先做移除操作,保证覆盖在最上面的View只有一个,防止叠加导致无法移除
|
||||
dismissOverlayView()
|
||||
|
||||
try {
|
||||
windowManager!!.addView(overlayView, params)
|
||||
isShowing = true
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun layoutParams(ani: Int) {
|
||||
if(params ==null) {
|
||||
params = WindowManager.LayoutParams()
|
||||
}
|
||||
params = WindowManager.LayoutParams()
|
||||
params?.let {
|
||||
it.width = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
it.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
it.alpha = 1.0f
|
||||
it.gravity = Gravity.END or Gravity.TOP
|
||||
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_TOUCH_MODAL
|
||||
if (ani != -1) {
|
||||
it.windowAnimations = ani
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除覆盖View在Activity上面
|
||||
*/
|
||||
fun dismissOverlayView() {
|
||||
if (!isShowing) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
if (windowManager != null && overlayView != null) {
|
||||
windowManager!!.removeViewImmediate(overlayView)
|
||||
windowManager = null
|
||||
params = null
|
||||
}
|
||||
if (overlayView!=null) {
|
||||
overlayView = null
|
||||
}
|
||||
isShowing = false
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,9 @@ import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import java.lang.Exception
|
||||
|
||||
/**
|
||||
* 遮罩层工具类
|
||||
* 视频全屏播放
|
||||
*
|
||||
* @author mogoauto
|
||||
* @author yangyakun
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object FullVideoUtils {
|
||||
|
||||
@@ -5,34 +5,43 @@ import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.WindowInsetsControllerCompat
|
||||
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.eagle.core.utilcode.util.ToastUtils
|
||||
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.mulprocess.ICallback
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.LeftMenuOpen
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils
|
||||
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.PermissionUtil
|
||||
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
|
||||
import com.mogo.och.taxi.passenger.widget.indicator.enums.IndicatorSlideMode
|
||||
import com.mogo.och.taxi.passenger.widget.indicator.enums.IndicatorStyle
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
import java.util.*
|
||||
import kotlin.math.floor
|
||||
|
||||
|
||||
@@ -63,6 +72,37 @@ class VideoActivity : AppCompatActivity() {
|
||||
|
||||
private var videotype = VIDEOTYPE_CONSULT
|
||||
|
||||
val callBack = object : ICallback.Stub() {
|
||||
override fun onResult(meters :Long, timeInSecond:Long,speed:Float) {
|
||||
if(speed<0){
|
||||
// 距离单位
|
||||
var disUnit = "公里"
|
||||
// 距离
|
||||
var remainDis: String? = "0"
|
||||
|
||||
if (meters > 0) {
|
||||
if (meters / 1000 < 1) {
|
||||
disUnit = "米"
|
||||
remainDis = Math.round(meters.toFloat()).toString()
|
||||
} else {
|
||||
disUnit = "公里"
|
||||
remainDis = NumberFormatUtil.formatLong(meters.toDouble() / 1000)
|
||||
}
|
||||
}
|
||||
// 剩余时间
|
||||
val time = Math.ceil(timeInSecond.toDouble() / 60f).toInt()
|
||||
|
||||
val beforeTime = Calendar.getInstance()
|
||||
beforeTime.add(Calendar.MINUTE, time)
|
||||
//到达时间
|
||||
val arriveTime = DateTimeUtil.formatCalendarToString(beforeTime, DateTimeUtil.TAXI_HH_mm)
|
||||
System.err.println("------剩余公里$remainDis$disUnit----剩余分钟:$time------到达时间:$arriveTime")
|
||||
}else{
|
||||
System.err.println("速度----$speed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
configPage()
|
||||
@@ -99,6 +139,7 @@ class VideoActivity : AppCompatActivity() {
|
||||
}
|
||||
initListener()
|
||||
initData()
|
||||
LeftMenuOpen.registerCallback(callBack)
|
||||
}
|
||||
|
||||
private fun initConsultData(){
|
||||
@@ -289,6 +330,7 @@ class VideoActivity : AppCompatActivity() {
|
||||
OverlayLeftViewUtils.showOverlayView(this,isOpen = false, checkIndex = OverlayLeftViewUtils.MOVIE)
|
||||
}
|
||||
}
|
||||
FloatingDistanceInfoUtils.showOverlayView(this)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
@@ -336,8 +378,12 @@ class VideoActivity : AppCompatActivity() {
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
if(videotype!=VIDEOTYPE_CLOSE){
|
||||
LeftMenuOpen.unregisterCallback(callBack)
|
||||
}
|
||||
releaseOnNewInstance()
|
||||
OverlayLeftViewUtils.dismissOverlayView()
|
||||
OverlayLeftViewUtils.dismissOverlayView(false)
|
||||
FloatingDistanceInfoUtils.dismissOverlayView()
|
||||
FixMemoryLeak.fixLeak(this)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.och.taxi.passenger.utils;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AppOpsManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -8,6 +9,9 @@ import android.os.Build;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.mogo.eagle.core.network.utils.Util;
|
||||
import com.mogo.eagle.core.utilcode.util.Utils;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/12/7
|
||||
@@ -34,4 +38,25 @@ public class PermissionUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static String processName = "";
|
||||
public static String getCurProcessName() {
|
||||
if(!processName.isEmpty()){
|
||||
return processName;
|
||||
}
|
||||
// 获取此进程的标识符
|
||||
int pid = android.os.Process.myPid();
|
||||
// 获取活动管理器
|
||||
ActivityManager activityManager = (ActivityManager)
|
||||
Utils.getApp().getSystemService(Context.ACTIVITY_SERVICE);
|
||||
// 从应用程序进程列表找到当前进程,是:返回当前进程名
|
||||
for (ActivityManager.RunningAppProcessInfo appProcess :
|
||||
activityManager.getRunningAppProcesses()) {
|
||||
if (appProcess.pid == pid) {
|
||||
|
||||
return appProcess.processName;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/och_speed_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:bgColor="@color/taxi_p_map_bg"
|
||||
app:blurRadius="@dimen/dp_60"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:shadowColor="#80000000"
|
||||
app:shadowRadius="60px"
|
||||
app:shadow_position="outer"
|
||||
app:xOffset="0px"
|
||||
app:yOffset="0px"
|
||||
tools:visibility="visible">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_comment_contain"
|
||||
android:layout_width="@dimen/dp_230"
|
||||
android:layout_height="@dimen/dp_230"
|
||||
android:background="@drawable/bg_taxi_p_arrived_info"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_speed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="68"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
android:textSize="88px"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_speed_unit"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_speed_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="KM/h"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_speed" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/och_distance_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:bgColor="@color/taxi_p_map_bg"
|
||||
app:blurRadius="@dimen/dp_60"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/och_speed_layout"
|
||||
app:shadowColor="#80000000"
|
||||
app:shadowRadius="60px"
|
||||
app:shadow_position="outer"
|
||||
app:xOffset="0px"
|
||||
app:yOffset="0px"
|
||||
tools:visibility="visible">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_distance_contain"
|
||||
android:layout_width="@dimen/dp_230"
|
||||
android:layout_height="@dimen/dp_690"
|
||||
android:background="@drawable/bg_taxi_p_arrived_info"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_distancew"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="68"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
android:textSize="88px"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_distancew_unit"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_distancew_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="KM/h"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/v_second_floor"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_distancew" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v_second_floor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/taxi_order_status_textColor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintVertical_bias="0.333"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_surplus_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="68"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
android:textSize="88px"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_surplus_time_unit"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/v_second_floor" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_surplus_time_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="KM/h"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/v_third_floor"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_surplus_time" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v_third_floor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/taxi_order_status_textColor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintVertical_bias="0.666"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_arrived_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="68"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
android:textSize="88px"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_arrived_time_unit"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/v_third_floor" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_arrived_time_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="KM/h"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_arrived_time" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -137,7 +137,7 @@ public final class ProcessUtils {
|
||||
Set<String> set = new HashSet<>();
|
||||
if (info != null) {
|
||||
for (ActivityManager.RunningAppProcessInfo aInfo : info) {
|
||||
Collections.addAll(set, aInfo.pkgList);
|
||||
Collections.addAll(set, aInfo.processName);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
|
||||
Reference in New Issue
Block a user