diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index 7be540a61c..b355ea73b8 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -390,8 +390,8 @@ public abstract class BaseBusTabFragment public void setAutopilotBtnStatus(int autopilotStatus,boolean canStartAutopilt) { if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE == autopilotStatus) {//0不可用 - ctvAutopilotStatusTv.setTextColor(AbsMogoApplication.getApp().getColor(R.color.bus_autopilot_text_color_disable)); - ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv)); + ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_disable)); + ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_runnig_tv)); ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon); ctvAutopilotStatus.setClickable(true); ctvAutopilotStatus.setBackgroundResource(R.drawable.bus_autopilot_0_1_status_bg); diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java index 54547608bb..90d50e2aee 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java @@ -138,8 +138,8 @@ public class BusFragment extends BaseBusTabFragment AutoSizeUtils.dp2px(getContext(),340f),true); if (bmQr != null){ BindQRCodeDialog.Builder builder = new BindQRCodeDialog.Builder(); - builder.title(getString(R.string.bind_driver_qr_title)) - .cancelStr(getString(R.string.qr_cancel)) + builder.title(ResourcesUtils.getString(R.string.bind_driver_qr_title)) + .cancelStr(ResourcesUtils.getString(R.string.qr_cancel)) .qrBm(bmQr).build(getContext()).show(); }else { CallerLogger.d(M_BUS + TAG,"bmQr = null "); @@ -213,7 +213,7 @@ public class BusFragment extends BaseBusTabFragment showOrHideSwitchLineBtn(false); mLineName.setText(lineName); - mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime); + mTaskTime.setText(ResourcesUtils.getString(R.string.bus_line_time_tag)+ lineTime); // 渲染小巴路线数据 updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived); } @@ -524,10 +524,10 @@ public class BusFragment extends BaseBusTabFragment }else {//结束任务 OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder(); OCHCommitDialog closeLineConfirmDialog = builder - .title(getString(R.string.bus_dialog_title)) - .tips(getString(R.string.bus_dialog_tips)) - .confirmStr(getString(R.string.bus_dialog_confirm)) - .cancelStr(getString(R.string.bus_dialog_cancel)) + .title(ResourcesUtils.getString(R.string.bus_dialog_title)) + .tips(ResourcesUtils.getString(R.string.bus_dialog_tips)) + .confirmStr(ResourcesUtils.getString(R.string.bus_dialog_confirm)) + .cancelStr(ResourcesUtils.getString(R.string.bus_dialog_cancel)) .build(getContext()); closeLineConfirmDialog.setClickListener(new OCHCommitDialog.ClickListener() { @Override diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/BaseSurfaceView.java b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/BaseSurfaceView.java deleted file mode 100644 index 1ece70606f..0000000000 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/BaseSurfaceView.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.mogo.och.common.module.wigets.sfv; - -import android.content.Context; -import android.graphics.Canvas; -import android.graphics.PixelFormat; -import android.os.Handler; -import android.os.HandlerThread; -import android.os.Looper; -import android.os.Message; -import android.util.AttributeSet; -import android.util.Log; -import android.view.SurfaceHolder; -import android.view.SurfaceView; - -import com.elegant.utils.UiThreadHandler; - -public abstract class BaseSurfaceView extends SurfaceView implements SurfaceHolder.Callback { - public static final int DEFAULT_FRAME_DURATION_MILLISECOND = 50; - - private HandlerThread handlerThread; - private SurfaceViewHandler handler; - protected int frameDuration = DEFAULT_FRAME_DURATION_MILLISECOND; - private Canvas canvas; - private boolean isAlive; - - public BaseSurfaceView(Context context) { - super(context); - init(); - } - - public BaseSurfaceView(Context context, AttributeSet attrs) { - super(context, attrs); - init(); - } - - public BaseSurfaceView(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - init(); - } - - protected int getFrameDuration() { - return frameDuration; - } - - protected void setFrameDuration(int frameDuration) { - this.frameDuration = frameDuration; - } - - protected void init() { - getHolder().addCallback(this); - setBackgroundTransparent(); - } - - private void setBackgroundTransparent() { - getHolder().setFormat(PixelFormat.TRANSLUCENT); - setZOrderOnTop(true); - } - - @Override - public void surfaceCreated(SurfaceHolder holder) { - isAlive = true; - startDrawThread(); - } - - @Override - public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { - - } - - @Override - public void surfaceDestroyed(SurfaceHolder holder) { - stopDrawThread(); - isAlive = false; - } - - private void stopDrawThread() { - isAlive = false; - handlerThread.quit(); - handler = null; - } - - private void startDrawThread() { - handlerThread = new HandlerThread("SurfaceViewThread"); - handlerThread.start(); - handler = new SurfaceViewHandler(handlerThread.getLooper()); - handler.post(new DrawRunnable()); - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - int widthMode = MeasureSpec.getMode(widthMeasureSpec); - int heightMode = MeasureSpec.getMode(heightMeasureSpec); - int originWidth = getMeasuredWidth(); - int originHeight = getMeasuredHeight(); - int width = widthMode == MeasureSpec.AT_MOST ? getDefaultWidth() : originWidth; - int height = heightMode == MeasureSpec.AT_MOST ? getDefaultHeight() : originHeight; - setMeasuredDimension(width, height); - Log.v("ttaylor", "BaseSurfaceView.onMeasure()" + " default Width=" + getDefaultWidth() + " default height=" + getDefaultHeight()); - } - - /** - * the width is used when wrap_content is set to layout_width - * the child knows how big it should be - * - * @return - */ - protected abstract int getDefaultWidth(); - - /** - * the height is used when wrap_content is set to layout_height - * the child knows how big it should be - * - * @return - */ - protected abstract int getDefaultHeight(); - - - private class SurfaceViewHandler extends Handler { - - public SurfaceViewHandler(Looper looper) { - super(looper); - } - - @Override - public void handleMessage(Message msg) { - super.handleMessage(msg); - } - } - - private class DrawRunnable implements Runnable { - - @Override - public void run() { - if (!isAlive) { - return; - } - - if (null == getHolder()){ - return; - } - - try { - canvas = getHolder().lockCanvas(); - onFrameDraw(canvas); - } catch (Exception e) { - e.printStackTrace(); - } finally { - getHolder().unlockCanvasAndPost(canvas); - onFrameDrawFinish(); - } - - if (handler != null){ - handler.postDelayed(this, frameDuration); - } - } - } - - /** - * it is will be invoked after one frame is drawn - */ - protected abstract void onFrameDrawFinish(); - - /** - * draw one frame to the surface by canvas - * - * @param canvas - */ - protected abstract void onFrameDraw(Canvas canvas); - - protected void runOnUIThread( Runnable executor ) { - if ( executor == null ) { - return; - } - if ( Looper.myLooper() != Looper.getMainLooper() ) { - UiThreadHandler.post( executor ); - } else { - executor.run(); - } - } -} \ No newline at end of file diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameFinishCallback.java b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameFinishCallback.java deleted file mode 100644 index 09cd4dea1f..0000000000 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameFinishCallback.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.mogo.och.common.module.wigets.sfv; - -public interface FrameFinishCallback { - void onFinishCallback(); -} diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameSurfaceView.java b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameSurfaceView.java deleted file mode 100644 index 8b8a303d7d..0000000000 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameSurfaceView.java +++ /dev/null @@ -1,404 +0,0 @@ -package com.mogo.och.common.module.wigets.sfv; - -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.PorterDuff; -import android.graphics.PorterDuffXfermode; -import android.graphics.Rect; -import android.os.Handler; -import android.os.HandlerThread; -import android.util.AttributeSet; - -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * a SurfaceView which draws bitmaps one after another like frame animation - */ -public class FrameSurfaceView extends BaseSurfaceView { - private static final String TAG = "FrameSurfaceView"; - public static final int INVALID_INDEX = Integer.MAX_VALUE; - private final int bufferSize = 3; - public static final String DECODE_THREAD_NAME = "DecodingThread"; - public static final int INFINITE = -1; - //-1 means repeat infinitely - private int repeatTimes; - private int repeatedCount; - - /** - * the resources of frame animation - */ - private List bitmapIds = new ArrayList<>(); - /** - * the index of bitmap resource which is decoding - */ - private int bitmapIdIndex; - /** - * the index of frame which is drawing - */ - private AtomicInteger frameIndex; - /** - * decoded bitmaps stores in this queue - * consumer is drawing thread, producer is decoding thread. - */ - private final LinkedBlockingQueue decodedBitmaps = new LinkedBlockingQueue(bufferSize); - /** - * bitmaps already drawn by canvas stores in this queue - * consumer is decoding thread, producer is drawing thread. - */ - private final LinkedBlockingQueue drawnBitmaps = new LinkedBlockingQueue(bufferSize); - /** - * the thread for decoding bitmaps - */ - private HandlerThread decodeThread; - /** - * the Runnable describes how to decode one bitmap - */ - private DecodeRunnable decodeRunnable; - /** - * this handler helps to decode bitmap one after another - */ - private Handler handler; - private BitmapFactory.Options options; - private final Paint paint = new Paint(); - private Rect srcRect; - private final Rect dstRect = new Rect(); - private int defaultWidth; - private int defaultHeight; - - private FrameFinishCallback frameFinishCallback; - - public FrameSurfaceView(Context context) { - super(context); - } - - public FrameSurfaceView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public FrameSurfaceView(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - public void setRepeatTimes(int repeatTimes) { - this.repeatTimes = repeatTimes; - } - - @Override - protected void init() { - super.init(); - options = new BitmapFactory.Options(); - options.inMutable = true; - decodeThread = new HandlerThread(DECODE_THREAD_NAME); - frameIndex = new AtomicInteger(); - frameIndex.set(INVALID_INDEX); - } - - @Override - protected void onLayout(boolean changed, int left, int top, int right, int bottom) { - super.onLayout(changed, left, top, right, bottom); - dstRect.set(0, 0, getWidth(), getHeight()); - } - - @Override - protected int getDefaultWidth() { - return defaultWidth; - } - - @Override - protected int getDefaultHeight() { - return defaultHeight; - } - - @Override - protected void onFrameDrawFinish() { - } - - /** - * set the duration of frame animation - * - * @param duration time in milliseconds - */ - public void setDuration(int duration) { - int frameDuration = duration / bitmapIds.size(); - setFrameDuration(frameDuration); - } - - /** - * set the materials of frame animation which is an array of bitmap resource id - * - * @param bitmapIds an array of bitmap resource id - */ - public void setBitmapIds(List bitmapIds) { - if (bitmapIds == null || bitmapIds.size() == 0) { - return; - } - this.bitmapIds = bitmapIds; - //by default, take the first bitMap's dimension into consideration - getBitmapDimension(bitmapIds.get(bitmapIdIndex)); - preloadFrames(); - decodeRunnable = new DecodeRunnable(bitmapIdIndex, bitmapIds, options); - } - - private void getBitmapDimension(int bitmapId) { - final BitmapFactory.Options options = new BitmapFactory.Options(); - options.inJustDecodeBounds = true; - BitmapFactory.decodeResource(this.getResources(), bitmapId, options); - defaultWidth = options.outWidth; - defaultHeight = options.outHeight; - srcRect = new Rect(0, 0, defaultWidth, defaultHeight); - //we have to re-measure to make defaultWidth in use in onMeasure() - requestLayout(); - } - - /** - * load the first several frames of animation before it is started - */ - private void preloadFrames() { - decodeAndPutBitmap(bitmapIds.get(bitmapIdIndex++), options, new LinkedBitmap()); - decodeAndPutBitmap(bitmapIds.get(bitmapIdIndex++), options, new LinkedBitmap()); - } - - /** - * recycle the bitmap used by frame animation. - * Usually it should be invoked when the ui of frame animation is no longer visible - */ - public void destroy() { - if (drawnBitmaps != null) { - drawnBitmaps.clear(); - } - if (decodeThread != null) { - decodeThread.quit(); - decodeThread = null; - } - if (handler != null) { - handler = null; - } - } - - @Override - protected void onFrameDraw(Canvas canvas) { - clearCanvas(canvas); - if (!isStart()) { - return; - } - if (!isFinish()) { - drawOneFrame(canvas); - } else { - onFrameAnimationEnd(); - if (repeatTimes != 0 && repeatTimes == INFINITE) { - start(); - } else if (repeatedCount < repeatTimes) { - start(); - repeatedCount++; - } else { - repeatedCount = 0; - } - } - } - - /** - * draw a single frame which is a bitmap - */ - private void drawOneFrame(Canvas canvas) { - LinkedBitmap linkedBitmap = getDecodedBitmap(); - if (linkedBitmap != null) { - canvas.drawBitmap(linkedBitmap.bitmap, srcRect, dstRect, paint); - } - putDrawnBitmap(linkedBitmap); - frameIndex.incrementAndGet(); - if(isFinish()&&frameFinishCallback!=null){ - runOnUIThread(() -> frameFinishCallback.onFinishCallback()); - } - } - - /** - * invoked when frame animation is done - */ - private void onFrameAnimationEnd() { - reset(); - } - - /** - * reset the index of frame, preparing for the next frame animation - */ - public void reset() { - frameIndex.set(INVALID_INDEX); - } - - /** - * whether frame animation is finished - * - * @return true: animation is finished, false: animation is doing - */ - private boolean isFinish() { - return frameIndex.get() >= bitmapIds.size() - 1; - } - - /** - * whether frame animation is started - * - * @return true: animation is started, false: animation is not started - */ - private boolean isStart() { - return frameIndex.get() != INVALID_INDEX; - } - - /** - * start frame animation from the first frame - */ - public void start() { - frameIndex.compareAndSet(INVALID_INDEX, 0); - if (decodeThread == null) { - decodeThread = new HandlerThread(DECODE_THREAD_NAME); - } - if (!decodeThread.isAlive()) { - decodeThread.start(); - } - if (handler == null) { - handler = new Handler(decodeThread.getLooper()); - } - if (decodeRunnable != null) { - decodeRunnable.setIndex(0); - handler.post(decodeRunnable); - } - } - - - /** - * clear out the drawing on canvas,preparing for the next frame - * * @param canvas - */ - private void clearCanvas(Canvas canvas) { - paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); - canvas.drawPaint(paint); - paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); - } - - /** - * decode bitmap by BitmapFactory.decodeStream(), it is about twice faster than BitmapFactory.decodeResource() - * - * @param resId the bitmap resource - * @param options options - * @return Bitmap - */ - private Bitmap decodeBitmap(int resId, BitmapFactory.Options options) { - options.inScaled = false; - InputStream inputStream = getResources().openRawResource(resId); - return BitmapFactory.decodeStream(inputStream, null, options); - } - - /** - * reuse bitmap in drawnBitmaps to decode new bitmap - * - * @param resId - * @param options - */ - private void decodedBitmapByReuse(int resId, BitmapFactory.Options options) { - LinkedBitmap linkedBitmap = getDrawnBitmap(); - if (linkedBitmap == null) { - linkedBitmap = new LinkedBitmap(); - } - options.inBitmap = linkedBitmap.bitmap; - decodeAndPutBitmap(resId, options, linkedBitmap); - } - - /** - * decode bitmap and put it into decodedBitmaps - * - * @param resId - * @param options - * @param linkedBitmap - */ - private void decodeAndPutBitmap(int resId, BitmapFactory.Options options, LinkedBitmap linkedBitmap) { - linkedBitmap.bitmap = decodeBitmap(resId, options); - try { - decodedBitmaps.put(linkedBitmap); - } catch (InterruptedException e) { - e.printStackTrace(); - CallerLogger.e(M_HMI + TAG, "decodeAndPutBitmap error"); - } - } - - private void putDrawnBitmap(LinkedBitmap bitmap) { - drawnBitmaps.offer(bitmap); - } - - /** - * get bitmap which already drawn by canvas - * - * @return - */ - private LinkedBitmap getDrawnBitmap() { - LinkedBitmap bitmap = null; - try { - bitmap = drawnBitmaps.take(); - } catch (InterruptedException e) { - e.printStackTrace(); - CallerLogger.e(M_HMI + TAG, "getDrawnBitmap error"); - } - return bitmap; - } - - /** - * get decoded bitmap in the decoded bitmap queue - * it might block due to new bitmap is not ready - * - * @return - */ - private LinkedBitmap getDecodedBitmap() { - LinkedBitmap bitmap = null; - try { - bitmap = decodedBitmaps.take(); - } catch (InterruptedException e) { - e.printStackTrace(); - CallerLogger.e(M_HMI + TAG, "getDecodedBitmap error"); - } - return bitmap; - } - - public FrameFinishCallback getFrameFinishCallback() { - return frameFinishCallback; - } - - public void setFrameFinishCallback(FrameFinishCallback frameFinishCallback) { - this.frameFinishCallback = frameFinishCallback; - } - - private class DecodeRunnable implements Runnable { - - private int index; - private final List bitmapIds; - private final BitmapFactory.Options options; - - public DecodeRunnable(int index, List bitmapIds, BitmapFactory.Options options) { - this.index = index; - this.bitmapIds = bitmapIds; - this.options = options; - } - - public void setIndex(int index) { - this.index = index; - } - - @Override - public void run() { - decodedBitmapByReuse(bitmapIds.get(index), options); - index++; - if (index < bitmapIds.size() && null != handler) { - handler.post(this); - } else { - index = 0; - } - } - } -} diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/LinkedBitmap.java b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/LinkedBitmap.java deleted file mode 100644 index d3752c3bb0..0000000000 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/LinkedBitmap.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.mogo.och.common.module.wigets.sfv; - -import android.graphics.Bitmap; - -/** - * a structure used by LinkedBlockingQueue to keep bitmap - */ -public class LinkedBitmap { - public Bitmap bitmap; - public LinkedBitmap next; - -} \ No newline at end of file diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/LinkedBlockingQueue.java b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/LinkedBlockingQueue.java deleted file mode 100644 index 6b95bd5551..0000000000 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/sfv/LinkedBlockingQueue.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.mogo.och.common.module.wigets.sfv; - - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; - -public class LinkedBlockingQueue { - /** - * Current number of elements - */ - private final AtomicInteger count = new AtomicInteger(); - /** - * Lock held by take, poll, etc - */ - private final ReentrantLock takeLock = new ReentrantLock(); - - /** - * Wait queue for waiting takes - */ - private final Condition notEmpty = takeLock.newCondition(); - - /** - * Lock held by put, offer, etc - */ - private final ReentrantLock putLock = new ReentrantLock(); - - /** - * Wait queue for waiting puts - */ - private final Condition notFull = putLock.newCondition(); - /** - * The capacity bound, or Integer.MAX_VALUE if none - */ - private final int capacity; - /** - * the first element in the queue - */ - private LinkedBitmap head; - /** - * the last element int the queue - */ - private LinkedBitmap tail; - - - public LinkedBlockingQueue(int capacity) { - if (capacity <= 0) throw new IllegalArgumentException(); - this.capacity = capacity; - } - - public void put(LinkedBitmap bitmap) throws InterruptedException { - if (bitmap == null) throw new NullPointerException(); - // Note: convention in all put/take/etc is to preset local var - // holding count negative to indicate failure unless set. - int c = -1; - final ReentrantLock putLock = this.putLock; - final AtomicInteger count = this.count; - putLock.lockInterruptibly(); - try { - /* - * Note that count is used in wait guard even though it is - * not protected by lock. This works because count can - * only decrease at this point (all other puts are shut - * out by lock), and we (or some other waiting put) are - * signalled if it ever changes from capacity. Similarly - * for all other uses of count in other wait guards. - */ - while (count.get() == capacity) { - notFull.await(); - } - enqueue(bitmap); - c = count.getAndIncrement(); - if (c + 1 < capacity) - notFull.signal(); - } finally { - putLock.unlock(); - } - if (c == 0) - signalNotEmpty(); - } - - public boolean offer(LinkedBitmap bitmap) { - if (bitmap == null) throw new NullPointerException(); - final AtomicInteger count = this.count; - if (count.get() == capacity) - return false; - int c = -1; - final ReentrantLock putLock = this.putLock; - putLock.lock(); - try { - if (count.get() < capacity) { - enqueue(bitmap); - c = count.getAndIncrement(); - if (c + 1 < capacity) - notFull.signal(); - } - } finally { - putLock.unlock(); - } - if (c == 0) - signalNotEmpty(); - return c >= 0; - } - - public LinkedBitmap take() throws InterruptedException { - LinkedBitmap x; - int c = -1; - final AtomicInteger count = this.count; - final ReentrantLock takeLock = this.takeLock; - takeLock.lockInterruptibly(); - try { - while (count.get() == 0) { - notEmpty.await(); - } - x = dequeue(); - c = count.getAndDecrement(); - if (c > 1) - notEmpty.signal(); - } finally { - takeLock.unlock(); - } - if (c == capacity) - signalNotFull(); - return x; - } - - /** - * insert element into the end of queue - * - * @param bitmap - */ - private void enqueue(LinkedBitmap bitmap) { - if (head == null) { - head = bitmap; - tail = bitmap; - bitmap.next = null; - } else { - tail.next = bitmap; - bitmap.next = null; - } - } - - /** - * get and remove the first element of the queue - * - * @return - */ - private LinkedBitmap dequeue() { - LinkedBitmap p = head; - if (p == null) { - return null; - } else { - head = head.next; - } - return p; - } - - /** - * Signals a waiting take. Called only from put/offer (which do not - * otherwise ordinarily lock takeLock.) - */ - private void signalNotEmpty() { - final ReentrantLock takeLock = this.takeLock; - takeLock.lock(); - try { - notEmpty.signal(); - } finally { - takeLock.unlock(); - } - } - - /** - * Signals a waiting put. Called only from take/poll. - */ - private void signalNotFull() { - final ReentrantLock putLock = this.putLock; - putLock.lock(); - try { - notFull.signal(); - } finally { - putLock.unlock(); - } - } - - /** - * recycle the bitmaps one by one - */ - public void clear() { - LinkedBitmap p = head; - if (p == null) { - return; - } - while (p != null) { - if (p.bitmap != null) { - p.bitmap.recycle(); - } - p.bitmap = null; - p = p.next; - } - } - - public Integer getCount() { - return count.get(); - } -} \ No newline at end of file diff --git a/OCH/facade/script/och.gradle b/OCH/facade/script/och.gradle index b611f2c467..f992990782 100644 --- a/OCH/facade/script/och.gradle +++ b/OCH/facade/script/och.gradle @@ -66,18 +66,5 @@ project.dependencies { implementation project.project(':OCH:taxi:unmanned-driver') implementation project.project(':OCH:taxi:unmanned-passenger') } - - // 多屏幕-Bus司机端 -// fMultiDisplayOchBusImplementation (project(':OCH:mogo-och-bus')) -// // 多屏幕-Bus乘客端 -// fMultiDisplayOchBusImplementation (project(':OCH:mogo-och-bus-passenger')) -// -// // taxi司机端 -// fMultiDisplayOchTaxiImplementation (project(':OCH:mogo-och-taxi')) -// // 多屏幕-taxi乘客端 -// fMultiDisplayOchTaxiImplementation (project(':OCH:mogo-och-taxi-passenger')) -// -// // 清扫车-多屏幕 -// fMultiDisplaySweeperImplementation (project(':OCH:mogo-och-sweeper')) } } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/BaseTaxiTabFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/BaseTaxiTabFragment.kt index d4243b7660..ba8f6a5082 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/BaseTaxiTabFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/BaseTaxiTabFragment.kt @@ -41,26 +41,26 @@ import com.mogo.och.unmanned.taxi.constant.TaxiUnmannedConst.Companion.START_AUT import com.mogo.och.unmanned.taxi.ui.debug.DebugView import com.mogo.och.unmanned.taxi.ui.navi.amap.TaxiAmapNaviFragment import com.mogo.och.unmanned.taxi.ui.navi.auto.TaxiRoutingNaviFragment -import kotlinx.android.synthetic.main.taxi_base_fragment.groupTestPanel -import kotlinx.android.synthetic.main.taxi_base_fragment.mapBizView -import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_autopilot_status -import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_navi_panel_container -import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_operation_status -import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_speed_layout -import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_station_panel_container -import kotlinx.android.synthetic.main.taxi_base_fragment.module_och_autopilot_iv -import kotlinx.android.synthetic.main.taxi_base_fragment.module_och_autopilot_tv -import kotlinx.android.synthetic.main.taxi_base_fragment.module_och_taxi_badcase_ll -import kotlinx.android.synthetic.main.taxi_base_fragment.module_och_taxi_setting_layout -import kotlinx.android.synthetic.main.taxi_base_fragment.module_och_taxi_swich_map_layout -import kotlinx.android.synthetic.main.taxi_base_fragment.parallelDriveView -import kotlinx.android.synthetic.main.taxi_base_fragment.smallMapView -import kotlinx.android.synthetic.main.taxi_base_fragment.startAutopilotAnimationView -import kotlinx.android.synthetic.main.taxi_base_fragment.taxi_close_navi_icon -import kotlinx.android.synthetic.main.taxi_base_fragment.taxi_switch_icon -import kotlinx.android.synthetic.main.taxi_base_fragment.viewDriverMsgBoxBubble -import kotlinx.android.synthetic.main.taxi_base_fragment.viewDriverMsgBoxButton -import kotlinx.android.synthetic.main.taxi_base_fragment.viewDriverMsgBoxList +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.groupTestPanel +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.mapBizView +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_mogo_och_autopilot_status +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_mogo_och_navi_panel_container +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_mogo_och_operation_status +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_mogo_och_speed_layout +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_mogo_och_station_panel_container +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_och_autopilot_iv +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_och_autopilot_tv +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_och_taxi_badcase_ll +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_och_taxi_setting_layout +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_och_taxi_swich_map_layout +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.parallelDriveView +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.smallMapView +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.startAutopilotAnimationView +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.taxi_close_navi_icon +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.taxi_switch_icon +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.viewDriverMsgBoxBubble +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.viewDriverMsgBoxButton +import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.viewDriverMsgBoxList import me.jessyan.autosize.utils.AutoSizeUtils import kotlin.math.abs @@ -84,7 +84,7 @@ abstract class BaseTaxiTabFragment> : MvpFragment(), } override fun getStationPanelViewId(): Int { - return R.layout.taxi_panel + return R.layout.unmanned_taxi_panel } override fun startAutopilot() { diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/debug/DebugView.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/debug/DebugView.kt index a4df15eb26..bcf01580af 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/debug/DebugView.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/debug/DebugView.kt @@ -34,28 +34,28 @@ import com.mogo.och.unmanned.taxi.constant.TaskStatusEnum import com.mogo.och.unmanned.taxi.constant.TaskTypeEnum import com.mogo.och.unmanned.taxi.constant.TaxiOrderStatusEnum import com.mogo.och.unmanned.taxi.ui.task.TaxiTaskModel -import kotlinx.android.synthetic.main.taxi_debug_order.view.btnContainer -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentBusinessModeTextView -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentCarStatus -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentDataTimestamps -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentLineId -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrder -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderStopInfo -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderTrajectoryInfo -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderTrajectoryTime -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentStatus -import kotlinx.android.synthetic.main.taxi_debug_order.view.currentTaskType -import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogHistoryTextView -import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogTitleTextView -import kotlinx.android.synthetic.main.taxi_debug_order.view.lastQuerySuccessDataTimestamps -import kotlinx.android.synthetic.main.taxi_debug_order.view.orderEndSiteInfo -import kotlinx.android.synthetic.main.taxi_debug_order.view.orderNo -import kotlinx.android.synthetic.main.taxi_debug_order.view.orderPreLoadLines -import kotlinx.android.synthetic.main.taxi_debug_order.view.orderStartSiteInfo -import kotlinx.android.synthetic.main.taxi_debug_order.view.orderStatus -import kotlinx.android.synthetic.main.taxi_debug_order.view.taskEndSite -import kotlinx.android.synthetic.main.taxi_debug_order.view.taskStartSite -import kotlinx.android.synthetic.main.taxi_debug_order.view.unmanedTaskOrderContainer +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.btnContainer +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentBusinessModeTextView +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentCarStatus +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentDataTimestamps +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentLineId +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentOrder +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentOrderStopInfo +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentOrderTrajectoryInfo +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentOrderTrajectoryTime +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentStatus +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.currentTaskType +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.debugLogHistoryTextView +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.debugLogTitleTextView +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.lastQuerySuccessDataTimestamps +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.orderEndSiteInfo +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.orderNo +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.orderPreLoadLines +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.orderStartSiteInfo +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.orderStatus +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.taskEndSite +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.taskStartSite +import kotlinx.android.synthetic.main.unmanned_taxi_debug_order.view.unmanedTaskOrderContainer import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -151,7 +151,7 @@ public class DebugView @JvmOverloads constructor( init { initBroadcastReceiver() - LayoutInflater.from(context).inflate(R.layout.taxi_debug_order, this, true) + LayoutInflater.from(context).inflate(R.layout.unmanned_taxi_debug_order, this, true) debugLogHistoryTextView.movementMethod = ScrollingMovementMethod.getInstance() visibility = GONE logHistoryTextView = debugLogHistoryTextView diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/amap/TaxiAmapNaviFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/amap/TaxiAmapNaviFragment.kt index 2d1c1f5741..2115cb0320 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/amap/TaxiAmapNaviFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/amap/TaxiAmapNaviFragment.kt @@ -6,7 +6,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.och.common.module.map.AmapNaviToDestinationModel import com.mogo.och.unmanned.taxi.R -import kotlinx.android.synthetic.main.taxi_amap_navi_view.navi_view +import kotlinx.android.synthetic.main.unmanned_taxi_amap_navi_view.navi_view /** * @author: wangmingjun @@ -25,7 +25,7 @@ class TaxiAmapNaviFragment : BaseFragment(){ } override fun getLayoutId(): Int { - return R.layout.taxi_amap_navi_view + return R.layout.unmanned_taxi_amap_navi_view } override fun getTagName(): String { diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/auto/TaxiMapDirectionView.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/auto/TaxiMapDirectionView.kt index d17ba99605..1abfd67797 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/auto/TaxiMapDirectionView.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/auto/TaxiMapDirectionView.kt @@ -63,7 +63,7 @@ class TaxiMapDirectionView @JvmOverloads constructor( private fun initView(context: Context) { d(SceneConstant.M_TAXI + TAG, "initView") - val smpView = LayoutInflater.from(context).inflate(R.layout.taxi_map_view, this) + val smpView = LayoutInflater.from(context).inflate(R.layout.unmanned_taxi_map_view, this) mAMapNaviView = smpView.findViewById(R.id.taxi_amap_view) initAMapView() diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/auto/TaxiRoutingNaviFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/auto/TaxiRoutingNaviFragment.kt index fc561fc693..9060981a3b 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/auto/TaxiRoutingNaviFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/navi/auto/TaxiRoutingNaviFragment.kt @@ -17,7 +17,7 @@ class TaxiRoutingNaviFragment : MvpFragment(){ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TaskItemViewHolder { - var view = LayoutInflater.from(context).inflate(R.layout.taxi_task_list_item, parent, false) + var view = LayoutInflater.from(context).inflate(R.layout.unmanned_taxi_task_list_item, parent, false) return TaskItemViewHolder(view) } @@ -80,7 +80,7 @@ class OrderListAdapter(val context: Context, private var currentViewHolder: OrderItemViewHolder? = null override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): OrderItemViewHolder { - val view = LayoutInflater.from(context).inflate(R.layout.taxi_order_list_item, parent, false) + val view = LayoutInflater.from(context).inflate(R.layout.unmanned_taxi_order_list_item, parent, false) return OrderItemViewHolder(view) } @@ -237,7 +237,7 @@ class OrderTaskDetailListAdapter(val context: Context, private val dataList: MutableList?) :RecyclerView.Adapter(){ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TaskDetailViewHolder { - val view = LayoutInflater.from(context).inflate(R.layout.order_task_detail_list_item, parent, false) + val view = LayoutInflater.from(context).inflate(R.layout.unmanned_order_task_detail_list_item, parent, false) return TaskDetailViewHolder(view) } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/operational/TaxiOperationalDialogFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/operational/TaxiOperationalDialogFragment.kt index 512440c415..f7b40c9862 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/operational/TaxiOperationalDialogFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/operational/TaxiOperationalDialogFragment.kt @@ -27,16 +27,16 @@ import com.mogo.och.unmanned.taxi.bean.QueryTaskRespBean import com.mogo.och.unmanned.taxi.constant.StationTypeEnum import com.mogo.och.unmanned.taxi.constant.TaskTypeEnum import com.mogo.och.unmanned.taxi.ui.task.TaxiCurrentTaskFragment -import kotlinx.android.synthetic.main.taxi_operational_data_view.dayCompletedOrdersView -import kotlinx.android.synthetic.main.taxi_operational_data_view.dayTotalOrdersView -import kotlinx.android.synthetic.main.taxi_operational_data_view.itemDayTv -import kotlinx.android.synthetic.main.taxi_operational_data_view.operationalDataCloseIv -import kotlinx.android.synthetic.main.taxi_operational_data_view.operationDataTitle -import kotlinx.android.synthetic.main.taxi_operational_data_view.operationItemRecyclerView -import kotlinx.android.synthetic.main.taxi_operational_data_view.operationalDataView -import kotlinx.android.synthetic.main.taxi_operational_data_view.operationalDetailView -import kotlinx.android.synthetic.main.taxi_operational_data_view.scheduledTasksView -import kotlinx.android.synthetic.main.taxi_operational_data_view.servingDurationView +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.dayCompletedOrdersView +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.dayTotalOrdersView +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.itemDayTv +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.operationalDataCloseIv +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.operationDataTitle +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.operationItemRecyclerView +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.operationalDataView +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.operationalDetailView +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.scheduledTasksView +import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_view.servingDurationView import kotlinx.coroutines.flow.map /** @@ -70,7 +70,7 @@ class TaxiOperationalDialogFragment : DialogFragment(), container: ViewGroup?, savedInstanceState: Bundle? ): View? { - return inflater.inflate(R.layout.taxi_operational_data_view, container, false ) + return inflater.inflate(R.layout.unmanned_taxi_operational_data_view, container, false ) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt index 6a7b72c481..6b2d3310d6 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineActivity.kt @@ -18,10 +18,10 @@ import com.mogo.och.unmanned.taxi.R import com.mogo.och.unmanned.taxi.bean.GrayLineBean import com.mogo.och.unmanned.taxi.constant.TaxiDriverEventConst import com.mogo.och.unmanned.taxi.ui.debug.DebugView -import kotlinx.android.synthetic.main.routing_choose_task_activity.btnChooseLineSubmit -import kotlinx.android.synthetic.main.routing_choose_task_activity.btnClose -import kotlinx.android.synthetic.main.routing_choose_task_activity.chooseLineListView -import kotlinx.android.synthetic.main.routing_no_data_common_view.noDataContainer +import kotlinx.android.synthetic.main.unmanned_routing_choose_task_activity.btnChooseLineSubmit +import kotlinx.android.synthetic.main.unmanned_routing_choose_task_activity.btnClose +import kotlinx.android.synthetic.main.unmanned_routing_choose_task_activity.chooseLineListView +import kotlinx.android.synthetic.main.unmanned_routing_no_data_common_view.noDataContainer import kotlinx.coroutines.flow.map class TaxiRoutingChooseLineActivity : AppCompatActivity() { @@ -49,7 +49,7 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.routing_choose_task_activity) + setContentView(R.layout.unmanned_routing_choose_task_activity) initWindowParams() initView() initViewListener() diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt index 57c1e5128d..97eb4bf2b5 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingChooseLineAdapter.kt @@ -24,7 +24,7 @@ class TaxiRoutingChooseLineAdapter( override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SwitchLineViewHolder { val view = LayoutInflater.from(mContext).inflate( - R.layout.routing_choose_line_list_item, parent, false + R.layout.unmanned_routing_choose_line_list_item, parent, false ) return SwitchLineViewHolder(view) } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingFeedbackDialog.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingFeedbackDialog.kt index b24e18b4bb..8113ced685 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingFeedbackDialog.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingFeedbackDialog.kt @@ -23,7 +23,7 @@ class TaxiRoutingFeedbackDialog : BaseFloatDialog, LifecycleObserver { } init { - setContentView(R.layout.dialog_routing_feedback_result) + setContentView(R.layout.unmanned_dialog_routing_feedback_result) setCanceledOnTouchOutside(true) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingFragment.kt index d911191245..e2e9389a7f 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingFragment.kt @@ -21,22 +21,22 @@ import com.mogo.och.unmanned.taxi.constant.TaxiDriverEventConst import com.mogo.och.unmanned.taxi.constant.TaxiUnmannedConst import com.mogo.och.unmanned.taxi.utils.MapMakerManager import com.mogo.och.unmanned.taxi.utils.TaskUtils -import kotlinx.android.synthetic.main.routing_fragment.btnChooseTask -import kotlinx.android.synthetic.main.routing_fragment.btnFinishTask -import kotlinx.android.synthetic.main.routing_fragment.btnStartTask -import kotlinx.android.synthetic.main.routing_fragment.btnSummitIssue -import kotlinx.android.synthetic.main.routing_fragment.endPoint -import kotlinx.android.synthetic.main.routing_fragment.endStationName -import kotlinx.android.synthetic.main.routing_fragment.finishSubmitIssueGroup -import kotlinx.android.synthetic.main.routing_fragment.headerTitleContainer -import kotlinx.android.synthetic.main.routing_fragment.mCurrentTaskLayout -import kotlinx.android.synthetic.main.routing_fragment.naviToEnd -import kotlinx.android.synthetic.main.routing_fragment.naviToStart -import kotlinx.android.synthetic.main.routing_fragment.noDataContainer -import kotlinx.android.synthetic.main.routing_fragment.startPoint -import kotlinx.android.synthetic.main.routing_fragment.startStationName -import kotlinx.android.synthetic.main.routing_fragment.taskTitleTv -import kotlinx.android.synthetic.main.routing_fragment.taskTripInfo +import kotlinx.android.synthetic.main.unmanned_routing_fragment.btnChooseTask +import kotlinx.android.synthetic.main.unmanned_routing_fragment.btnFinishTask +import kotlinx.android.synthetic.main.unmanned_routing_fragment.btnStartTask +import kotlinx.android.synthetic.main.unmanned_routing_fragment.btnSummitIssue +import kotlinx.android.synthetic.main.unmanned_routing_fragment.endPoint +import kotlinx.android.synthetic.main.unmanned_routing_fragment.endStationName +import kotlinx.android.synthetic.main.unmanned_routing_fragment.finishSubmitIssueGroup +import kotlinx.android.synthetic.main.unmanned_routing_fragment.headerTitleContainer +import kotlinx.android.synthetic.main.unmanned_routing_fragment.mCurrentTaskLayout +import kotlinx.android.synthetic.main.unmanned_routing_fragment.naviToEnd +import kotlinx.android.synthetic.main.unmanned_routing_fragment.naviToStart +import kotlinx.android.synthetic.main.unmanned_routing_fragment.noDataContainer +import kotlinx.android.synthetic.main.unmanned_routing_fragment.startPoint +import kotlinx.android.synthetic.main.unmanned_routing_fragment.startStationName +import kotlinx.android.synthetic.main.unmanned_routing_fragment.taskTitleTv +import kotlinx.android.synthetic.main.unmanned_routing_fragment.taskTripInfo import kotlinx.coroutines.flow.map class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback { @@ -62,7 +62,7 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback { } override fun getLayoutId(): Int { - return R.layout.routing_fragment + return R.layout.unmanned_routing_fragment } override fun getTagName(): String { diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingLoadingDialog.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingLoadingDialog.kt index 5f1e714142..1d1be9867c 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingLoadingDialog.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/routing/TaxiRoutingLoadingDialog.kt @@ -7,8 +7,8 @@ import androidx.lifecycle.LifecycleObserver import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.och.unmanned.taxi.R -import kotlinx.android.synthetic.main.dialog_routing_loading.dialog_loading_text -import kotlinx.android.synthetic.main.dialog_routing_loading.dialog_loading_view +import kotlinx.android.synthetic.main.unmanned_dialog_routing_loading.dialog_loading_text +import kotlinx.android.synthetic.main.unmanned_dialog_routing_loading.dialog_loading_view /** * loading @@ -25,7 +25,7 @@ class TaxiRoutingLoadingDialog : BaseFloatDialog, LifecycleObserver { constructor(context: Context) : super(context) init { - setContentView(R.layout.dialog_routing_loading) + setContentView(R.layout.unmanned_dialog_routing_loading) setCanceledOnTouchOutside(false) } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiCurrentTaskFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiCurrentTaskFragment.kt index 49bae99a58..dd6dfc911f 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiCurrentTaskFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiCurrentTaskFragment.kt @@ -42,24 +42,24 @@ import com.mogo.och.unmanned.taxi.constant.TaxiUnmannedConst.Companion.TAXI_STAR import com.mogo.och.unmanned.taxi.constant.TaxiUnmannedConst.Companion.TYPE_MARKER_TAXI_ORDER import com.mogo.och.unmanned.taxi.utils.MapMakerManager import com.mogo.och.unmanned.taxi.utils.TaskUtils -import kotlinx.android.synthetic.main.task_fragment_current.cancelOrder -import kotlinx.android.synthetic.main.task_fragment_current.endPoint -import kotlinx.android.synthetic.main.task_fragment_current.endStationName -import kotlinx.android.synthetic.main.task_fragment_current.mCurrentTaskLayout -import kotlinx.android.synthetic.main.task_fragment_current.naviToEnd -import kotlinx.android.synthetic.main.task_fragment_current.naviToStart -import kotlinx.android.synthetic.main.task_fragment_current.noTaskData -import kotlinx.android.synthetic.main.task_fragment_current.orderPhoneAndNum -import kotlinx.android.synthetic.main.task_fragment_current.pathwayPoint -import kotlinx.android.synthetic.main.task_fragment_current.startPoint -import kotlinx.android.synthetic.main.task_fragment_current.startStationName -import kotlinx.android.synthetic.main.task_fragment_current.taskClickBtn -import kotlinx.android.synthetic.main.task_fragment_current.taskOtherInfo -import kotlinx.android.synthetic.main.task_fragment_current.taskStatus -import kotlinx.android.synthetic.main.task_fragment_current.taskTypeTv -import kotlinx.android.synthetic.main.task_fragment_current.trajectoryType -import kotlinx.android.synthetic.main.taxi_no_data_common_view.noOrderDataTv -import kotlinx.android.synthetic.main.taxi_no_data_common_view.prepareTaskCountdownTv +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.cancelOrder +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.endPoint +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.endStationName +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.mCurrentTaskLayout +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.naviToEnd +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.naviToStart +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.noTaskData +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.orderPhoneAndNum +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.pathwayPoint +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.startPoint +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.startStationName +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.taskClickBtn +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.taskOtherInfo +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.taskStatus +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.taskTypeTv +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.trajectoryType +import kotlinx.android.synthetic.main.unmanned_taxi_no_data_common_view.noOrderDataTv +import kotlinx.android.synthetic.main.unmanned_taxi_no_data_common_view.prepareTaskCountdownTv import kotlinx.coroutines.flow.map /** @@ -85,7 +85,7 @@ class TaxiCurrentTaskFragment : BaseFragment(), } override fun getLayoutId(): Int { - return R.layout.task_fragment_current + return R.layout.unmanned_task_fragment_current } override fun getTagName(): String { diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiNextTaskFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiNextTaskFragment.kt index cef28b81e6..39d198aacd 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiNextTaskFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiNextTaskFragment.kt @@ -15,17 +15,17 @@ import com.mogo.och.unmanned.taxi.bean.QueryCurrentTaskRespBean import com.mogo.och.unmanned.taxi.constant.TaskStatusEnum import com.mogo.och.unmanned.taxi.constant.TaskTypeEnum import com.mogo.och.unmanned.taxi.utils.TaskUtils -import kotlinx.android.synthetic.main.task_fragment_current.cancelOrder -import kotlinx.android.synthetic.main.task_fragment_current.endStationName -import kotlinx.android.synthetic.main.task_fragment_current.mCurrentTaskLayout -import kotlinx.android.synthetic.main.task_fragment_current.naviToEnd -import kotlinx.android.synthetic.main.task_fragment_current.naviToStart -import kotlinx.android.synthetic.main.task_fragment_current.noTaskData -import kotlinx.android.synthetic.main.task_fragment_current.orderPhoneAndNum -import kotlinx.android.synthetic.main.task_fragment_current.startStationName -import kotlinx.android.synthetic.main.task_fragment_current.taskClickBtn -import kotlinx.android.synthetic.main.task_fragment_current.taskOtherInfo -import kotlinx.android.synthetic.main.task_fragment_current.taskTypeTv +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.cancelOrder +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.endStationName +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.mCurrentTaskLayout +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.naviToEnd +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.naviToStart +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.noTaskData +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.orderPhoneAndNum +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.startStationName +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.taskClickBtn +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.taskOtherInfo +import kotlinx.android.synthetic.main.unmanned_task_fragment_current.taskTypeTv /** * @author: wangmingjun @@ -43,7 +43,7 @@ class TaxiNextTaskFragment : BaseFragment() { } override fun getLayoutId(): Int { - return R.layout.task_fragment_current + return R.layout.unmanned_task_fragment_current } override fun getTagName(): String { diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiOrderCancelDialog.java b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiOrderCancelDialog.java index 2b6f62a4b5..58fdc7d207 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiOrderCancelDialog.java +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiOrderCancelDialog.java @@ -25,8 +25,6 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.och.unmanned.taxi.R; import com.mogo.och.unmanned.taxi.constant.TaxiOrderCancelReasons; import com.mogo.och.unmanned.taxi.constant.TaxiOrderStatusEnum; -import com.mogo.och.unmanned.taxi.constant.TaxiOrderCancelReasons; -import com.mogo.och.unmanned.taxi.constant.TaxiOrderStatusEnum; import java.lang.ref.WeakReference; @@ -91,7 +89,7 @@ public class TaxiOrderCancelDialog extends AlertDialog implements View.OnClickLi protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setBackgroundDrawableResource(R.drawable.taxi_order_cancel_dialog_bg); - setContentView(R.layout.taxi_order_cancel_view); + setContentView(R.layout.unmanned_taxi_order_cancel_view); initView(); setCancelable(false); setCanceledOnTouchOutside(false); @@ -187,7 +185,7 @@ public class TaxiOrderCancelDialog extends AlertDialog implements View.OnClickLi public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder = null; if (convertView == null) { - convertView = layoutInflater.inflate(R.layout.taxi_order_checkbox_item, null); + convertView = layoutInflater.inflate(R.layout.unmanned_taxi_order_checkbox_item, null); viewHolder = new ViewHolder(); viewHolder.checkBoxTv = convertView.findViewById(R.id.item_checkbox); convertView.setTag(viewHolder); diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskTabFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskTabFragment.kt index 01663e996a..c56428bc34 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskTabFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskTabFragment.kt @@ -19,9 +19,9 @@ import com.mogo.och.common.module.utils.FlowBus import com.mogo.och.unmanned.taxi.R import com.mogo.och.unmanned.taxi.bean.QueryCurrentTaskRespBean import com.mogo.och.unmanned.taxi.constant.TaxiDriverEventConst -import kotlinx.android.synthetic.main.taxi_server_orders_panel.module_och_taxi_tab -import kotlinx.android.synthetic.main.taxi_server_orders_panel.module_och_taxi_view_pager -import kotlinx.android.synthetic.main.taxi_server_orders_panel.wait_order_num +import kotlinx.android.synthetic.main.unmanned_taxi_server_orders_panel.module_och_taxi_tab +import kotlinx.android.synthetic.main.unmanned_taxi_server_orders_panel.module_och_taxi_view_pager +import kotlinx.android.synthetic.main.unmanned_taxi_server_orders_panel.wait_order_num import me.jessyan.autosize.utils.AutoSizeUtils /** @@ -58,7 +58,7 @@ class TaxiTaskTabFragment : BaseFragment() { private var nextTaskFragment: TaxiNextTaskFragment? = null override fun getLayoutId(): Int { - return R.layout.taxi_server_orders_panel + return R.layout.unmanned_taxi_server_orders_panel } override fun getTagName(): String { @@ -75,7 +75,7 @@ class TaxiTaskTabFragment : BaseFragment() { val tab = module_och_taxi_tab.newTab() tab.view.setBackgroundColor(Color.parseColor("#00000000")) val tabView = - View.inflate(activity, R.layout.taxi_tab_item_custom, null) as TextView + View.inflate(activity, R.layout.unmanned_taxi_tab_item_custom, null) as TextView tabView.text = mTabTitles[position] tabView.height = AutoSizeUtils.dp2px(context, 115f) tab.customView = tabView diff --git a/OCH/taxi/unmanned-driver/src/main/res/layout/dialog_routing_feedback_result.xml b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_dialog_routing_feedback_result.xml similarity index 100% rename from OCH/taxi/unmanned-driver/src/main/res/layout/dialog_routing_feedback_result.xml rename to OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_dialog_routing_feedback_result.xml diff --git a/OCH/taxi/unmanned-driver/src/main/res/layout/dialog_routing_loading.xml b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_dialog_routing_loading.xml similarity index 100% rename from OCH/taxi/unmanned-driver/src/main/res/layout/dialog_routing_loading.xml rename to OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_dialog_routing_loading.xml diff --git a/OCH/taxi/unmanned-driver/src/main/res/layout/order_task_detail_list_item.xml b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_order_task_detail_list_item.xml similarity index 100% rename from OCH/taxi/unmanned-driver/src/main/res/layout/order_task_detail_list_item.xml rename to OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_order_task_detail_list_item.xml diff --git a/OCH/taxi/unmanned-driver/src/main/res/layout/routing_choose_line_list_item.xml b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_routing_choose_line_list_item.xml similarity index 100% rename from OCH/taxi/unmanned-driver/src/main/res/layout/routing_choose_line_list_item.xml rename to OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_routing_choose_line_list_item.xml diff --git a/OCH/taxi/unmanned-driver/src/main/res/layout/routing_choose_task_activity.xml b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_routing_choose_task_activity.xml similarity index 98% rename from OCH/taxi/unmanned-driver/src/main/res/layout/routing_choose_task_activity.xml rename to OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_routing_choose_task_activity.xml index 95aa167e16..cd88c03410 100644 --- a/OCH/taxi/unmanned-driver/src/main/res/layout/routing_choose_task_activity.xml +++ b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_routing_choose_task_activity.xml @@ -66,7 +66,7 @@ app:layout_constraintRight_toRightOf="parent" />