[6.7.0] remove unuse code
@@ -1,495 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch
|
||||
|
||||
import android.animation.Animator
|
||||
import android.animation.AnimatorListenerAdapter
|
||||
import android.animation.ValueAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.res.Resources
|
||||
import android.graphics.PixelFormat
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.widget.FrameLayout
|
||||
import androidx.annotation.IdRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.view.GravityCompat
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.eagle.core.utilcode.util.ScreenUtils
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
|
||||
abstract class AbsLogView : ILogView, TouchProxy.OnTouchEventListener {
|
||||
|
||||
class ViewArgs {
|
||||
var edgePinned = false
|
||||
}
|
||||
|
||||
private val mInnerReceiver = InnerReceiver()
|
||||
|
||||
@JvmField
|
||||
protected var mWindowManager =
|
||||
ContextHolderUtil.getContext().getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
||||
|
||||
/**
|
||||
* 创建FrameLayout#LayoutParams 系统悬浮窗调用
|
||||
*/
|
||||
protected var systemLayoutParams: WindowManager.LayoutParams? = null
|
||||
|
||||
/**
|
||||
* 整个悬浮窗的View
|
||||
*/
|
||||
private var mRootView: FrameLayout? = null
|
||||
|
||||
/**
|
||||
* rootView的直接子View 一般是用户的xml布局 被添加到mRootView中
|
||||
*/
|
||||
private var mChildView: View? = null
|
||||
|
||||
val logView: View?
|
||||
get() = mRootView
|
||||
|
||||
/**
|
||||
* 手势代理
|
||||
*/
|
||||
@JvmField
|
||||
var mTouchProxy = TouchProxy(this)
|
||||
|
||||
private val viewProps = ViewArgs()
|
||||
|
||||
/**
|
||||
* 控件在布局边界发生大小变化被裁剪的原因
|
||||
*/
|
||||
val parentView: LogFrameLayout?
|
||||
get() = if (mRootView != null) {
|
||||
mRootView!!.parent as LogFrameLayout
|
||||
} else null
|
||||
|
||||
fun show(context: Context) {
|
||||
if (isShow) {
|
||||
return
|
||||
}
|
||||
performCreate(context)
|
||||
createView()
|
||||
onResume()
|
||||
}
|
||||
|
||||
fun dismiss() {
|
||||
removeView()
|
||||
performDestroy()
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行floatPage create
|
||||
*
|
||||
* @param context 上下文环境
|
||||
*/
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private fun performCreate(context: Context) {
|
||||
try {
|
||||
//调用onCreate方法
|
||||
onCreate(context)
|
||||
|
||||
//系统悬浮窗的返回按键监听
|
||||
mRootView = object : LogFrameLayout(context, LogFrameLayoutFlag_CHILD) {
|
||||
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
||||
if (event.action == KeyEvent.ACTION_UP && shouldDealBackKey()) {
|
||||
//监听返回键
|
||||
if (event.keyCode == KeyEvent.KEYCODE_BACK || event.keyCode == KeyEvent.KEYCODE_HOME) {
|
||||
return onBackPressed()
|
||||
}
|
||||
}
|
||||
return super.dispatchKeyEvent(event)
|
||||
}
|
||||
}
|
||||
//添加根布局的layout回调
|
||||
addViewTreeObserverListener()
|
||||
//调用onCreateView抽象方法
|
||||
mChildView = onCreateView(context, mRootView)
|
||||
//将子View添加到rootView中
|
||||
mRootView?.addView(mChildView)
|
||||
//设置根布局的手势拦截
|
||||
mRootView?.setOnTouchListener { v, event -> mTouchProxy.onTouchEvent(v, event) }
|
||||
//调用onViewCreated回调
|
||||
onViewCreated(mRootView)
|
||||
|
||||
mLogViewLayoutParams = LogViewLayoutParams()
|
||||
//分别创建对应的LayoutParams
|
||||
systemLayoutParams = WindowManager.LayoutParams()
|
||||
//shouldDealBackKey : false 不自己收返回事件处理
|
||||
if (shouldDealBackKey()) {
|
||||
//自己处理返回按键
|
||||
systemLayoutParams?.flags =
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
mLogViewLayoutParams.flags =
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or LogViewLayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
} else {
|
||||
//设置WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE会导致RootView监听不到返回按键的监听失效 系统处理返回按键
|
||||
systemLayoutParams?.flags =
|
||||
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
mLogViewLayoutParams.flags =
|
||||
LogViewLayoutParams.FLAG_NOT_FOCUSABLE or LogViewLayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
}
|
||||
systemLayoutParams?.apply {
|
||||
format = PixelFormat.TRANSPARENT
|
||||
gravity = Gravity.START or Gravity.TOP
|
||||
}
|
||||
mLogViewLayoutParams.gravity = GravityCompat.START or Gravity.TOP
|
||||
//动态注册关闭系统弹窗的广播
|
||||
val intentFilter = IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)
|
||||
context.registerReceiver(mInnerReceiver, intentFilter)
|
||||
initViewLayoutParams(mLogViewLayoutParams)
|
||||
onSystemLayoutParamsCreated()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun createView() {
|
||||
mWindowManager.addView(logView, systemLayoutParams)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
mRootView?.requestLayout()
|
||||
}
|
||||
|
||||
private fun removeView() {
|
||||
mWindowManager.removeView(logView)
|
||||
}
|
||||
|
||||
private fun performDestroy() {
|
||||
context?.unregisterReceiver(mInnerReceiver)
|
||||
//移除布局监听
|
||||
removeViewTreeObserverListener()
|
||||
mRootView = null
|
||||
onDestroy()
|
||||
}
|
||||
|
||||
/**
|
||||
* 用来保存rootView的LayoutParams
|
||||
*/
|
||||
private lateinit var mLogViewLayoutParams: LogViewLayoutParams
|
||||
|
||||
/**
|
||||
* 上一次LogView的位置信息
|
||||
*/
|
||||
private val mLastLogViewPosInfo: LastLogViewPosInfo = LastLogViewPosInfo()
|
||||
|
||||
/**
|
||||
* 根布局的实际宽
|
||||
*/
|
||||
private var mLogViewWidth = 0
|
||||
|
||||
/**
|
||||
* 根布局的实际高
|
||||
*/
|
||||
private var mLogViewHeight = 0
|
||||
|
||||
private var mViewTreeObserver: ViewTreeObserver? = null
|
||||
|
||||
private val mOnGlobalLayoutListener: ViewTreeObserver.OnGlobalLayoutListener =
|
||||
ViewTreeObserver.OnGlobalLayoutListener {
|
||||
//每次布局发生变动的时候重新赋值
|
||||
mRootView?.let {
|
||||
mLogViewWidth = it.measuredWidth
|
||||
mLogViewHeight = it.measuredHeight
|
||||
mLastLogViewPosInfo.logViewWidth = mLogViewWidth
|
||||
mLastLogViewPosInfo.logViewHeight = mLogViewHeight
|
||||
}
|
||||
}
|
||||
|
||||
private fun addViewTreeObserverListener() {
|
||||
if (mViewTreeObserver == null && mRootView != null) {
|
||||
mViewTreeObserver = mRootView!!.viewTreeObserver
|
||||
mViewTreeObserver?.addOnGlobalLayoutListener(mOnGlobalLayoutListener)
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeViewTreeObserverListener() {
|
||||
mViewTreeObserver?.let {
|
||||
if (it.isAlive) {
|
||||
it.removeOnGlobalLayoutListener(mOnGlobalLayoutListener)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定系统浮标的初始位置
|
||||
* LayoutParams创建完以后调用
|
||||
* 调用时建议放在实现下方
|
||||
*/
|
||||
private fun onSystemLayoutParamsCreated() {
|
||||
//如果有上一个页面的位置记录 这更新位置
|
||||
systemLayoutParams?.flags = mLogViewLayoutParams.flags
|
||||
systemLayoutParams?.gravity = mLogViewLayoutParams.gravity
|
||||
systemLayoutParams?.width = mLogViewLayoutParams.width
|
||||
systemLayoutParams?.height = mLogViewLayoutParams.height
|
||||
systemLayoutParams?.x = mLogViewLayoutParams.x
|
||||
systemLayoutParams?.y = mLogViewLayoutParams.y
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认实现为true
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun canDrag(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* 搭配shouldDealBackKey使用 自定义处理完以后需要返回true
|
||||
* 默认模式的onBackPressed 拦截在NormViewManager#getRootContentView中被处理
|
||||
* 系统模式下的onBackPressed 在当前类的performCreate 初始化View时被处理
|
||||
* 返回false 表示交由系统处理
|
||||
* 返回 true 表示当前的返回事件已由自己处理 并拦截了改返回事件
|
||||
*/
|
||||
override fun onBackPressed(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认不自己处理返回按键
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun shouldDealBackKey(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onEnterBackground() {
|
||||
mRootView?.let {
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onEnterForeground() {
|
||||
mRootView?.let {
|
||||
it.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMove(x: Int, y: Int, dx: Int, dy: Int) {
|
||||
if (!canDrag()) {
|
||||
return
|
||||
}
|
||||
systemLayoutParams?.apply {
|
||||
this.x += dx
|
||||
this.y += dy
|
||||
}
|
||||
//限制布局边界
|
||||
resetBorderline(systemLayoutParams)
|
||||
mWindowManager.updateViewLayout(mRootView, systemLayoutParams)
|
||||
}
|
||||
|
||||
/**
|
||||
* 限制边界 调用的时候必须保证是在控件能获取到宽高德前提下
|
||||
*/
|
||||
private fun resetBorderline(
|
||||
windowLayoutParams: WindowManager.LayoutParams?
|
||||
) {
|
||||
//如果是系统模式或者手动关闭动态限制边界
|
||||
if (!restrictBorderline()) {
|
||||
return
|
||||
}
|
||||
|
||||
if (windowLayoutParams != null) {
|
||||
|
||||
// 均是横向计算
|
||||
if (windowLayoutParams.y >= screenShortSideLength - mLogViewHeight) {
|
||||
windowLayoutParams.y = screenShortSideLength - mLogViewHeight
|
||||
}
|
||||
// 均是横向计算
|
||||
if (windowLayoutParams.x >= screenLongSideLength - mLogViewWidth) {
|
||||
windowLayoutParams.x = screenLongSideLength - mLogViewWidth
|
||||
}
|
||||
|
||||
//系统模式
|
||||
if (windowLayoutParams.y <= 0) {
|
||||
windowLayoutParams.y = 0
|
||||
}
|
||||
|
||||
if (windowLayoutParams.x <= 0) {
|
||||
windowLayoutParams.x = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手指弹起时保存当前浮标位置
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
*/
|
||||
override fun onUp(x: Int, y: Int) {
|
||||
if (!canDrag()) {
|
||||
return
|
||||
}
|
||||
if (!viewProps.edgePinned) {
|
||||
endMoveAndRecord()
|
||||
return
|
||||
}
|
||||
animatedMoveToEdge()
|
||||
}
|
||||
|
||||
private fun endMoveAndRecord() {
|
||||
systemLayoutParams?.let {
|
||||
mLastLogViewPosInfo.logViewWidth = it.x
|
||||
mLastLogViewPosInfo.logViewHeight = it.y
|
||||
}
|
||||
}
|
||||
|
||||
private fun animatedMoveToEdge() {
|
||||
val viewSize = mRootView?.width ?: return
|
||||
systemLayoutParams?.also { layoutAttrs ->
|
||||
makeAnimator(layoutAttrs.x, viewSize, ViewGroup.LayoutParams.MATCH_PARENT) {
|
||||
addUpdateListener { v ->
|
||||
layoutAttrs.x = v.animatedValue as Int
|
||||
mWindowManager.updateViewLayout(mRootView, layoutAttrs)
|
||||
}
|
||||
addListener(object : AnimatorListenerAdapter() {
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
endMoveAndRecord()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun makeAnimator(
|
||||
from: Int,
|
||||
size: Int,
|
||||
containerSize: Int,
|
||||
setup: ValueAnimator.() -> Unit
|
||||
) {
|
||||
if (size <= 0 || containerSize <= 0) return
|
||||
ValueAnimator.ofInt(
|
||||
from,
|
||||
if (from <= (containerSize - size) / 2) 0 else (containerSize - size)
|
||||
)
|
||||
.apply {
|
||||
duration = 150L
|
||||
setup()
|
||||
}
|
||||
.start()
|
||||
}
|
||||
|
||||
/**
|
||||
* 手指按下时的操作
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
*/
|
||||
override fun onDown(x: Int, y: Int) {
|
||||
if (!canDrag()) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* home键被点击 只有系统悬浮窗控件才会被调用
|
||||
*/
|
||||
open fun onHomeKeyPress() {}
|
||||
|
||||
/**
|
||||
* 菜单键被点击 只有系统悬浮窗控件才会被调用
|
||||
*/
|
||||
open fun onRecentAppKeyPress() {}
|
||||
|
||||
override fun onPause() {}
|
||||
|
||||
/**
|
||||
* 系统悬浮窗需要调用
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
val context: Context?
|
||||
get() = if (mRootView != null) {
|
||||
mRootView!!.context
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
val resources: Resources?
|
||||
get() = if (context == null) {
|
||||
null
|
||||
} else context!!.resources
|
||||
|
||||
fun getString(@StringRes resId: Int): String? {
|
||||
return if (context == null) {
|
||||
null
|
||||
} else context!!.getString(resId)
|
||||
}
|
||||
|
||||
private val isShow: Boolean
|
||||
get() = mRootView?.isShown ?: false
|
||||
|
||||
protected fun <T : View> findViewById(@IdRes id: Int): T? {
|
||||
if (mRootView == null) {
|
||||
return null
|
||||
}
|
||||
return mRootView?.findViewById(id)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否限制布局边界
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
open fun restrictBorderline(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取屏幕短边的长度(横屏) 不包含statusBar
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private val screenShortSideLength: Int
|
||||
get() = ScreenUtils.getAppScreenHeight()
|
||||
|
||||
/**
|
||||
* 获取屏幕长边的长度(横屏) 不包含statusBar
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private val screenLongSideLength: Int
|
||||
get() = ScreenUtils.getAppScreenWidth()
|
||||
|
||||
/**
|
||||
* 强制刷新当前view
|
||||
*/
|
||||
open fun immInvalidate() {
|
||||
mRootView?.requestLayout()
|
||||
}
|
||||
|
||||
/**
|
||||
* 广播接收器 系统悬浮窗需要调用
|
||||
*/
|
||||
private inner class InnerReceiver : BroadcastReceiver() {
|
||||
|
||||
private val SYSTEM_DIALOG_REASON_KEY = "reason"
|
||||
private val SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps"
|
||||
private val SYSTEM_DIALOG_REASON_HOME_KEY = "homekey"
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
val action = intent.action
|
||||
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS == action) {
|
||||
val reason = intent.getStringExtra(SYSTEM_DIALOG_REASON_KEY)
|
||||
if (reason != null) {
|
||||
if (reason == SYSTEM_DIALOG_REASON_HOME_KEY) {
|
||||
//点击home键
|
||||
onHomeKeyPress()
|
||||
} else if (reason == SYSTEM_DIALOG_REASON_RECENT_APPS) {
|
||||
//点击menu按钮
|
||||
onRecentAppKeyPress()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 内置一个List的通用、简化的适用于RecyclerView的Adapter。
|
||||
*/
|
||||
public abstract class AbsRecyclerAdapter<T extends AbsViewBinder, V> extends RecyclerView.Adapter<T> {
|
||||
protected List<V> mList;
|
||||
private LayoutInflater mInflater;
|
||||
protected Context mContext;
|
||||
|
||||
public AbsRecyclerAdapter(Context context) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
mContext = context;
|
||||
mList = new ArrayList<>();
|
||||
mInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public final T onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = createView(mInflater, parent, viewType);
|
||||
return createViewHolder(view, viewType);
|
||||
}
|
||||
|
||||
protected abstract T createViewHolder(View view, int viewType);
|
||||
|
||||
/**
|
||||
* 如果是通过LayoutInflater创建的View,不要绑定到父View,RecyclerView会负责添加。
|
||||
*/
|
||||
protected abstract View createView(LayoutInflater inflater, ViewGroup parent, int viewType);
|
||||
|
||||
@Override
|
||||
public final void onBindViewHolder(T holder, int position) {
|
||||
V data = mList.get(position);
|
||||
holder.setData(data);
|
||||
holder.bind(data, position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表末尾追加一个元素
|
||||
*/
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public void append(V item) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
mList.add(item);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* 在特定位置增加一个元素
|
||||
*/
|
||||
public void append(V item, int position) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
if (position < 0) {
|
||||
position = 0;
|
||||
} else if (position > mList.size()) {
|
||||
position = mList.size();
|
||||
}
|
||||
mList.add(position, item);
|
||||
notifyItemChanged(position, item);
|
||||
}
|
||||
|
||||
/**
|
||||
* 追加一个集合
|
||||
*/
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public final void append(Collection<V> items) {
|
||||
if (items == null || items.size() == 0) {
|
||||
return;
|
||||
}
|
||||
mList.addAll(items);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空集合
|
||||
*/
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public final void clear() {
|
||||
if (mList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
mList.clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除一个元素
|
||||
*/
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public final void remove(V item) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
if (mList.contains(item)) {
|
||||
mList.remove(item);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除一个元素
|
||||
*/
|
||||
public final void remove(int index) {
|
||||
if (index < mList.size()) {
|
||||
mList.remove(index);
|
||||
notifyItemRemoved(index);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除一个集合
|
||||
*/
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public final void remove(Collection<V> items) {
|
||||
if (items == null || items.size() == 0) {
|
||||
return;
|
||||
}
|
||||
if (mList.removeAll(items)) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 简单封装的适用于RecyclerView的ViewHolder
|
||||
*/
|
||||
public abstract class AbsViewBinder<T> extends RecyclerView.ViewHolder {
|
||||
private T data;
|
||||
|
||||
private View mView;
|
||||
|
||||
public AbsViewBinder(final View view) {
|
||||
super(view);
|
||||
mView = view;
|
||||
getViews();
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onViewClick(view, data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected final View getView() {
|
||||
return mView;
|
||||
}
|
||||
|
||||
protected abstract void getViews();
|
||||
|
||||
public final <V extends View> V getView(@IdRes int id) {
|
||||
return (V) mView.findViewById(id);
|
||||
}
|
||||
|
||||
public abstract void bind(T t);
|
||||
|
||||
public void bind(T t, int position) {
|
||||
bind(t);
|
||||
}
|
||||
|
||||
protected void onViewClick(View view, T data) {
|
||||
}
|
||||
|
||||
protected final void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
protected final Context getContext() {
|
||||
return mView.getContext();
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
|
||||
interface ILogView {
|
||||
/**
|
||||
* view 创建时调用 做一些变量的初始化 当还不能进行View的操作
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
fun onCreate(context: Context?)
|
||||
|
||||
/**
|
||||
* 传入rootView 用于创建控件
|
||||
*
|
||||
* @param context
|
||||
* @param rootView
|
||||
* @return 返回创建的childView
|
||||
*/
|
||||
fun onCreateView(context: Context?, rootView: FrameLayout?): View?
|
||||
|
||||
/**
|
||||
* 将xml中的控件添加到rootView以后调用,在当前方法中可以进行view的一些操作
|
||||
*
|
||||
* @param rootView
|
||||
*/
|
||||
fun onViewCreated(rootView: FrameLayout?)
|
||||
|
||||
/**
|
||||
* 当前的View添加到根布局里时调用
|
||||
*/
|
||||
fun onResume()
|
||||
|
||||
/**
|
||||
* 当前activity onPause时调用
|
||||
*/
|
||||
fun onPause()
|
||||
|
||||
/**
|
||||
* 确定系统悬浮窗浮标的初始位置
|
||||
* LayoutParams创建完以后调用
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
fun initViewLayoutParams(params: LogViewLayoutParams?)
|
||||
|
||||
/**
|
||||
* app进入后台时调用 内置View 不需要实现
|
||||
*/
|
||||
fun onEnterBackground()
|
||||
|
||||
/**
|
||||
* app回到前台时调用 内置view 不需要实现
|
||||
*/
|
||||
fun onEnterForeground()
|
||||
|
||||
/**
|
||||
* 浮标控件是否可以拖动
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
fun canDrag(): Boolean
|
||||
|
||||
/**
|
||||
* 是否需要自己处理返回键
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
fun shouldDealBackKey(): Boolean
|
||||
|
||||
/**
|
||||
* shouldDealBackKey == true 时调用
|
||||
*/
|
||||
fun onBackPressed(): Boolean
|
||||
|
||||
/**
|
||||
* 悬浮窗主动销毁时调用 不能在当前生命周期回调函数中调用 detach自己 否则会出现死循环
|
||||
*/
|
||||
fun onDestroy()
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch
|
||||
|
||||
interface ILogViewListener {
|
||||
fun onAttach()
|
||||
fun onDetach()
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch
|
||||
|
||||
import com.mogo.eagle.core.utilcode.util.ScreenUtils
|
||||
|
||||
/**
|
||||
* 保存上一次LogView的位置信息
|
||||
*/
|
||||
class LastLogViewPosInfo {
|
||||
var logViewWidth = 0
|
||||
var logViewHeight = 0
|
||||
var leftMarginPercent = 0f
|
||||
private set
|
||||
var topMarginPercent = 0f
|
||||
private set
|
||||
|
||||
fun setLeftMargin(leftMargin: Int) {
|
||||
leftMarginPercent = leftMargin.toFloat() / ScreenUtils.getAppScreenWidth().toFloat()
|
||||
}
|
||||
|
||||
fun setTopMargin(topMargin: Int) {
|
||||
topMarginPercent = topMargin.toFloat() / ScreenUtils.getAppScreenHeight().toFloat()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "LastLogViewPosInfo{" +
|
||||
", leftMarginPercent=" + leftMarginPercent +
|
||||
", topMarginPercent=" + topMarginPercent +
|
||||
'}'
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.widget.FrameLayout
|
||||
|
||||
open class LogFrameLayout : FrameLayout {
|
||||
private var mFlag = LogFrameLayoutFlag_ROOT
|
||||
|
||||
constructor(context: Context, flag: Int) : super(context) {
|
||||
mFlag = flag
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {}
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val LogFrameLayoutFlag_ROOT = 100
|
||||
const val LogFrameLayoutFlag_CHILD = 200
|
||||
}
|
||||
}
|
||||
@@ -1,286 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.*
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import java.util.*
|
||||
|
||||
class LogInfoView : AbsLogView() {
|
||||
|
||||
companion object {
|
||||
const val MAX_LOG_LINE_NUM = 10000
|
||||
const val UPDATE_CHECK_INTERVAL = 200
|
||||
}
|
||||
|
||||
private var logLines = LinkedList<LogLine>()
|
||||
private var counter = 0
|
||||
private var mAutoScrollToBottom = true
|
||||
private var mIsLoaded = false
|
||||
|
||||
private var mLogRv: RecyclerView? = null
|
||||
private var mLogItemAdapter: LogItemAdapter? = null
|
||||
private var mLogFilter: EditText? = null
|
||||
private var mRadioGroup: RadioGroup? = null
|
||||
private var mLinearLayout: LinearLayout? = null
|
||||
|
||||
/**
|
||||
* 单行的log
|
||||
*/
|
||||
private var mLogHint: TextView? = null
|
||||
private var mLogRvWrap: RelativeLayout? = null
|
||||
|
||||
private var logViewListener: ILogViewListener? = null
|
||||
|
||||
override fun onCreate(context: Context?) {}
|
||||
override fun onCreateView(context: Context?, rootView: FrameLayout?): View? {
|
||||
return LayoutInflater.from(context).inflate(R.layout.log_view, rootView, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(rootView: FrameLayout?) {
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
mLogHint = findViewById(R.id.log_hint)
|
||||
mLogRvWrap = findViewById(R.id.log_page)
|
||||
mLogRv = findViewById(R.id.log_list)
|
||||
mLogRv!!.layoutManager = LinearLayoutManager(context)
|
||||
mLogItemAdapter = LogItemAdapter(context!!)
|
||||
mLogRv!!.adapter = mLogItemAdapter
|
||||
mLogFilter = findViewById(R.id.log_filter)
|
||||
mLogFilter!!.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
|
||||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
|
||||
override fun afterTextChanged(s: Editable) {
|
||||
mLogItemAdapter!!.filter.filter(s)
|
||||
}
|
||||
})
|
||||
val mTitleBar = findViewById<LogTitleBar>(R.id.title_bar)
|
||||
mTitleBar!!.setListener(object : LogTitleBar.OnTitleBarClickListener {
|
||||
override fun onRightClick() {
|
||||
if (logViewListener != null) {
|
||||
logViewListener!!.onDetach()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLeftClick() {
|
||||
minimize()
|
||||
}
|
||||
})
|
||||
mLogHint!!.setOnClickListener { v: View? -> maximize() }
|
||||
mRadioGroup = findViewById(R.id.radio_group)
|
||||
mRadioGroup!!.setOnCheckedChangeListener { group: RadioGroup?, checkedId: Int ->
|
||||
when (checkedId) {
|
||||
R.id.verbose -> {
|
||||
mLogItemAdapter!!.logLevelLimit = Log.VERBOSE
|
||||
}
|
||||
R.id.debug -> {
|
||||
mLogItemAdapter!!.logLevelLimit = Log.DEBUG
|
||||
}
|
||||
R.id.info -> {
|
||||
mLogItemAdapter!!.logLevelLimit = Log.INFO
|
||||
}
|
||||
R.id.warn -> {
|
||||
mLogItemAdapter!!.logLevelLimit = Log.WARN
|
||||
}
|
||||
R.id.error -> {
|
||||
mLogItemAdapter!!.logLevelLimit = Log.ERROR
|
||||
}
|
||||
}
|
||||
mLogItemAdapter!!.filter.filter(mLogFilter!!.text)
|
||||
}
|
||||
mLogRv!!.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
||||
super.onScrollStateChanged(recyclerView, newState)
|
||||
}
|
||||
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
val layoutManager = recyclerView.layoutManager as LinearLayoutManager?
|
||||
// if the bottom of the list isn't visible anymore, then stop autoscrolling
|
||||
mAutoScrollToBottom =
|
||||
layoutManager!!.findLastCompletelyVisibleItemPosition() == recyclerView.adapter!!
|
||||
.itemCount - 1
|
||||
}
|
||||
})
|
||||
mRadioGroup!!.check(R.id.verbose)
|
||||
val mBtnTop = findViewById<Button>(R.id.btn_top)
|
||||
val mBtnBottom = findViewById<Button>(R.id.btn_bottom)
|
||||
val mBtnClean = findViewById<Button>(R.id.btn_clean)
|
||||
val mBtnExport = findViewById<Button>(R.id.btn_export)
|
||||
mBtnTop!!.setOnClickListener {
|
||||
if (mLogItemAdapter == null || mLogItemAdapter!!.itemCount == 0) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
mLogRv!!.scrollToPosition(0)
|
||||
}
|
||||
mBtnBottom!!.setOnClickListener {
|
||||
if (mLogItemAdapter == null || mLogItemAdapter!!.itemCount == 0) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
mLogRv!!.scrollToPosition(mLogItemAdapter!!.itemCount - 1)
|
||||
}
|
||||
mBtnExport!!.setOnClickListener { }
|
||||
mBtnClean!!.setOnClickListener {
|
||||
if (mLogItemAdapter == null || mLogItemAdapter!!.itemCount == 0) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
counter = 0
|
||||
mLogItemAdapter!!.clearLog()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (logViewListener != null) {
|
||||
logViewListener!!.onAttach()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onEnterForeground() {
|
||||
super.onEnterForeground()
|
||||
parentView?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onEnterBackground() {
|
||||
super.onEnterBackground()
|
||||
parentView?.visibility = View.GONE
|
||||
}
|
||||
|
||||
fun registerLogViewListener(listener: ILogViewListener?) {
|
||||
logViewListener = listener
|
||||
}
|
||||
|
||||
fun unRegisterLogViewListener() {
|
||||
logViewListener = null
|
||||
}
|
||||
|
||||
override fun initViewLayoutParams(params: LogViewLayoutParams?) {
|
||||
params!!.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
params.width = LogViewLayoutParams.MATCH_PARENT
|
||||
params.height = LogViewLayoutParams.MATCH_PARENT
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun onLogCatch(lineLog: String) {
|
||||
if (mLogRv == null || mLogItemAdapter == null) {
|
||||
return
|
||||
}
|
||||
if (!mIsLoaded) {
|
||||
mIsLoaded = true
|
||||
mLinearLayout = findViewById(R.id.ll_loading)
|
||||
mLinearLayout!!.visibility = View.GONE
|
||||
mLogRv!!.visibility = View.VISIBLE
|
||||
}
|
||||
val logLine = LogLine.newLogLine(lineLog, false)
|
||||
if (logLines.size > MAX_LOG_LINE_NUM) {
|
||||
logLines.removeFirst()
|
||||
}
|
||||
logLines.add(logLine)
|
||||
if (logLines.size == 1) {
|
||||
mLogItemAdapter!!.addWithFilter(logLines[0], mLogFilter?.text, true)
|
||||
} else {
|
||||
mLogItemAdapter!!.addWithFilter(logLine, mLogFilter?.text, false)
|
||||
mLogItemAdapter!!.notifyDataSetChanged()
|
||||
}
|
||||
if (logLines.size > 0) {
|
||||
val line = logLines[logLines.size - 1]
|
||||
"${line.tag} : ${line.logOutput}".also { mLogHint?.text = it }
|
||||
}
|
||||
if (++counter % UPDATE_CHECK_INTERVAL == 0
|
||||
&& mLogItemAdapter!!.trueValues.size > MAX_LOG_LINE_NUM
|
||||
) {
|
||||
val numItemsToRemove = mLogItemAdapter!!.trueValues.size - MAX_LOG_LINE_NUM
|
||||
mLogItemAdapter!!.removeFirst(numItemsToRemove)
|
||||
}
|
||||
if (mAutoScrollToBottom) {
|
||||
scrollToBottom()
|
||||
}
|
||||
}
|
||||
|
||||
private fun scrollToBottom() {
|
||||
mLogRv!!.scrollToPosition(mLogItemAdapter!!.itemCount - 1)
|
||||
}
|
||||
|
||||
private val selectLogLevel: Int
|
||||
get() {
|
||||
return when (mRadioGroup!!.checkedRadioButtonId) {
|
||||
R.id.verbose -> {
|
||||
Log.VERBOSE
|
||||
}
|
||||
R.id.debug -> {
|
||||
Log.DEBUG
|
||||
}
|
||||
R.id.info -> {
|
||||
Log.INFO
|
||||
}
|
||||
R.id.warn -> {
|
||||
Log.WARN
|
||||
}
|
||||
R.id.error -> {
|
||||
Log.ERROR
|
||||
}
|
||||
else -> {
|
||||
Log.VERBOSE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 最小化
|
||||
*/
|
||||
fun minimize() {
|
||||
isMaximize = false
|
||||
mLogHint!!.visibility = View.VISIBLE
|
||||
mLogRvWrap!!.visibility = View.GONE
|
||||
val layoutParams = systemLayoutParams ?: return
|
||||
layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
layoutParams.gravity = Gravity.START or Gravity.TOP
|
||||
mWindowManager.updateViewLayout(logView, layoutParams)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否最大化
|
||||
*/
|
||||
private var isMaximize = true
|
||||
private fun maximize() {
|
||||
isMaximize = true
|
||||
mLogHint!!.visibility = View.GONE
|
||||
mLogRvWrap!!.visibility = View.VISIBLE
|
||||
val layoutParams = systemLayoutParams ?: return
|
||||
layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
layoutParams.height = WindowManager.LayoutParams.MATCH_PARENT
|
||||
layoutParams.gravity = Gravity.START or Gravity.TOP
|
||||
mWindowManager.updateViewLayout(logView, layoutParams)
|
||||
}
|
||||
|
||||
override fun onBackPressed(): Boolean {
|
||||
return if (isMaximize) {
|
||||
minimize()
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
override fun shouldDealBackKey(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun canDrag(): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -1,255 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.SearchCriteria;
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.TagColorUtil;
|
||||
|
||||
public class LogItemAdapter extends AbsRecyclerAdapter<AbsViewBinder<LogLine>, LogLine> implements Filterable {
|
||||
|
||||
public LogItemAdapter(Context context) {
|
||||
super(context);
|
||||
mClipboard = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);
|
||||
}
|
||||
|
||||
private ArrayList<LogLine> mOriginalValues = new ArrayList<>();
|
||||
private final ArrayFilter mFilter = new ArrayFilter();
|
||||
private int logLevelLimit = Log.VERBOSE;
|
||||
private final ClipboardManager mClipboard;
|
||||
|
||||
/**
|
||||
* 清空log
|
||||
*/
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public void clearLog() {
|
||||
if (mOriginalValues != null && mOriginalValues.size() > 0) {
|
||||
mOriginalValues.clear();
|
||||
}
|
||||
clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbsViewBinder<LogLine> createViewHolder(View view, int viewType) {
|
||||
return new LogInfoViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View createView(LayoutInflater inflater, ViewGroup parent, int viewType) {
|
||||
return inflater.inflate(R.layout.item_log, parent, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filter getFilter() {
|
||||
return mFilter;
|
||||
}
|
||||
|
||||
public int getLogLevelLimit() {
|
||||
return logLevelLimit;
|
||||
}
|
||||
|
||||
public void setLogLevelLimit(int logLevelLimit) {
|
||||
this.logLevelLimit = logLevelLimit;
|
||||
}
|
||||
|
||||
public List<LogLine> getTrueValues() {
|
||||
return mOriginalValues != null ? mOriginalValues : mList;
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public void removeFirst(int n) {
|
||||
if (mOriginalValues != null) {
|
||||
List<LogLine> subList = mOriginalValues.subList(n, mOriginalValues.size());
|
||||
for (int i = 0; i < n; i++) {
|
||||
// value to delete - delete it from the mObjects as well
|
||||
mList.remove(mOriginalValues.get(i));
|
||||
}
|
||||
mOriginalValues = new ArrayList<>(subList);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public class LogInfoViewHolder extends AbsViewBinder<LogLine> {
|
||||
|
||||
private TextView mLogText;
|
||||
private TextView mPid;
|
||||
private TextView mTime;
|
||||
private TextView mTag;
|
||||
private TextView mLevel;
|
||||
|
||||
public LogInfoViewHolder(View view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getViews() {
|
||||
mLogText = getView(R.id.log_output_text);
|
||||
mLevel = getView(R.id.log_level_text);
|
||||
mPid = getView(R.id.pid_text);
|
||||
mTime = getView(R.id.timestamp_text);
|
||||
mTag = getView(R.id.tag_text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onViewClick(View view, final LogLine data) {
|
||||
super.onViewClick(view, data);
|
||||
data.setExpanded(!data.isExpanded());
|
||||
if (data.isExpanded() && data.getProcessId() != -1) {
|
||||
mLogText.setSingleLine(false);
|
||||
mTime.setVisibility(View.VISIBLE);
|
||||
mPid.setVisibility(View.VISIBLE);
|
||||
view.setBackgroundColor(Color.BLACK);
|
||||
mLogText.setTextColor(TagColorUtil.getTextColor(getContext(), data.getLogLevel(), true));
|
||||
mTag.setTextColor(TagColorUtil.getTextColor(getContext(), data.getLogLevel(), true));
|
||||
} else {
|
||||
mLogText.setSingleLine(true);
|
||||
mTime.setVisibility(View.GONE);
|
||||
mPid.setVisibility(View.GONE);
|
||||
view.setBackgroundColor(Color.WHITE);
|
||||
mLogText.setTextColor(TagColorUtil.getTextColor(getContext(), data.getLogLevel(), false));
|
||||
mTag.setTextColor(TagColorUtil.getTextColor(getContext(), data.getLogLevel(), false));
|
||||
}
|
||||
itemView.setOnLongClickListener(v -> {
|
||||
ClipData clipData = ClipData.newPlainText("Label", data.getOriginalLine());
|
||||
mClipboard.setPrimaryClip(clipData);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(LogLine item) {
|
||||
|
||||
mLevel.setText(item.getLogLevelText());
|
||||
mLevel.setTextColor(TagColorUtil.getLevelColor(getContext(), item.getLogLevel()));
|
||||
mLevel.setBackgroundColor(TagColorUtil.getLevelBgColor(getContext(), item.getLogLevel()));
|
||||
|
||||
mPid.setText(String.valueOf(item.getProcessId()));
|
||||
mTime.setText(item.getTimestamp());
|
||||
|
||||
mLogText.setText(item.getLogOutput());
|
||||
|
||||
mTag.setText(item.getTag());
|
||||
|
||||
if (item.isExpanded() && item.getProcessId() != -1) {
|
||||
mLogText.setSingleLine(false);
|
||||
mTime.setVisibility(View.VISIBLE);
|
||||
mPid.setVisibility(View.VISIBLE);
|
||||
mLogText.setTextColor(TagColorUtil.getTextColor(getContext(), item.getLogLevel(), true));
|
||||
mTag.setTextColor(TagColorUtil.getTextColor(getContext(), item.getLogLevel(), true));
|
||||
itemView.setBackgroundColor(Color.BLACK);
|
||||
} else {
|
||||
mLogText.setSingleLine(true);
|
||||
mTime.setVisibility(View.GONE);
|
||||
mPid.setVisibility(View.GONE);
|
||||
itemView.setBackgroundColor(Color.WHITE);
|
||||
mLogText.setTextColor(TagColorUtil.getTextColor(getContext(), item.getLogLevel(), false));
|
||||
mTag.setTextColor(TagColorUtil.getTextColor(getContext(), item.getLogLevel(), false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加日志到adapter中
|
||||
*/
|
||||
public void addWithFilter(LogLine logObj, CharSequence text, boolean notify) {
|
||||
|
||||
if (mOriginalValues != null) {
|
||||
|
||||
List<LogLine> inputList = Collections.singletonList(logObj);
|
||||
|
||||
List<LogLine> filteredObjects = mFilter.performFilteringOnList(inputList, text);
|
||||
|
||||
mOriginalValues.add(logObj);
|
||||
|
||||
mList.addAll(filteredObjects);
|
||||
if (notify) {
|
||||
notifyItemRangeInserted(mList.size() - filteredObjects.size(), filteredObjects.size());
|
||||
}
|
||||
} else {
|
||||
mList.add(logObj);
|
||||
if (notify) {
|
||||
notifyItemInserted(mList.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ArrayFilter extends Filter {
|
||||
@Override
|
||||
protected FilterResults performFiltering(CharSequence prefix) {
|
||||
FilterResults results = new FilterResults();
|
||||
|
||||
|
||||
ArrayList<LogLine> allValues = performFilteringOnList(mOriginalValues, prefix);
|
||||
|
||||
results.values = allValues;
|
||||
results.count = allValues.size();
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
public ArrayList<LogLine> performFilteringOnList(List<LogLine> inputList, CharSequence query) {
|
||||
|
||||
SearchCriteria searchCriteria = new SearchCriteria(query);
|
||||
|
||||
// search by log level
|
||||
ArrayList<LogLine> allValues = new ArrayList<>();
|
||||
|
||||
ArrayList<LogLine> logLines = new ArrayList<>(inputList);
|
||||
|
||||
|
||||
for (LogLine logLine : logLines) {
|
||||
if (logLine != null && logLine.getLogLevel() >= logLevelLimit) {
|
||||
allValues.add(logLine);
|
||||
}
|
||||
}
|
||||
ArrayList<LogLine> finalValues = allValues;
|
||||
|
||||
// search by criteria
|
||||
if (!searchCriteria.isEmpty()) {
|
||||
|
||||
final int count = allValues.size();
|
||||
|
||||
final ArrayList<LogLine> newValues = new ArrayList<>(count);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
final LogLine value = allValues.get(i);
|
||||
// search the logLine based on the criteria
|
||||
if (searchCriteria.matches(value)) {
|
||||
newValues.add(value);
|
||||
}
|
||||
}
|
||||
|
||||
finalValues = newValues;
|
||||
}
|
||||
|
||||
return finalValues;
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||
//noinspection unchecked
|
||||
mList = (List<LogLine>) results.values;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,203 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class LogLine {
|
||||
|
||||
private static final int TIMESTAMP_LENGTH = 19;
|
||||
|
||||
private static final Pattern logPattern = Pattern.compile(
|
||||
// log level
|
||||
"(\\w)" +
|
||||
"/" +
|
||||
// tag
|
||||
"([^(]+)" +
|
||||
"\\(\\s*" +
|
||||
// pid
|
||||
"(\\d+)" +
|
||||
// optional weird number that only occurs on ZTE blade
|
||||
"(?:\\*\\s*\\d+)?" +
|
||||
"\\): ");
|
||||
|
||||
private static final String filterPattern = "ResourceType|memtrack|android.os.Debug|BufferItemConsumer|DPM.*|MDM.*|ChimeraUtils|BatteryExternalStats.*|chatty.*|DisplayPowerController|WidgetHelper|WearableService|DigitalWidget.*|^ANDR-PERF-.*";
|
||||
private static final String failPattern = "(^maxLineHeight.*)|(Failed to read.*)";
|
||||
private int logLevel;
|
||||
private String tag;
|
||||
private String logOutput;
|
||||
private int processId = -1;
|
||||
private String timestamp;
|
||||
private boolean expanded = false;
|
||||
private boolean highlighted = false;
|
||||
|
||||
public static LogLine newLogLine(String originalLine, boolean expanded) {
|
||||
|
||||
LogLine logLine = new LogLine();
|
||||
logLine.setExpanded(expanded);
|
||||
|
||||
int startIdx = 0;
|
||||
|
||||
// if the first char is a digit, then this starts out with a timestamp
|
||||
// otherwise, it's a legacy log or the beginning of the log output or something
|
||||
if (!TextUtils.isEmpty(originalLine)
|
||||
&& Character.isDigit(originalLine.charAt(0))
|
||||
&& originalLine.length() >= TIMESTAMP_LENGTH) {
|
||||
String timestamp = originalLine.substring(0, TIMESTAMP_LENGTH - 1);
|
||||
logLine.setTimestamp(timestamp);
|
||||
// cut off timestamp
|
||||
startIdx = TIMESTAMP_LENGTH;
|
||||
}
|
||||
|
||||
Matcher matcher = logPattern.matcher(originalLine);
|
||||
|
||||
if (matcher.find(startIdx)) {
|
||||
char logLevelChar = matcher.group(1).charAt(0);
|
||||
|
||||
String logText = originalLine.substring(matcher.end());
|
||||
if (logText.matches(failPattern)) {
|
||||
logLine.setLogLevel(convertCharToLogLevel('V'));
|
||||
} else {
|
||||
logLine.setLogLevel(convertCharToLogLevel(logLevelChar));
|
||||
}
|
||||
|
||||
String tagText = matcher.group(2);
|
||||
if (tagText.matches(filterPattern)) {
|
||||
logLine.setLogLevel(convertCharToLogLevel('V'));
|
||||
}
|
||||
|
||||
logLine.setTag(tagText);
|
||||
logLine.setProcessId(Integer.parseInt(matcher.group(3)));
|
||||
|
||||
logLine.setLogOutput(logText);
|
||||
|
||||
} else {
|
||||
logLine.setLogOutput(originalLine);
|
||||
logLine.setLogLevel(-1);
|
||||
}
|
||||
|
||||
return logLine;
|
||||
|
||||
}
|
||||
|
||||
private static int convertCharToLogLevel(char logLevelChar) {
|
||||
|
||||
switch (logLevelChar) {
|
||||
case 'D':
|
||||
return Log.DEBUG;
|
||||
case 'E':
|
||||
return Log.ERROR;
|
||||
case 'I':
|
||||
return Log.INFO;
|
||||
case 'V':
|
||||
case 'F':
|
||||
return Log.VERBOSE;
|
||||
case 'W':
|
||||
return Log.WARN;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private static char convertLogLevelToChar(int logLevel) {
|
||||
|
||||
switch (logLevel) {
|
||||
case Log.DEBUG:
|
||||
return 'D';
|
||||
case Log.ERROR:
|
||||
return 'E';
|
||||
case Log.INFO:
|
||||
return 'I';
|
||||
case Log.VERBOSE:
|
||||
return 'V';
|
||||
case Log.WARN:
|
||||
return 'W';
|
||||
}
|
||||
return ' ';
|
||||
}
|
||||
|
||||
public String getOriginalLine() {
|
||||
|
||||
if (logLevel == -1) { // starter line like "begin of log etc. etc."
|
||||
return logOutput;
|
||||
}
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
if (timestamp != null) {
|
||||
stringBuilder.append(timestamp).append(' ');
|
||||
}
|
||||
|
||||
stringBuilder.append(convertLogLevelToChar(logLevel))
|
||||
.append('/')
|
||||
.append(tag)
|
||||
.append('(')
|
||||
.append(processId)
|
||||
.append("): ")
|
||||
.append(logOutput);
|
||||
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
public String getLogLevelText() {
|
||||
return Character.toString(convertLogLevelToChar(logLevel));
|
||||
}
|
||||
|
||||
public int getLogLevel() {
|
||||
return logLevel;
|
||||
}
|
||||
|
||||
public void setLogLevel(int logLevel) {
|
||||
this.logLevel = logLevel;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public String getLogOutput() {
|
||||
return logOutput;
|
||||
}
|
||||
|
||||
public void setLogOutput(String logOutput) {
|
||||
this.logOutput = logOutput;
|
||||
}
|
||||
|
||||
public int getProcessId() {
|
||||
return processId;
|
||||
}
|
||||
|
||||
public void setProcessId(int processId) {
|
||||
this.processId = processId;
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public boolean isExpanded() {
|
||||
return expanded;
|
||||
}
|
||||
|
||||
public void setExpanded(boolean expanded) {
|
||||
this.expanded = expanded;
|
||||
}
|
||||
|
||||
public boolean isHighlighted() {
|
||||
return highlighted;
|
||||
}
|
||||
|
||||
public void setHighlighted(boolean highlighted) {
|
||||
this.highlighted = highlighted;
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
/**
|
||||
* 日志专属TitleBar
|
||||
*/
|
||||
public class LogTitleBar extends FrameLayout {
|
||||
private OnTitleBarClickListener mListener;
|
||||
private TextView mBack;
|
||||
private TextView mTitle;
|
||||
private ImageView mIcon;
|
||||
|
||||
public LogTitleBar(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public LogTitleBar(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public LogTitleBar(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init(context, attrs);
|
||||
}
|
||||
|
||||
private void init(Context context, AttributeSet attrs) {
|
||||
LayoutInflater.from(context).inflate(R.layout.log_title_bar, this, true);
|
||||
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.LogTitleBar);
|
||||
int icon = a.getResourceId(R.styleable.LogTitleBar_Icon, 0);
|
||||
String title = a.getString(R.styleable.LogTitleBar_Title);
|
||||
String back = a.getString(R.styleable.LogTitleBar_Back);
|
||||
a.recycle();
|
||||
|
||||
mBack = findViewById(R.id.back);
|
||||
mIcon = findViewById(R.id.icon);
|
||||
mTitle = findViewById(R.id.title);
|
||||
|
||||
mIcon.setOnClickListener(v -> {
|
||||
if (mListener != null) {
|
||||
mListener.onRightClick();
|
||||
}
|
||||
});
|
||||
|
||||
mBack.setOnClickListener(v -> {
|
||||
if (mListener != null) {
|
||||
mListener.onLeftClick();
|
||||
}
|
||||
});
|
||||
|
||||
setBack(back);
|
||||
setTitle(title);
|
||||
setIcon(icon);
|
||||
}
|
||||
|
||||
/**
|
||||
* TitleBar 点击事件回调
|
||||
*/
|
||||
public interface OnTitleBarClickListener {
|
||||
void onRightClick();
|
||||
|
||||
void onLeftClick();
|
||||
}
|
||||
|
||||
public void setTitle(@StringRes int title) {
|
||||
setTitle(getResources().getString(title));
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
if (TextUtils.isEmpty(title)) {
|
||||
mTitle.setText("");
|
||||
} else {
|
||||
mTitle.setText(title);
|
||||
mTitle.setAlpha(0);
|
||||
mTitle.setVisibility(View.VISIBLE);
|
||||
mTitle.animate().alpha(1).start();
|
||||
}
|
||||
}
|
||||
|
||||
public void setBack(String back) {
|
||||
if (TextUtils.isEmpty(back)) {
|
||||
mBack.setText("");
|
||||
} else {
|
||||
mBack.setText(back);
|
||||
}
|
||||
}
|
||||
|
||||
public void setIcon(@DrawableRes int id) {
|
||||
if (id == 0) {
|
||||
return;
|
||||
}
|
||||
mIcon.setImageResource(id);
|
||||
mIcon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void setListener(OnTitleBarClickListener listener) {
|
||||
mListener = listener;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
public class LogViewLayoutParams {
|
||||
/**
|
||||
* 悬浮窗不能获取焦点
|
||||
*/
|
||||
public static int FLAG_NOT_FOCUSABLE = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
public static int FLAG_NOT_TOUCHABLE = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
|
||||
/**
|
||||
* 是否允许超出屏幕
|
||||
*/
|
||||
public static int FLAG_LAYOUT_NO_LIMITS = WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
|
||||
/**
|
||||
* 悬浮窗不能获取焦点并且不相应触摸
|
||||
*/
|
||||
public static int FLAG_NOT_FOCUSABLE_AND_NOT_TOUCHABLE = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
|
||||
|
||||
public static int MATCH_PARENT = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
public static int WRAP_CONTENT = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
|
||||
/**
|
||||
* 只针对系统悬浮窗起作用 值基本上为以上2个
|
||||
*/
|
||||
public int flags;
|
||||
/**
|
||||
* 只针对系统悬浮窗起作用 值基本上为Gravity
|
||||
*/
|
||||
public int gravity;
|
||||
public int x;
|
||||
public int y;
|
||||
public int width;
|
||||
public int height;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LogViewLayoutParams{" +
|
||||
"flags=" + flags +
|
||||
", gravity=" + gravity +
|
||||
", x=" + x +
|
||||
", y=" + y +
|
||||
", width=" + width +
|
||||
", height=" + height +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.logcatch;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
|
||||
/**
|
||||
* touch 事件代理 解决点击和触摸事件的冲突
|
||||
*/
|
||||
public class TouchProxy {
|
||||
|
||||
public TouchProxy(OnTouchEventListener eventListener) {
|
||||
}
|
||||
|
||||
public void setEventListener(OnTouchEventListener eventListener) {
|
||||
}
|
||||
|
||||
|
||||
public boolean onTouchEvent(View v, MotionEvent event) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public interface OnTouchEventListener {
|
||||
void onMove(int x, int y, int dx, int dy);
|
||||
|
||||
void onUp(int x, int y);
|
||||
|
||||
void onDown(int x, int y);
|
||||
}
|
||||
}
|
||||
@@ -94,8 +94,6 @@ import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||
import com.mogo.eagle.core.utilcode.kotlin.currentPadding
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
@@ -230,7 +228,6 @@ import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsDrawUnknownIde
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsRainMode
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsStrictMode
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbLogCatch
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbLogDebugView
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbLogcatCenter
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbNetLog
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbObuController
|
||||
@@ -351,10 +348,9 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
IMoGoObuInfoListener,
|
||||
ISopSettingListener, IViewControlListener, IMoGoCloudListener {
|
||||
|
||||
private val TAG = "DebugSettingView"
|
||||
|
||||
private var logInfoView: LogInfoView? = null
|
||||
private var logViewAttach = false
|
||||
companion object {
|
||||
private const val TAG = "DebugSettingView"
|
||||
}
|
||||
|
||||
private var mGnssInfo: MogoLocation? = null
|
||||
|
||||
@@ -385,10 +381,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
//OBU连接状态
|
||||
private var obuConnectStatus: Boolean = false
|
||||
|
||||
//渠道包标签
|
||||
private var onlineSelected: Boolean = true
|
||||
private var qaSelected: Boolean = true
|
||||
|
||||
private val mapUiController by lazy {
|
||||
CallerMapUIServiceManager.getMapUIController()
|
||||
}
|
||||
@@ -408,6 +400,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
// 高精地图是否已缓存
|
||||
private var isHDCached = false
|
||||
|
||||
//是否已经点击且选中证书认证按钮
|
||||
private var isCertCheck = false
|
||||
private var isFirstDownLoadCertHint = false
|
||||
@@ -465,9 +458,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
FuncBizConfig.FOUNDATION, TAG, true, this
|
||||
)
|
||||
|
||||
if (logInfoView != null) {
|
||||
logInfoView!!.onEnterForeground()
|
||||
}
|
||||
// 开启定时查询速度
|
||||
isRunCheck = true
|
||||
Timer().schedule(timerTaskRefresh, Date(), 500)
|
||||
@@ -512,9 +502,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
TAG
|
||||
)
|
||||
|
||||
if (logInfoView != null) {
|
||||
logInfoView!!.onEnterBackground()
|
||||
}
|
||||
try {
|
||||
isRunCheck = false
|
||||
timerTaskRefresh.cancel()
|
||||
@@ -555,19 +542,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 蘑方点击事件
|
||||
*/
|
||||
// tbMojie.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
// if (isChecked) {
|
||||
// buttonView.setCompoundDrawables(null, null, iconDown, null)
|
||||
// tbOpenMfView.visibility = View.VISIBLE
|
||||
// } else {
|
||||
// buttonView.setCompoundDrawables(null, null, iconRight, null)
|
||||
// tbOpenMfView.visibility = View.GONE
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* APP升级点击事件
|
||||
*/
|
||||
@@ -583,14 +557,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 蘑方控制 默认关闭
|
||||
// */
|
||||
// tbOpenMfView.isChecked = HmiBuildConfig.isShowMfToastView
|
||||
// tbOpenMfView.setOnCheckedChangeListener { _, isChecked ->
|
||||
// HmiBuildConfig.isShowMfToastView = isChecked
|
||||
// }
|
||||
|
||||
/**
|
||||
* 版本信息
|
||||
*/
|
||||
@@ -605,6 +571,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
appVersionInfoLayout.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态中心
|
||||
*/
|
||||
@@ -651,7 +618,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
controlCenterLayout.visibility = View.GONE
|
||||
commonLayout.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -761,7 +727,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
ttsCenterContainer.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
etTTSContent.setOnFocusChangeListener { v, hasFocus ->
|
||||
etTTSContent.setOnFocusChangeListener { _, _ ->
|
||||
KeyboardUtils.showSoftInput()
|
||||
}
|
||||
btnStartTTS.setOnClickListener {
|
||||
@@ -772,7 +738,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
UiThreadHandler.post {
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp())
|
||||
.speakTTSVoiceWithLevel(content, AIAssist.LEVEL0, object: IMogoTTSCallback {
|
||||
.speakTTSVoiceWithLevel(content, AIAssist.LEVEL0, object : IMogoTTSCallback {
|
||||
override fun onSpeakStart(speakText: String?) {
|
||||
super.onSpeakStart(speakText)
|
||||
ToastUtils.showShort("onSpeakStart -> $speakText")
|
||||
@@ -887,7 +853,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改皮肤样式按钮(白天模式、夜间模式)
|
||||
*/
|
||||
@@ -925,9 +890,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
//日志中心事件点击监听
|
||||
setLogCheckedChangeListener()
|
||||
|
||||
//OBU配置信息
|
||||
// tvObuInfo.text = CallerObuConnectListenerManager.getObuStatusInfoJsonString()
|
||||
|
||||
//工控机配置信息
|
||||
tvAutopilotInfo.text =
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfoJsonString()
|
||||
@@ -1034,7 +996,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
tbObuWarningFusionUnion.isChecked = FunctionBuildConfig.isObuWarningFusionUnion
|
||||
//ObuWarningFusionUnion
|
||||
tbObuWarningFusionUnion.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isObuWarningFusionUnion = isChecked
|
||||
}
|
||||
@@ -1163,7 +1124,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
//TODO
|
||||
tbIsDrawPath.setOnCheckedChangeListener { _, isChecked ->
|
||||
tbIsDrawPath.setOnCheckedChangeListener { _, _ ->
|
||||
ToastUtils.showShort("功能开发中")
|
||||
}
|
||||
|
||||
@@ -1392,7 +1353,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
//设置连接司机屏IP
|
||||
btnConnectServerIp.setOnClickListener {
|
||||
val ip = etConnectServerIp.text.toString()
|
||||
if (!ip.isEmpty()) {
|
||||
if (ip.isNotEmpty()) {
|
||||
CallerAutoPilotControlManager.connectSpecifiedServer(ip)
|
||||
}
|
||||
}
|
||||
@@ -1556,14 +1517,17 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
ToastUtils.showShort(errorMsg)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
isCertCheck = true
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
isCertCheck = false
|
||||
}
|
||||
SharedPrefsMgr.getInstance()
|
||||
.putBoolean("${MoGoConfig.AUTOPILOT_CERTIFICATION}-${DebugConfig.getNetMode()}", cbSsl.isChecked)
|
||||
.putBoolean(
|
||||
"${MoGoConfig.AUTOPILOT_CERTIFICATION}-${DebugConfig.getNetMode()}",
|
||||
cbSsl.isChecked
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1573,7 +1537,10 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
if (isCertCheck) {
|
||||
cbSsl.isChecked = true
|
||||
SharedPrefsMgr.getInstance()
|
||||
.putBoolean("${MoGoConfig.AUTOPILOT_CERTIFICATION}-${DebugConfig.getNetMode()}", true)
|
||||
.putBoolean(
|
||||
"${MoGoConfig.AUTOPILOT_CERTIFICATION}-${DebugConfig.getNetMode()}",
|
||||
true
|
||||
)
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
tvCertFile.text = Html.fromHtml(
|
||||
@@ -1625,7 +1592,8 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
/**
|
||||
* 通过公交站计算范围边界点 面板控制
|
||||
*/
|
||||
tbBusStationStrategyBorderPoint.isChecked = HmiBuildConfig.isShowBusStationStrategyBorderPoint
|
||||
tbBusStationStrategyBorderPoint.isChecked =
|
||||
HmiBuildConfig.isShowBusStationStrategyBorderPoint
|
||||
tbBusStationStrategyBorderPoint.setOnCheckedChangeListener { _, isChecked ->
|
||||
HmiBuildConfig.isShowBusStationStrategyBorderPoint = isChecked
|
||||
}
|
||||
@@ -1859,7 +1827,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
p.dismiss()
|
||||
v.scope.launch(Dispatchers.IO) {
|
||||
val endTime = System.currentTimeMillis()
|
||||
val startTime = when(item) {
|
||||
val startTime = when (item) {
|
||||
LogcatUploadDuration.IN_15M -> endTime - TimeUnit.MINUTES.toMillis(15)
|
||||
LogcatUploadDuration.IN_45M -> endTime - TimeUnit.MINUTES.toMillis(45)
|
||||
LogcatUploadDuration.IN_1H -> endTime - TimeUnit.HOURS.toMillis(1)
|
||||
@@ -1890,70 +1858,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}.show()
|
||||
}
|
||||
|
||||
// if (JunkConfig.isSupportJunkDetect) {
|
||||
// // 上传APM日志
|
||||
// upload_apm_log_group?.visibility = View.VISIBLE
|
||||
// upload_apm_log?.onClick { v ->
|
||||
// ListPopupWindow(v.context).also { p ->
|
||||
// val items = ApmVLogUploadDuration.values()
|
||||
// p.setAdapter(ApmVLogUploadAdapter(v.context, items))
|
||||
// p.anchorView = v
|
||||
// p.isModal = true
|
||||
// p.setBackgroundDrawable(ColorDrawable(Color.WHITE))
|
||||
// p.setOnItemClickListener { _, _, position, _ ->
|
||||
// val provider = (ARouter.getInstance().build(CrashReportConstants.PATH).navigation() as? ITestCrashReportProvider) ?: return@setOnItemClickListener
|
||||
// val item = items[position]
|
||||
// v.visibility = View.INVISIBLE
|
||||
// upload_apm_log_loading?.visibility = View.VISIBLE
|
||||
// p.dismiss()
|
||||
// v.scope.launch(Dispatchers.IO) {
|
||||
// val endTime = System.currentTimeMillis()
|
||||
// val startTime = when(item) {
|
||||
// ApmVLogUploadDuration.IN_15M -> endTime - TimeUnit.MINUTES.toMillis(15)
|
||||
// ApmVLogUploadDuration.IN_45M -> endTime - TimeUnit.MINUTES.toMillis(45)
|
||||
// ApmVLogUploadDuration.IN_1H -> endTime - TimeUnit.HOURS.toMillis(1)
|
||||
// ApmVLogUploadDuration.IN_2H -> endTime - TimeUnit.HOURS.toMillis(2)
|
||||
// ApmVLogUploadDuration.IN_3H -> endTime - TimeUnit.HOURS.toMillis(3)
|
||||
// ApmVLogUploadDuration.IN_6H -> endTime - TimeUnit.HOURS.toMillis(6)
|
||||
// ApmVLogUploadDuration.ALL -> 0
|
||||
// }
|
||||
// provider.uploadVlog(startTime, endTime)
|
||||
// withContext(Dispatchers.Main) {
|
||||
// ToastUtils.showShort("上传成功")
|
||||
// upload_apm_log_loading?.visibility = View.INVISIBLE
|
||||
// upload_apm_log?.visibility = View.VISIBLE
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }.show()
|
||||
// }
|
||||
// } else {
|
||||
// upload_apm_log_group?.visibility = View.GONE
|
||||
// }
|
||||
|
||||
/**
|
||||
* 展示、关闭日志过滤面板
|
||||
*/
|
||||
tbLogDebugView.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
logInfoView = LogInfoView()
|
||||
logInfoView!!.registerLogViewListener(object : ILogViewListener {
|
||||
override fun onAttach() {
|
||||
logViewAttach = true
|
||||
}
|
||||
|
||||
override fun onDetach() {
|
||||
logViewDestroy()
|
||||
tbLogDebugView.isChecked = false
|
||||
}
|
||||
|
||||
})
|
||||
logInfoView!!.show(context)
|
||||
} else {
|
||||
logViewDestroy()
|
||||
}
|
||||
}
|
||||
|
||||
// 更新链路信息
|
||||
refreshTraceInfo()
|
||||
|
||||
@@ -2034,7 +1938,10 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
ALL("上传所有")
|
||||
}
|
||||
|
||||
private class LogcatUploadAdapter(private val ctx: Context, private val items: Array<LogcatUploadDuration>): BaseAdapter() {
|
||||
private class LogcatUploadAdapter(
|
||||
private val ctx: Context,
|
||||
private val items: Array<LogcatUploadDuration>
|
||||
) : BaseAdapter() {
|
||||
override fun getCount(): Int {
|
||||
return items.size
|
||||
}
|
||||
@@ -2071,53 +1978,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
private inner class Holder(val text: TextView? = null)
|
||||
}
|
||||
|
||||
// private enum class ApmVLogUploadDuration(val text: String) {
|
||||
// IN_15M("15分钟内"),
|
||||
// IN_45M("45分钟内"),
|
||||
// IN_1H("1小时内"),
|
||||
// IN_2H("2小时内"),
|
||||
// IN_3H("3小时内"),
|
||||
// IN_6H("6小时内"),
|
||||
// ALL("上传所有")
|
||||
// }
|
||||
//
|
||||
// private class ApmVLogUploadAdapter(private val ctx: Context, private val items: Array<ApmVLogUploadDuration>): BaseAdapter() {
|
||||
// override fun getCount(): Int {
|
||||
// return items.size
|
||||
// }
|
||||
//
|
||||
// override fun getItem(position: Int): Any {
|
||||
// return items[position]
|
||||
// }
|
||||
//
|
||||
// override fun getItemId(position: Int): Long {
|
||||
// return items[position].ordinal.toLong()
|
||||
// }
|
||||
//
|
||||
// override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
|
||||
// var result = convertView
|
||||
// val duration = items[position]
|
||||
// if (result == null) {
|
||||
// val temp = View.inflate(ctx, android.R.layout.simple_list_item_1, null)
|
||||
// temp.tag = Holder(temp.findViewById(android.R.id.text1))
|
||||
// result = temp
|
||||
// }
|
||||
// val holder = result?.tag as? Holder
|
||||
// if (holder != null) {
|
||||
// holder.text?.setTextColor(Color.BLACK)
|
||||
// holder.text?.text = duration.text
|
||||
// } else {
|
||||
// val text = result?.findViewById<TextView>(android.R.id.text1)
|
||||
// text?.setTextColor(Color.BLACK)
|
||||
// text?.text = duration.text
|
||||
// result?.tag = Holder(text)
|
||||
// }
|
||||
// return result!!
|
||||
// }
|
||||
//
|
||||
// private inner class Holder(val text: TextView? = null)
|
||||
// }
|
||||
|
||||
private fun refreshTraceInfo() {
|
||||
val traceInfoMap = CallerDevaToolsManager.getTraceInfo()
|
||||
val autopilot = traceInfoMap[ChainConstant.CHAIN_TYPE_SOCKET_AUTOPILOT]
|
||||
@@ -2136,42 +1996,17 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
vehicle?.let {
|
||||
cbAdasVehicle.isChecked = it.record
|
||||
}
|
||||
val trafficlight = traceInfoMap[ChainConstant.CHAIN_TYPE_SOCKET_TRAFFIC_LIGHT]
|
||||
trafficlight?.let {
|
||||
val trafficLight = traceInfoMap[ChainConstant.CHAIN_TYPE_SOCKET_TRAFFIC_LIGHT]
|
||||
trafficLight?.let {
|
||||
cbAdasTrafficlight.isChecked = it.record
|
||||
}
|
||||
}
|
||||
|
||||
private fun logViewDestroy() {
|
||||
logInfoView?.let {
|
||||
it.dismiss()
|
||||
it.unRegisterLogViewListener()
|
||||
logInfoView = null
|
||||
logViewAttach = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制应用基本
|
||||
*/
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun drawAppInfo() {
|
||||
when {
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {// 司机端
|
||||
AppConfigInfo.isDriver = true
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getServerStarted()
|
||||
}
|
||||
|
||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> {
|
||||
AppConfigInfo.isDriver = false
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
|
||||
AppConfigInfo.serverSn = CallerTelematicManager.getServerToken()
|
||||
}
|
||||
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备绑定关系
|
||||
*/
|
||||
@@ -2186,9 +2021,17 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
* 版本信息
|
||||
*/
|
||||
tvAppVersionName.text =
|
||||
"鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash} \n渠道信息:${AppConfigInfo.flavor}_${AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode)}"
|
||||
"鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash} \n渠道信息:${AppConfigInfo.flavor}_${
|
||||
AppIdentityModeUtils.getProduct(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
}"
|
||||
tvAppVersionNameKey.text =
|
||||
"鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash}\n渠道信息:${AppConfigInfo.flavor}_${AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode)}"
|
||||
"鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash}\n渠道信息:${AppConfigInfo.flavor}_${
|
||||
AppIdentityModeUtils.getProduct(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
}"
|
||||
|
||||
tvAutopilotProtocolVersionInfo.text =
|
||||
"Autopilot协议版本:${CallerAutoPilotControlManager.getProtocolVersion()}"
|
||||
@@ -2384,11 +2227,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onConnectStatus(obuStatusInfo: ObuStatusInfo) {
|
||||
lifecycleOwner.lifecycleScope.launch {
|
||||
// tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
|
||||
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
|
||||
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus
|
||||
|
||||
if (obuStatusInfo.obuStatus) {
|
||||
obuConnectStatus = true
|
||||
}
|
||||
@@ -2735,14 +2573,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tbLogCatch.isChecked = false
|
||||
}
|
||||
|
||||
override fun onLogCatch(lineLog: String) {
|
||||
// logInfoView?.let {
|
||||
// if (logViewAttach) {
|
||||
// it.onLogCatch(lineLog)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private fun restartApp() {
|
||||
Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName)?.also {
|
||||
ActivityUtils.startActivity(it)
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.utils
|
||||
|
||||
import android.text.TextUtils
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogLine
|
||||
import java.util.regex.Pattern
|
||||
|
||||
class SearchCriteria(inputQuery: CharSequence?) {
|
||||
|
||||
private var pid = -1
|
||||
private var tag: String? = null
|
||||
private val searchText: String
|
||||
private var searchTextAsInt = -1
|
||||
val isEmpty: Boolean
|
||||
get() = pid == -1 && TextUtils.isEmpty(tag) && TextUtils.isEmpty(searchText)
|
||||
|
||||
fun matches(logLine: LogLine): Boolean {
|
||||
// consider the criteria to be ANDed
|
||||
if (!checkFoundPid(logLine)) {
|
||||
return false
|
||||
}
|
||||
return if (!checkFoundTag(logLine)) {
|
||||
false
|
||||
} else checkFoundText(logLine)
|
||||
}
|
||||
|
||||
private fun checkFoundText(logLine: LogLine): Boolean {
|
||||
return (TextUtils.isEmpty(searchText)
|
||||
|| searchTextAsInt != -1 && searchTextAsInt == logLine.processId
|
||||
|| logLine.tag != null && containsIgnoreCase(logLine.tag, searchText)
|
||||
|| logLine.logOutput != null && containsIgnoreCase(
|
||||
logLine.logOutput,
|
||||
searchText
|
||||
))
|
||||
}
|
||||
|
||||
private fun checkFoundTag(logLine: LogLine): Boolean {
|
||||
return (TextUtils.isEmpty(tag)
|
||||
|| logLine.tag != null && containsIgnoreCase(logLine.tag, tag))
|
||||
}
|
||||
|
||||
private fun checkFoundPid(logLine: LogLine): Boolean {
|
||||
return pid == -1 || logLine.processId == pid
|
||||
}
|
||||
|
||||
fun nullToEmpty(str: CharSequence?): String {
|
||||
return str?.toString() ?: ""
|
||||
}
|
||||
|
||||
/**
|
||||
* same as String.contains, but ignores case.
|
||||
*
|
||||
* @param str
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
fun containsIgnoreCase(str: String?, query: String?): Boolean {
|
||||
if (str != null && query != null) {
|
||||
val limit = str.length - query.length + 1
|
||||
for (i in 0 until limit) {
|
||||
if (matchesIgnoreCase(str, query, i)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private fun matchesIgnoreCase(str: String, query: String, startingAt: Int): Boolean {
|
||||
val len = query.length
|
||||
for (i in 0 until len) {
|
||||
if (Character.toUpperCase(query[i]) != Character.toUpperCase(str[startingAt + i])) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val PID_KEYWORD = "pid:"
|
||||
private const val TAG_KEYWORD = "tag:"
|
||||
private val PID_PATTERN = Pattern.compile("$PID_KEYWORD:(\\d+)", Pattern.CASE_INSENSITIVE)
|
||||
private val TAG_PATTERN = Pattern.compile("$TAG_KEYWORD:(\"[^\"]+\"|\\S+)", Pattern.CASE_INSENSITIVE)
|
||||
}
|
||||
|
||||
init {
|
||||
|
||||
// check for the "pid" keyword
|
||||
val query = StringBuilder(nullToEmpty(inputQuery))
|
||||
val pidMatcher = PID_PATTERN.matcher(query)
|
||||
if (pidMatcher.find()) {
|
||||
try {
|
||||
pid = pidMatcher.group(1).toInt()
|
||||
query.replace(pidMatcher.start(), pidMatcher.end(), "") // detach
|
||||
// from
|
||||
// search
|
||||
// string
|
||||
} catch (ignore: NumberFormatException) {
|
||||
}
|
||||
}
|
||||
|
||||
// check for the "tag" keyword
|
||||
val tagMatcher = TAG_PATTERN.matcher(query)
|
||||
if (tagMatcher.find()) {
|
||||
tag = tagMatcher.group(1)
|
||||
tag?.let {
|
||||
if (it.startsWith("\"") && it.endsWith("\"")) {
|
||||
tag = it.substring(1, it.length - 1) // detach quotes
|
||||
}
|
||||
}
|
||||
query.replace(tagMatcher.start(), tagMatcher.end(), "") // detach
|
||||
}
|
||||
|
||||
// everything else becomes a search term
|
||||
searchText = query.toString().trim { it <= ' ' }
|
||||
try {
|
||||
searchTextAsInt = searchText.toInt()
|
||||
} catch (ignore: NumberFormatException) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
|
||||
import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
|
||||
|
||||
/**
|
||||
* 限速控件
|
||||
*/
|
||||
class LimitingVelocityView constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
) : ConstraintLayout(context, attrs), ILimitingVelocityListener, IViewControlListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "LimitingVelocityView"
|
||||
}
|
||||
|
||||
//限速控件是否展示
|
||||
private var isShow = false
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerLimitingVelocityListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
|
||||
}
|
||||
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
if(isShow){
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (limitingVelocity > 0) {
|
||||
visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
tvLimitingSource?.text = DataSourceType.getName(sourceType)
|
||||
} else {
|
||||
visibility = View.GONE
|
||||
tvLimitingSource?.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
isShow = v == View.VISIBLE
|
||||
this.visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerLimitingVelocityListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import kotlinx.android.synthetic.main.view_roma_bus_bg.view.ivRomaView
|
||||
import kotlinx.android.synthetic.main.view_roma_bus_bg.view.ll_roma_bg
|
||||
|
||||
class RomaBusView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoRomaListener {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "RomaView"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var romaMode = false
|
||||
|
||||
@Volatile
|
||||
private var click = true
|
||||
|
||||
private val normalRes: Int
|
||||
private val openRes: Int
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_bus_bg, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.RomaView,
|
||||
defStyleAttr,
|
||||
0
|
||||
)
|
||||
normalRes = a.getResourceId(
|
||||
R.styleable.RomaView_roma_close_bg,
|
||||
R.drawable.romabg_normal_select
|
||||
)
|
||||
openRes = a.getResourceId(
|
||||
R.styleable.RomaView_roma_open_bg,
|
||||
R.drawable.romabg_press_select_bg
|
||||
)
|
||||
a.recycle()
|
||||
if(normalRes!=0){
|
||||
ll_roma_bg.background = AppCompatResources.getDrawable(context, normalRes)
|
||||
}
|
||||
|
||||
setOnClickListener {
|
||||
if (ClickUtils.isClickTooFrequent(this,2500)) {
|
||||
ToastUtils.showShort("不要频繁点击哦~")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!click){
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!MogoStatusManager.getInstance().isSocketOnLine){
|
||||
ToastUtils.showShort("长链状态异常,请检查链接后开启漫游")
|
||||
return@setOnClickListener
|
||||
}
|
||||
click = false
|
||||
romaMode = !romaMode
|
||||
//司机屏不控制乘客屏漫游,独自漫游
|
||||
romaTrigger(romaMode)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun romaViewStatus(status: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if(status){
|
||||
this.visibility = View.VISIBLE
|
||||
} else {
|
||||
this.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun romaStatus(status: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
click = true
|
||||
if (status) {
|
||||
romaMode = true
|
||||
if(openRes!=0){
|
||||
ll_roma_bg.setBackgroundResource(openRes)
|
||||
}else{
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.roma_press_select_bg)
|
||||
} else {
|
||||
romaMode = false
|
||||
if(normalRes!=0){
|
||||
ll_roma_bg.setBackgroundResource(normalRes)
|
||||
}else{
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.roma_bg_selector)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.romafront_select_bg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMapRomaListener.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMapRomaListener.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ivRomaView
|
||||
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ll_roma_bg
|
||||
|
||||
class RomaTaxiView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoRomaListener {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "RomaView"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var romaMode = false
|
||||
|
||||
@Volatile
|
||||
private var click = true
|
||||
|
||||
private val normalRes: Int
|
||||
private val openRes: Int
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_taxi_bg, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.RomaView,
|
||||
defStyleAttr,
|
||||
0
|
||||
)
|
||||
normalRes = a.getResourceId(
|
||||
R.styleable.RomaView_roma_close_bg,
|
||||
R.drawable.romabg_normal_select
|
||||
)
|
||||
openRes = a.getResourceId(
|
||||
R.styleable.RomaView_roma_open_bg,
|
||||
R.drawable.romabg_press_select_bg
|
||||
)
|
||||
a.recycle()
|
||||
if(normalRes!=0){
|
||||
ll_roma_bg.background = AppCompatResources.getDrawable(context, normalRes)
|
||||
}
|
||||
|
||||
setOnClickListener {
|
||||
if (ClickUtils.isClickTooFrequent(this,2500)) {
|
||||
ToastUtils.showShort("不要频繁点击哦~")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!click){
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!MogoStatusManager.getInstance().isSocketOnLine){
|
||||
ToastUtils.showShort("长链状态异常,请检查链接后开启漫游")
|
||||
return@setOnClickListener
|
||||
}
|
||||
click = false
|
||||
romaMode = !romaMode
|
||||
//司机屏不控制乘客屏漫游,独自漫游
|
||||
romaTrigger(romaMode)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun romaViewStatus(status: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if(status){
|
||||
this.visibility = View.VISIBLE
|
||||
} else {
|
||||
this.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun romaStatus(status: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
click = true
|
||||
if (status) {
|
||||
romaMode = true
|
||||
if(openRes!=0){
|
||||
ll_roma_bg.setBackgroundResource(openRes)
|
||||
}else{
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.roma_press_select_bg)
|
||||
|
||||
} else {
|
||||
romaMode = false
|
||||
if(normalRes!=0){
|
||||
ll_roma_bg.setBackgroundResource(normalRes)
|
||||
}else{
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.roma_bg_selector)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.romafront_select_bg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMapRomaListener.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMapRomaListener.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Typeface;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/3/24 16:20
|
||||
* describe:
|
||||
*/
|
||||
public class SpeedChartView extends View {
|
||||
|
||||
//中心的文字描述
|
||||
private final String mDes = "KM/H";
|
||||
//根据数据显示的圆弧Paint
|
||||
private Paint mArcPaint;
|
||||
//圆弧颜色
|
||||
private int mArcColor;
|
||||
//圆弧的画笔的宽度
|
||||
private final float mStrokeWith = getResources().getDimension(R.dimen.module_ext_arcView_stroke_with);
|
||||
//文字描述的paint
|
||||
private Paint mTextPaint;
|
||||
|
||||
//当前进度夹角大小
|
||||
private float mIncludedAngle = 0;
|
||||
//当前数据
|
||||
private int currentValue;
|
||||
//最大数据
|
||||
private final int maxValue = 240;
|
||||
//圆弧背景的开始和结束间的夹角大小
|
||||
private final float mAngle = 270;
|
||||
//上次绘制圆弧夹角
|
||||
private float lastAngle = 0;
|
||||
|
||||
public SpeedChartView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public SpeedChartView(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public SpeedChartView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
//初始化paint
|
||||
initPaint();
|
||||
//绘制弧度
|
||||
drawArc(canvas);
|
||||
//绘制文本
|
||||
drawText(canvas);
|
||||
}
|
||||
|
||||
private void drawText(Canvas canvas) {
|
||||
Rect mRect = new Rect();
|
||||
String mValue = String.valueOf(currentValue);
|
||||
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
|
||||
//绘制中心的数值
|
||||
mTextPaint.getTextBounds(mValue, 0, mValue.length(), mRect);
|
||||
canvas.drawText(mValue, getWidth() / 2.0f, getHeight() / 2.0f + mRect.height() / 2.0f - 10, mTextPaint);
|
||||
|
||||
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
|
||||
//绘制中心文字描述
|
||||
mTextPaint.setTextSize(getResources().getDimension(R.dimen.module_ext_arcView_des_text_size));
|
||||
mTextPaint.getTextBounds(mDes, 0, mDes.length(), mRect);
|
||||
canvas.drawText(mDes, getWidth() / 2.0f, getHeight() * 17.0f / 20.0f + mRect.height() / 2.0f, mTextPaint);
|
||||
}
|
||||
|
||||
private void drawArc(Canvas canvas) {
|
||||
//绘制圆弧背景
|
||||
RectF mRectF = new RectF(mStrokeWith, mStrokeWith, getWidth() - mStrokeWith, getHeight() - mStrokeWith);
|
||||
canvas.drawArc(mRectF, 135, mAngle, false, mArcPaint);
|
||||
|
||||
//绘制当前数值对应的圆弧
|
||||
mArcPaint.setColor(mArcColor);
|
||||
//根据当前数据绘制对应的圆弧
|
||||
canvas.drawArc(mRectF, 135, mIncludedAngle, false, mArcPaint);
|
||||
}
|
||||
|
||||
private void initPaint() {
|
||||
//圆弧的paint
|
||||
mArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
//抗锯齿
|
||||
mArcPaint.setAntiAlias(true);
|
||||
mArcPaint.setColor(Color.parseColor("#151D4C"));
|
||||
//设置透明度(数值为0-255)
|
||||
mArcPaint.setAlpha(100);
|
||||
//设置画笔的画出的形状
|
||||
mArcPaint.setStrokeJoin(Paint.Join.ROUND);
|
||||
mArcPaint.setStrokeCap(Paint.Cap.ROUND);
|
||||
//设置画笔类型
|
||||
mArcPaint.setStyle(Paint.Style.STROKE);
|
||||
//画笔宽度
|
||||
mArcPaint.setStrokeWidth(mStrokeWith);
|
||||
|
||||
//中心文字的paint
|
||||
mTextPaint = new Paint();
|
||||
mTextPaint.setAntiAlias(true);
|
||||
mTextPaint.setColor(Color.parseColor("#FFFFFF"));
|
||||
//设置文本的对齐方式
|
||||
mTextPaint.setTextAlign(Paint.Align.CENTER);
|
||||
//mTextPaint.setTextSize(getResources().getDimensionPixelSize(R.dimen.dp_12));
|
||||
mTextPaint.setTextSize(getResources().getDimension(R.dimen.module_ext_arcView_center_text_size));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 为绘制弧度及数据设置动画
|
||||
*
|
||||
* @param startAngle 开始的弧度
|
||||
* @param currentAngle 需要绘制的弧度
|
||||
* @param time 动画执行的时长
|
||||
*/
|
||||
private void setAnimation(float startAngle, float currentAngle, int time) {
|
||||
// //绘制当前数据对应的圆弧的动画效果
|
||||
// ValueAnimator progressAnimator = ValueAnimator.ofFloat(startAngle, currentAngle);
|
||||
// progressAnimator.setDuration(time);
|
||||
// progressAnimator.setTarget(mIncludedAngle);
|
||||
// progressAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
// @Override
|
||||
// public void onAnimationUpdate(ValueAnimator animation) {
|
||||
// mIncludedAngle = (float) animation.getAnimatedValue();
|
||||
// //重新绘制,不然不会出现效果
|
||||
// postInvalidate();
|
||||
// }
|
||||
// });
|
||||
// //开始执行动画
|
||||
// progressAnimator.start();
|
||||
mIncludedAngle = currentAngle;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置弧形颜色
|
||||
*
|
||||
* @param value 颜色值
|
||||
*/
|
||||
public void setArcColor(int value) {
|
||||
mArcColor = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置数据
|
||||
*
|
||||
* @param value 当前绘制的值
|
||||
*/
|
||||
public void setValues(int value) {
|
||||
//完全覆盖
|
||||
if (value > maxValue) {
|
||||
value = maxValue;
|
||||
}
|
||||
if (value < 0) {
|
||||
value = 0;
|
||||
}
|
||||
currentValue = value;
|
||||
//计算弧度比重
|
||||
float scale = (float) currentValue / maxValue;
|
||||
//计算弧度
|
||||
float currentAngle = scale * mAngle;
|
||||
//开始执行动画
|
||||
setAnimation(lastAngle, currentAngle, 1000);
|
||||
lastAngle = currentAngle;
|
||||
//重新绘制
|
||||
invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
|
||||
class SpeedPanelView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), ILimitingVelocityListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SpeedPanelView"
|
||||
}
|
||||
|
||||
var mContext: Context
|
||||
var mSpeedChartView: SpeedChartView
|
||||
|
||||
init {
|
||||
setBackgroundResource(R.drawable.yi_biao_pan_bg_nor)
|
||||
mContext = context
|
||||
mSpeedChartView = SpeedChartView(context)
|
||||
|
||||
val layoutParams = LayoutParams(
|
||||
resources.getDimension(R.dimen.module_ext_arcView_width).toInt(),
|
||||
resources.getDimension(R.dimen.module_ext_arcView_height).toInt()
|
||||
)
|
||||
layoutParams.gravity = Gravity.CENTER
|
||||
mSpeedChartView.layoutParams = layoutParams
|
||||
addView(mSpeedChartView)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerLimitingVelocityListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
super.onLimitingVelocityChange(limitingVelocity, sourceType)
|
||||
UiThreadHandler.post {
|
||||
val speed =
|
||||
(CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed * 3.6f).toInt()
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > limitingVelocity) "#DB3137" else "#3E77F6"))
|
||||
mSpeedChartView.setValues(speed)
|
||||
setBackgroundResource(if (speed > limitingVelocity) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerLimitingVelocityListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.BlurMaskFilter
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.RotateAnimation
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import chassis.Chassis.GearPosition
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isBus
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlin.math.abs
|
||||
|
||||
/**
|
||||
* @Deprecated("无用类")
|
||||
* @author Jing
|
||||
* @description 方向盘
|
||||
* 方向盘跟随CAN数据做旋转
|
||||
* 档位随CAN数据做切换和高亮显示
|
||||
* @since: 4/7/22
|
||||
*/
|
||||
class SteeringWheelView : ConstraintLayout, IMoGoChassisStatesListener {
|
||||
private var autopilotIV: ImageView? = null
|
||||
private var steeringTVL: TextView? = null
|
||||
private var steeringTVR: TextView? = null
|
||||
private var tapPositionView: TapPositionView? = null
|
||||
private var steeringCircularV: CircularProgressView? = null
|
||||
private var steeringCircularVAlpha: CircularProgressView? = null
|
||||
private var rotateAnimation: RotateAnimation? = null
|
||||
private var fromDegrees = 0f //方向盘旋转起始位置
|
||||
|
||||
constructor(context: Context) : super(context) {}
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
|
||||
when (AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode)) {
|
||||
AppIdentityModeUtils.Product.BUS -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
|
||||
AppIdentityModeUtils.Product.TAXI -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this)
|
||||
AppIdentityModeUtils.Product.SWEEPER -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
|
||||
AppIdentityModeUtils.Product.SHUTTLE -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
|
||||
AppIdentityModeUtils.Product.CHARTER -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
|
||||
}
|
||||
initView()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
|
||||
CallerChassisStatesListenerManager.addListener(TAG, this)
|
||||
tapPositionView?.updateWithGear(GearPosition.GEAR_R)
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
autopilotIV = findViewById<View>(R.id.autopilot_iv) as ImageView
|
||||
steeringTVL = findViewById(R.id.steering_tv_left)
|
||||
steeringTVR = findViewById(R.id.steering_tv_right)
|
||||
tapPositionView = findViewById(R.id.tap_position)
|
||||
steeringCircularV = findViewById(R.id.steering_circular)
|
||||
steeringCircularV?.setBackWidth(8)
|
||||
steeringCircularV?.setBackColor(R.color.color_1EBBCFF6)
|
||||
steeringCircularV?.setProgress((0 * 100) / 360, 20)
|
||||
steeringCircularV?.setProgColor(R.color.color_45D3FF, R.color.color_1B5BFF)
|
||||
if (isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
steeringCircularVAlpha = findViewById(R.id.steering_circular_alpha)
|
||||
steeringCircularVAlpha?.setProgress((0 * 100) / 360, 20)
|
||||
steeringCircularV?.setProgColor(R.color.color_1B5BFF, R.color.color_45D3FF)
|
||||
steeringCircularVAlpha?.setBackWidth(8)
|
||||
steeringCircularVAlpha?.setBackColor(R.color.color_00FFFFFF)
|
||||
steeringCircularVAlpha?.setProgColor(
|
||||
R.color.color_D93261B6,
|
||||
R.color.color_D945D3FF
|
||||
)
|
||||
steeringCircularVAlpha?.setBlurMaskFilter(BlurMaskFilter.Blur.NORMAL, 12f)
|
||||
}
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
}
|
||||
|
||||
private val mGoAutopilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (autopilotIV != null) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (!isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
autopilotIV?.setImageResource(R.drawable.bg_auto)
|
||||
}
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
if (!isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
autopilotIV?.setImageResource(R.drawable.bg_auto_nor)
|
||||
}
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
if (!isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
autopilotIV?.setImageResource(R.drawable.bg_auto_nor)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
d("$M_BUS_P$TAG", "autopilotIV=null")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
override fun onAutopilotSteeringData(steering: Float) {
|
||||
var temp = steering
|
||||
if (abs(steering) < 1) {
|
||||
temp = 0f
|
||||
}
|
||||
val steeringValue = temp
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (steeringTVL != null && steeringValue > 0) {
|
||||
steeringTVR?.visibility = INVISIBLE
|
||||
steeringTVL?.visibility = VISIBLE
|
||||
steeringTVL?.text = "${steeringValue}°"
|
||||
} else if (steeringTVR != null && steeringValue <= 0) {
|
||||
steeringTVL?.visibility = INVISIBLE
|
||||
steeringTVR?.visibility = VISIBLE
|
||||
steeringTVR?.text = "${-steeringValue}°"
|
||||
} else {
|
||||
d(TAG, "onAutopilotSteeringData error")
|
||||
}
|
||||
animationWithSteeringData(-steeringValue)
|
||||
if (steeringCircularV != null) {
|
||||
steeringCircularV?.setProgress((-steeringValue * 100).toInt() / 360, 20)
|
||||
}
|
||||
if (steeringCircularVAlpha != null) {
|
||||
steeringCircularVAlpha?.setProgress((-steeringValue * 100).toInt() / 360, 20)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
override fun onAutopilotGearData(gear: GearPosition) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
d(TAG, "乘客屏档位$gear")
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView?.updateWithGear(gear)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘随CAN数据做方向和角度旋转
|
||||
* 参数1从哪一个旋转角度开始
|
||||
* 参数2:转到什么角度
|
||||
* 后4个参数用于设置围绕着旋转的圆的圆心在哪里
|
||||
* 参数3:肯定x轴坐标的类型,有ABSOLUT绝对坐标、RELATIVE_TO_SELF相对于自身坐标、RELATIVE_TO_PARENT相对于父控件的坐标
|
||||
* 参数4:x轴的值,0.5f代表是以自身这个控件的一半长度为x轴
|
||||
* 参数5:肯定y轴坐标的类型
|
||||
* 参数6:y轴的值,0.5f代表是以自身这个控件的一半长度为x轴
|
||||
*
|
||||
* @param steering
|
||||
*/
|
||||
private fun animationWithSteeringData(steering: Float) {
|
||||
rotateAnimation = RotateAnimation(
|
||||
fromDegrees, steering,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f
|
||||
)
|
||||
rotateAnimation?.duration = 20 //旋转时长
|
||||
rotateAnimation?.fillAfter = true //旋转后保持原状
|
||||
autopilotIV?.clearAnimation()
|
||||
autopilotIV?.startAnimation(rotateAnimation)
|
||||
fromDegrees = steering
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SteeringWheelView"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 314 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 109 KiB |
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/background">
|
||||
<shape
|
||||
android:innerRadius="@dimen/dp_85"
|
||||
android:shape="ring"
|
||||
android:thickness="6dp"
|
||||
android:useLevel="false">
|
||||
<solid android:color="#00BBCFF6" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/background">
|
||||
<shape
|
||||
android:innerRadius="@dimen/dp_120"
|
||||
android:shape="ring"
|
||||
android:thickness="7.2dp"
|
||||
android:useLevel="false">
|
||||
<solid android:color="@color/color_1EBBCFF6" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_36"/>
|
||||
<gradient android:angle="315" android:endColor="#E6E9EFFC" android:startColor="#E6E9EFFC" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_46"/>
|
||||
<gradient android:angle="315" android:endColor="#FF31486E" android:startColor="#FF31486E" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:drawable="@drawable/roma_distance_bg"
|
||||
android:width="@dimen/dp_334"
|
||||
android:height="@dimen/dp_120"/>
|
||||
</layer-list >
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/radio_button_checked_background" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/radio_button_normal_background" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/radio_button_checked_background_left" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/radio_button_normal_background_left" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/radio_button_checked_background_middle" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/radio_button_normal_background_middle" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/radio_button_checked_background_right" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/radio_button_normal_background_right" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#337CC4"/>
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#337CC4"/>
|
||||
<padding
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp"/>
|
||||
</shape>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#337CC4" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#337CC4" />
|
||||
<padding
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
<corners android:topLeftRadius="4dp" android:bottomLeftRadius="4dp" />
|
||||
</shape>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#337CC4" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#337CC4" />
|
||||
<padding
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
</shape>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#337CC4" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#337CC4" />
|
||||
<padding
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
<corners android:topRightRadius="4dp" android:bottomRightRadius="4dp" />
|
||||
</shape>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#337CC4" />
|
||||
<padding
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
</shape>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#337CC4" />
|
||||
<padding
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
<corners android:topLeftRadius="4dp" android:bottomLeftRadius="4dp" />
|
||||
</shape>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#337CC4" />
|
||||
<padding
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
</shape>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/romabg_press_select_bg" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/romabg_press_select_bg" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/romabg_press_select_bg" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/romabg_press_select_bg" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/romabg_normal_select" />
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<gradient
|
||||
android:startColor="#323C6F"
|
||||
android:endColor="#323C6F"
|
||||
android:angle="315"
|
||||
/>
|
||||
<size
|
||||
android:width="120dp"
|
||||
android:height="120dp"
|
||||
/>
|
||||
</shape>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<gradient
|
||||
android:startColor="#029DFF"
|
||||
android:endColor="#0056FF"
|
||||
android:angle="225"
|
||||
/>
|
||||
<size
|
||||
android:width="120dp"
|
||||
android:height="120dp"
|
||||
/>
|
||||
</shape>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/roma_press_select_bg" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/roma_press_select_bg" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/roma_press_select_bg" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/roma_press_select_bg" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/roma_normal_select_bg" />
|
||||
</selector>
|
||||
@@ -1,97 +0,0 @@
|
||||
<?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"
|
||||
android:layout_width="@dimen/dp_490"
|
||||
android:layout_height="@dimen/dp_490"
|
||||
android:background="@drawable/steering_bg_bus">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/blue_circle"
|
||||
android:layout_width="@dimen/dp_278"
|
||||
android:layout_height="@dimen/dp_278"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginLeft="@dimen/dp_84"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
android:layout_marginRight="@dimen/dp_85"
|
||||
android:indeterminateDrawable="@drawable/bg_steering_outer_bus"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
|
||||
android:id="@+id/steering_circular"
|
||||
android:layout_width="@dimen/dp_278"
|
||||
android:layout_height="@dimen/dp_278"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:progWidth="12dp"
|
||||
app:progress="0" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/autopilot_iv"
|
||||
android:layout_width="@dimen/dp_250"
|
||||
android:layout_height="@dimen/dp_250"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/bg_auto_bus"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/steering_circular"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/steering_circular"
|
||||
app:layout_constraintRight_toRightOf="@+id/steering_circular"
|
||||
app:layout_constraintTop_toTopOf="@+id/steering_circular" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/steering_tv_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_status_bar_height"
|
||||
android:layout_marginRight="-16dp"
|
||||
android:gravity="right"
|
||||
android:text="0°"
|
||||
android:textColor="#415479"
|
||||
android:textSize="@dimen/dp_38"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintRight_toLeftOf="@+id/steering_circular"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/steering_tv_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="-16dp"
|
||||
android:layout_marginTop="@dimen/dp_status_bar_height"
|
||||
android:gravity="left"
|
||||
android:text="0°"
|
||||
android:textColor="#415479"
|
||||
android:textSize="@dimen/dp_38"
|
||||
app:layout_constraintLeft_toRightOf="@+id/steering_circular"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_58"
|
||||
android:layout_height="@dimen/dp_58"
|
||||
android:src="@drawable/icon_in_steering"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/autopilot_iv"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/autopilot_iv"
|
||||
app:layout_constraintRight_toRightOf="@+id/autopilot_iv"
|
||||
app:layout_constraintTop_toTopOf="@+id/autopilot_iv" />
|
||||
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
|
||||
android:id="@+id/tap_position"
|
||||
android:layout_width="@dimen/dp_390"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
app:defaultColor = "@color/color_FF6E8EC9"
|
||||
app:selectColor="@color/bus_p_select_txt_color"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/blue_circle" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,97 +0,0 @@
|
||||
<?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"
|
||||
android:layout_width="@dimen/dp_630"
|
||||
android:layout_height="@dimen/dp_630"
|
||||
android:background="@drawable/steering_bg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/autopilot_iv"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
android:layout_height="@dimen/dp_240"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_142"
|
||||
android:src="@drawable/bg_auto"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/steering_tv_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_130"
|
||||
android:layout_marginRight="-10dp"
|
||||
android:gravity="right"
|
||||
android:text="0°"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_37"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintRight_toLeftOf="@+id/autopilot_iv"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/steering_tv_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="-10dp"
|
||||
android:layout_marginTop="@dimen/dp_130"
|
||||
android:gravity="left"
|
||||
android:text="0°"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_37"
|
||||
app:layout_constraintLeft_toRightOf="@+id/autopilot_iv"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--进度值改变状态进度条-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
|
||||
android:id="@+id/steering_circular"
|
||||
android:layout_width="@dimen/dp_278"
|
||||
android:layout_height="@dimen/dp_278"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_122"
|
||||
android:padding="@dimen/dp_12"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:progWidth="8dp"
|
||||
app:progress="0" />
|
||||
|
||||
<!--状态条阴影-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
|
||||
android:id="@+id/steering_circular_alpha"
|
||||
android:layout_width="@dimen/dp_280"
|
||||
android:layout_height="@dimen/dp_280"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:padding="@dimen/dp_12"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:progress="0" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:src="@drawable/icon_in_steering"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/autopilot_iv"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/autopilot_iv"
|
||||
app:layout_constraintRight_toRightOf="@+id/autopilot_iv"
|
||||
app:layout_constraintTop_toTopOf="@+id/autopilot_iv" />
|
||||
|
||||
<!--档位信息-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
|
||||
android:id="@+id/tap_position"
|
||||
android:layout_width="@dimen/dp_272"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:defaultColor="@color/color_FF6E8EC9"
|
||||
app:selectColor="@android:color/white"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/steering_circular_alpha" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="3dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="3dp"
|
||||
android:paddingBottom="1dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pid_text"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timestamp_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/pid_text"
|
||||
android:layout_toRightOf="@+id/pid_text"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tag_text"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/pid_text"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:ellipsize="end"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_000000"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/log_level_text"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/pid_text"
|
||||
android:layout_toEndOf="@+id/tag_text"
|
||||
android:layout_toRightOf="@+id/tag_text"
|
||||
android:gravity="center_horizontal"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/log_output_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/pid_text"
|
||||
android:layout_toEndOf="@+id/log_level_text"
|
||||
android:layout_toRightOf="@+id/log_level_text"
|
||||
android:ellipsize="end"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|left"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:textColor="#337CC4"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="@style/TitleBig"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_66"
|
||||
android:layout_gravity="center_vertical|right"
|
||||
android:layout_marginRight="15dp"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
</merge>
|
||||
@@ -1,165 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/log_page"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#ffffff"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.logcatch.LogTitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="#ffffff"
|
||||
app:Back="@string/log_min"
|
||||
app:Icon="@drawable/close_icon"
|
||||
app:Title="@string/log_info" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
style="@style/Bottom"
|
||||
android:layout_below="@id/title_bar" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/log_filter"
|
||||
style="@style/Input"
|
||||
android:layout_height="100dp"
|
||||
android:layout_below="@id/view_divider"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:background="@drawable/log_filter_background"
|
||||
android:elevation="1dp"
|
||||
android:hint="@string/log_info_edt_hint"
|
||||
android:inputType="text"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/button_wrap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/log_filter"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/verbose"
|
||||
style="@style/RadioButton.Left"
|
||||
android:text="@string/log_info_verbose" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/debug"
|
||||
style="@style/RadioButton"
|
||||
android:text="@string/log_info_debug" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/info"
|
||||
style="@style/RadioButton"
|
||||
android:text="@string/log_info_info" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/warn"
|
||||
style="@style/RadioButton"
|
||||
android:text="@string/log_info_warn" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/error"
|
||||
style="@style/RadioButton.Right"
|
||||
android:text="@string/log_info_error" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clean"
|
||||
style="@style/RadioButton.Left"
|
||||
android:text="@string/log_btn_clean" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_export"
|
||||
style="@style/RadioButton.Middle"
|
||||
android:text="@string/log_btn_export" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_top"
|
||||
style="@style/RadioButton.Middle"
|
||||
android:text="@string/log_btn_back_top" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_bottom"
|
||||
style="@style/RadioButton.Right"
|
||||
android:text="@string/log_btn_to_bottom" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ProgressBar
|
||||
style="@android:style/Widget.ProgressBar.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:text="@string/log_text_loading"
|
||||
android:textColor="#666666"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/log_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/ll_loading"
|
||||
android:layout_below="@id/button_wrap"
|
||||
android:scrollbars="vertical"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/log_hint"
|
||||
style="@style/White"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="#337CC4"
|
||||
android:singleLine="true"
|
||||
android:text="@string/log_info"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:visibility="gone" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1148,17 +1148,6 @@
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSetObuIP" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tvObuInfo"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_margin="@dimen/dp_5"-->
|
||||
<!-- android:minLines="3"-->
|
||||
<!-- android:text="OBU配置信息"-->
|
||||
<!-- android:textColor="#000"-->
|
||||
<!-- android:textSize="@dimen/dp_24"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/obuDivider" />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/obuSendFrequencyTv"
|
||||
style="@style/DebugSettingText"
|
||||
@@ -2134,18 +2123,6 @@
|
||||
android:textOn="关闭「ADAS」Log"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbLogDebugView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:textOff="展示日志过滤面板"
|
||||
android:textOn="关闭日志过滤面板"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbNetLog"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:background="@drawable/bg_waring_limiting_velocity"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="60"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_60"/>
|
||||
|
||||
<!--限速来源-->
|
||||
<TextView
|
||||
android:id="@+id/tvLimitingSource"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="35dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?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"
|
||||
android:id="@+id/ll_roma_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/roma_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRomaView"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/romafront_select_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?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"
|
||||
android:id="@+id/cl_roma_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_roma_bg"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_margin="40dp"
|
||||
android:background="@drawable/roma_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRomaView"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/romafront_select_bg"
|
||||
android:elevation="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -61,7 +61,6 @@
|
||||
<color name="foreground_warn">#FFCCCCCC</color>
|
||||
|
||||
<color name="acc_default_txt_color">#FF343C63</color>
|
||||
<color name="bus_p_select_txt_color">#0043FF</color>
|
||||
|
||||
<color name="hmi_check_keyboard_input_field">#FF282F62</color>
|
||||
<color name="bus_autopilot_text_color_normal">#FFFFFF</color>
|
||||
|
||||
@@ -31,46 +31,6 @@
|
||||
<item name="android:textCursorDrawable">@drawable/input_cursor</item>
|
||||
</style>
|
||||
|
||||
<style name="RadioButton">
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textSize">@dimen/dp_24</item>
|
||||
<item name="android:textColor">#131313</item>
|
||||
<item name="android:layout_height">68dp</item>
|
||||
<item name="android:layout_width">140dp</item>
|
||||
<item name="android:button">@null</item>
|
||||
<item name="android:background">@drawable/radio_button_background</item>
|
||||
</style>
|
||||
|
||||
<style name="RadioButton.Left">
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textSize">24dp</item>
|
||||
<item name="android:textColor">#131313</item>
|
||||
<item name="android:layout_height">68dp</item>
|
||||
<item name="android:layout_width">140dp</item>
|
||||
<item name="android:button">@null</item>
|
||||
<item name="android:background">@drawable/radio_button_background_left</item>
|
||||
</style>
|
||||
|
||||
<style name="RadioButton.Middle">
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textSize">24dp</item>
|
||||
<item name="android:textColor">#131313</item>
|
||||
<item name="android:layout_height">68dp</item>
|
||||
<item name="android:layout_width">140dp</item>
|
||||
<item name="android:button">@null</item>
|
||||
<item name="android:background">@drawable/radio_button_background_middle</item>
|
||||
</style>
|
||||
|
||||
<style name="RadioButton.Right">
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textSize">@dimen/dp_24</item>
|
||||
<item name="android:textColor">#131313</item>
|
||||
<item name="android:layout_height">68dp</item>
|
||||
<item name="android:layout_width">140dp</item>
|
||||
<item name="android:button">@null</item>
|
||||
<item name="android:background">@drawable/radio_button_background_right</item>
|
||||
</style>
|
||||
|
||||
<style name="Text">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
|
||||