[自主算路验证] feat: 增加2种模式切换,选择路线页面等逻辑;

This commit is contained in:
aibingbing
2023-11-16 21:09:22 +08:00
parent 632255913b
commit 1c6db3ebaf
27 changed files with 1546 additions and 13 deletions

View File

@@ -1,5 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.och.taxi">
/
<application>
<activity android:name=".ui.routing.TaxiRoutingChooseLineActivity"
android:theme="@style/RoutingChooseLineDialogStyle"
android:launchMode="singleTask"
android:screenOrientation="landscape" />
</application>
</manifest>

View File

@@ -0,0 +1,22 @@
package com.mogo.och.taxi.bean;
import com.mogo.eagle.core.data.BaseData;
import java.util.List;
/**
* @author: wangmingjun
* @date: 2022/2/9
*/
public class TaxiRoutingQueryLineResponse extends BaseData {
public List<Result> data;
public static class Result {
public int lineId;//线路id
public String name;//线路名字
public int todayVerifyNum;//本车今天验证次数
public int historyVerifyTotalUsableNum;//历史累计验证可用次数
public int historyVerifyTotalNotUsableNum;//历史累计验证不可用次数
public boolean isChoosed;//当前是否选中
}
}

View File

@@ -8,11 +8,13 @@ import android.view.ViewGroup
import androidx.fragment.app.FragmentTransaction
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.commons.module.status.StatusDescriptor
import com.mogo.eagle.core.data.temp.EventLogout
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.provider.LoginService
import com.mogo.och.common.module.utils.FlowBus
@@ -21,6 +23,7 @@ import com.mogo.och.taxi.constant.TaxiDriverEventConst
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum
import com.mogo.och.taxi.network.TaxiDriverLoginImpl
import com.mogo.och.taxi.ui.operational.TaxiOperationalDialogFragment
import com.mogo.och.taxi.ui.routing.TaxiRoutingFragment
import com.mogo.och.taxi.ui.task.TaxiTaskModel
import com.mogo.och.taxi.ui.task.TaxiTaskTabFragment
import com.mogo.och.taxi.utils.TPRouteDataTestUtils
@@ -45,6 +48,7 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
private var taskTabFragment: WeakReference<TaxiTaskTabFragment>? = null
private var personalDialogFragment: WeakReference<TaxiOperationalDialogFragment>? = null
private var routingVerifyFragment: WeakReference<TaxiRoutingFragment>? = null
private var loginService: LoginService? = null
@Subscribe(threadMode = ThreadMode.MAIN)
@@ -151,15 +155,53 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
}
private fun initFragment() {
taskTabFragment = WeakReference(TaxiTaskTabFragment.newInstance())
showTaskFragment()
MogoStatusManager.getInstance()
.registerStatusChangedListener(
TAG, StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE
) { descriptor, isTrue ->
if (StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE == descriptor) {
UiThreadHandler.post {
if (isTrue) {
showRoutingFragment()
} else {
showTaskFragment()
}
}
}
}
}
private fun showTaskFragment() {
val transaction: FragmentTransaction = childFragmentManager.beginTransaction()
//默认显示OCHTaxiServerOrdersFragment
taskTabFragment?.get()?.let {
transaction.add(R.id.fragment_container, it).show(
it
)
if (routingVerifyFragment?.get()?.isVisible == true) {
routingVerifyFragment?.get()?.also {
transaction.hide(it)
}
}
if (taskTabFragment?.get() == null) {
taskTabFragment = WeakReference(TaxiTaskTabFragment.newInstance())
}
taskTabFragment?.get()?.also {
transaction.replace(R.id.fragment_container, it).show(it)
transaction.commitAllowingStateLoss()
}
}
private fun showRoutingFragment() {
val transaction: FragmentTransaction = childFragmentManager.beginTransaction()
if (taskTabFragment?.get()?.isVisible == true) {
taskTabFragment?.get()?.also {
transaction.hide(it)
}
}
if (routingVerifyFragment?.get() == null) {
routingVerifyFragment = WeakReference(TaxiRoutingFragment.newInstance())
}
routingVerifyFragment?.get()?.also {
transaction.replace(R.id.fragment_container, it).show(it)
transaction.commitAllowingStateLoss()
}
transaction.commitAllowingStateLoss()
}
override fun createPresenter(): TaxiPresenter {

View File

@@ -0,0 +1,137 @@
package com.mogo.och.taxi.ui.routing
import android.graphics.Point
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.taxi.R
import com.mogo.och.taxi.bean.TaxiRoutingQueryLineResponse
import kotlinx.android.synthetic.main.routing_choose_line_activity.btnChooseLineSubmit
import kotlinx.android.synthetic.main.routing_choose_line_activity.btnClose
import kotlinx.android.synthetic.main.routing_choose_line_activity.chooseLineListView
import kotlinx.android.synthetic.main.routing_no_data_common_view.noDataContainer
import kotlinx.android.synthetic.main.taxi_debug_order.currentLineId
class TaxiRoutingChooseLineActivity : AppCompatActivity() {
companion object {
const val TAG = "TaxiRoutingChooseLineActivity"
}
private lateinit var mChooseLineListAdapter: TaxiRoutingChooseLineAdapter
private lateinit var mLinearLayoutManager: LinearLayoutManager
private val mRoutingLineList: MutableList<TaxiRoutingQueryLineResponse.Result> = ArrayList()
private var mCurrentChoosedLineId: Int? = -1
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.routing_choose_line_activity)
initWindowParams()
initView()
loadData()
}
private fun initWindowParams() {
val window = window
val params = window.attributes
val windowManager = getSystemService(WINDOW_SERVICE) as WindowManager
val point = Point()
windowManager.defaultDisplay.getSize(point) //用于获取屏幕高度
params.width = (point.x * 0.375).toInt()
params.height = ViewGroup.LayoutParams.MATCH_PARENT
window.attributes = params
window.setGravity(Gravity.START or Gravity.BOTTOM)
}
private fun initView() {
mLinearLayoutManager = LinearLayoutManager(this)
chooseLineListView.layoutManager = mLinearLayoutManager
chooseLineListView.itemAnimator =
TaxiRoutingChooseLineItemOpenAnimator()
mChooseLineListAdapter = TaxiRoutingChooseLineAdapter(applicationContext, mRoutingLineList)
chooseLineListView.addItemDecoration(SpacesItemDecoration(4))
chooseLineListView.adapter = mChooseLineListAdapter
//设置item 点击事件
mChooseLineListAdapter.setOnLineItemClickListener(object :
TaxiRoutingChooseLineAdapter.OnChooseLineItemClickListener {
override fun onItemClick(position: Int, close: Boolean) {
mCurrentChoosedLineId = mRoutingLineList[position].lineId
}
})
btnClose.setOnClickListener {
finish()
}
btnChooseLineSubmit.setOnClickListener {
if (mCurrentChoosedLineId == -1) {
ToastUtils.showLong("请先选择任务")
return@setOnClickListener
}
ToastUtils.showLong("当前选择的路线LineId:$currentLineId")
}
}
private fun showEmptyView() {
chooseLineListView.visibility = View.GONE
btnChooseLineSubmit.visibility = View.GONE
noDataContainer.visibility = View.VISIBLE
}
private fun showRecyclerView() {
chooseLineListView.visibility = View.VISIBLE
btnChooseLineSubmit.visibility = View.VISIBLE
noDataContainer.visibility = View.GONE
}
/**
* 初始化数据
*/
private fun loadData() {
//TODO
for (i in 1..10) {
val result = TaxiRoutingQueryLineResponse.Result()
result.lineId = i
result.name = "路线名称$i"
result.todayVerifyNum = 2
result.historyVerifyTotalUsableNum = 5
result.historyVerifyTotalNotUsableNum = 1
result.isChoosed = false
mRoutingLineList.add(result)
}
if (mRoutingLineList.isEmpty()) {
showEmptyView()
} else {
showRecyclerView()
mChooseLineListAdapter.notifyDataSetChanged()
}
}
fun onRoutingLineDataChanged(data: TaxiRoutingQueryLineResponse?) {
if (data?.data?.isNotEmpty() == true) {
showRecyclerView()
mRoutingLineList.clear()
mRoutingLineList.addAll(data.data)
mChooseLineListAdapter.notifyDataSetChanged()
} else {
showEmptyView()
}
}
fun onChangeLineIdSuccess() {
//ToastUtils.showLong(resources.getString(R.string.bus_change_line_commit_tip_s))
//mPresenter?.queryBusRoutes()
mChooseLineListAdapter.setOnLineItemClickListener(null)
//mPresenter?.removeListener()
finish()
}
override fun onDestroy() {
super.onDestroy()
}
}

View File

@@ -0,0 +1,80 @@
package com.mogo.och.taxi.ui.routing
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.AppCompatTextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.och.taxi.R
import com.mogo.och.taxi.bean.TaxiRoutingQueryLineResponse
class TaxiRoutingChooseLineAdapter(
private val mContext: Context,
private val mData: List<TaxiRoutingQueryLineResponse.Result>
) : RecyclerView.Adapter<TaxiRoutingChooseLineAdapter.SwitchLineViewHolder>() {
companion object {
const val TAG = "TaxiRoutingChooseLineAdapter"
}
private var mItemClickListener: OnChooseLineItemClickListener? = null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SwitchLineViewHolder {
val view = LayoutInflater.from(mContext).inflate(
R.layout.routing_choose_line_list_item, parent, false
)
return SwitchLineViewHolder(view)
}
override fun onBindViewHolder(holder: SwitchLineViewHolder, position: Int) {
val currentPosition = holder.bindingAdapterPosition
val data = mData[currentPosition]
holder.lineNameTextView.text = data.name
holder.todayVerifyNumTextView.text = "本车今日已验证:${data.todayVerifyNum}"
holder.historyVerifyNumTextView.text =
"路线累计反馈${data.historyVerifyTotalUsableNum}可用,${data.historyVerifyTotalNotUsableNum}不可用"
if (data.isChoosed) {
holder.itemView.setBackgroundResource(R.drawable.routing_choose_line_shape_select_line_item_bg_selected)
} else {
holder.itemView.setBackgroundResource(R.drawable.routing_choose_line_shape_select_line_item_bg_normal)
}
//设置item点击事件
holder.itemView.setOnClickListener {
mData.forEachIndexed { index, result ->
if (result.isChoosed) {
result.isChoosed = false
}
}
mData[currentPosition].isChoosed = true
notifyItemChanged(currentPosition)
mItemClickListener?.onItemClick(currentPosition, false)
}
}
override fun getItemCount(): Int {
return mData.size
}
fun setOnLineItemClickListener(itemClickListener: OnChooseLineItemClickListener?) {
mItemClickListener = itemClickListener
}
interface OnChooseLineItemClickListener {
fun onItemClick(position: Int, close: Boolean)
}
class SwitchLineViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val lineNameTextView: AppCompatTextView//线路名称
val todayVerifyNumTextView: AppCompatTextView //本车今天验证次数
val historyVerifyNumTextView: AppCompatTextView //路线累计验证次数
init {
lineNameTextView = itemView.findViewById(R.id.switchLineNameTextView)
todayVerifyNumTextView = itemView.findViewById(R.id.todayVerifyNumTextView)
historyVerifyNumTextView = itemView.findViewById(R.id.historyVerifyNumTextView)
}
}
}

View File

@@ -0,0 +1,641 @@
package com.mogo.och.taxi.ui.routing;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.view.View;
import android.view.ViewPropertyAnimator;
import androidx.annotation.NonNull;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
/**
* This implementation of {@link RecyclerView.ItemAnimator} provides basic
* animations on remove, add, and move events that happen to the items in
* a RecyclerView. RecyclerView uses a DefaultItemAnimator by default.
*
* @see RecyclerView#setItemAnimator(RecyclerView.ItemAnimator)
*/
public class TaxiRoutingChooseLineItemOpenAnimator extends DefaultItemAnimator {
private static final boolean DEBUG = false;
private static TimeInterpolator sDefaultInterpolator;
private final ArrayList<RecyclerView.ViewHolder> mPendingRemovals = new ArrayList<>();
private final ArrayList<RecyclerView.ViewHolder> mPendingAdditions = new ArrayList<>();
private final ArrayList<MoveInfo> mPendingMoves = new ArrayList<>();
private final ArrayList<ChangeInfo> mPendingChanges = new ArrayList<>();
private final ArrayList<ArrayList<RecyclerView.ViewHolder>> mAdditionsList = new ArrayList<>();
private final ArrayList<ArrayList<MoveInfo>> mMovesList = new ArrayList<>();
private final ArrayList<ArrayList<ChangeInfo>> mChangesList = new ArrayList<>();
private final ArrayList<RecyclerView.ViewHolder> mAddAnimations = new ArrayList<>();
private final ArrayList<RecyclerView.ViewHolder> mMoveAnimations = new ArrayList<>();
private final ArrayList<RecyclerView.ViewHolder> mRemoveAnimations = new ArrayList<>();
private final ArrayList<RecyclerView.ViewHolder> mChangeAnimations = new ArrayList<>();
private static class MoveInfo {
public RecyclerView.ViewHolder holder;
public int fromX, fromY, toX, toY;
MoveInfo(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) {
this.holder = holder;
this.fromX = fromX;
this.fromY = fromY;
this.toX = toX;
this.toY = toY;
}
}
private static class ChangeInfo {
public RecyclerView.ViewHolder oldHolder, newHolder;
public int fromX, fromY, toX, toY;
private ChangeInfo(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder) {
this.oldHolder = oldHolder;
this.newHolder = newHolder;
}
ChangeInfo(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder,
int fromX, int fromY, int toX, int toY) {
this(oldHolder, newHolder);
this.fromX = fromX;
this.fromY = fromY;
this.toX = toX;
this.toY = toY;
}
@Override
public String toString() {
return "ChangeInfo{"
+ "oldHolder=" + oldHolder
+ ", newHolder=" + newHolder
+ ", fromX=" + fromX
+ ", fromY=" + fromY
+ ", toX=" + toX
+ ", toY=" + toY
+ '}';
}
}
@Override
public void runPendingAnimations() {
boolean removalsPending = !mPendingRemovals.isEmpty();
boolean movesPending = !mPendingMoves.isEmpty();
boolean changesPending = !mPendingChanges.isEmpty();
boolean additionsPending = !mPendingAdditions.isEmpty();
if (!removalsPending && !movesPending && !additionsPending && !changesPending) {
// nothing to animate
return;
}
// First, remove stuff
for (RecyclerView.ViewHolder holder : mPendingRemovals) {
animateRemoveImpl(holder);
}
mPendingRemovals.clear();
// Next, move stuff
if (movesPending) {
final ArrayList<MoveInfo> moves = new ArrayList<>(mPendingMoves);
mMovesList.add(moves);
mPendingMoves.clear();
Runnable mover = () -> {
for (MoveInfo moveInfo : moves) {
animateMoveImpl(moveInfo.holder, moveInfo.fromX, moveInfo.fromY,
moveInfo.toX, moveInfo.toY);
}
moves.clear();
mMovesList.remove(moves);
};
if (removalsPending) {
View view = moves.get(0).holder.itemView;
ViewCompat.postOnAnimationDelayed(view, mover, getRemoveDuration());
} else {
mover.run();
}
}
// Next, change stuff, to run in parallel with move animations
if (changesPending) {
final ArrayList<ChangeInfo> changes = new ArrayList<>(mPendingChanges);
mChangesList.add(changes);
mPendingChanges.clear();
Runnable changer = () -> {
for (ChangeInfo change : changes) {
animateChangeImpl(change);
}
changes.clear();
mChangesList.remove(changes);
};
if (removalsPending) {
RecyclerView.ViewHolder holder = changes.get(0).oldHolder;
ViewCompat.postOnAnimationDelayed(holder.itemView, changer, getRemoveDuration());
} else {
changer.run();
}
}
// Next, add stuff
if (additionsPending) {
final ArrayList<RecyclerView.ViewHolder> additions = new ArrayList<>(mPendingAdditions);
mAdditionsList.add(additions);
mPendingAdditions.clear();
Runnable adder = () -> {
for (RecyclerView.ViewHolder holder : additions) {
animateAddImpl(holder);
}
additions.clear();
mAdditionsList.remove(additions);
};
if (removalsPending || movesPending || changesPending) {
long removeDuration = removalsPending ? getRemoveDuration() : 0;
long moveDuration = movesPending ? getMoveDuration() : 0;
long changeDuration = changesPending ? getChangeDuration() : 0;
long totalDelay = removeDuration + Math.max(moveDuration, changeDuration);
View view = additions.get(0).itemView;
ViewCompat.postOnAnimationDelayed(view, adder, totalDelay);
} else {
adder.run();
}
}
}
@Override
public boolean animateRemove(final RecyclerView.ViewHolder holder) {
resetAnimation(holder);
mPendingRemovals.add(holder);
return true;
}
private void animateRemoveImpl(final RecyclerView.ViewHolder holder) {
final View view = holder.itemView;
final ViewPropertyAnimator animation = view.animate();
mRemoveAnimations.add(holder);
animation.setDuration(getRemoveDuration()).alpha(0).setListener(
new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchRemoveStarting(holder);
}
@Override
public void onAnimationEnd(Animator animator) {
animation.setListener(null);
view.setAlpha(1);
dispatchRemoveFinished(holder);
mRemoveAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
@Override
public boolean animateAdd(final RecyclerView.ViewHolder holder) {
resetAnimation(holder);
holder.itemView.setAlpha(0);
mPendingAdditions.add(holder);
return true;
}
void animateAddImpl(final RecyclerView.ViewHolder holder) {
final View view = holder.itemView;
final ViewPropertyAnimator animation = view.animate();
mAddAnimations.add(holder);
animation.alpha(1).setDuration(getAddDuration())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchAddStarting(holder);
}
@Override
public void onAnimationCancel(Animator animator) {
view.setAlpha(1);
}
@Override
public void onAnimationEnd(Animator animator) {
animation.setListener(null);
dispatchAddFinished(holder);
mAddAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
@Override
public boolean animateMove(final RecyclerView.ViewHolder holder, int fromX, int fromY,
int toX, int toY) {
final View view = holder.itemView;
fromX += (int) holder.itemView.getTranslationX();
fromY += (int) holder.itemView.getTranslationY();
resetAnimation(holder);
int deltaX = toX - fromX;
int deltaY = toY - fromY;
if (deltaX == 0 && deltaY == 0) {
dispatchMoveFinished(holder);
return false;
}
if (deltaX != 0) {
view.setTranslationX(-deltaX);
}
if (deltaY != 0) {
view.setTranslationY(-deltaY);
}
mPendingMoves.add(new MoveInfo(holder, fromX, fromY, toX, toY));
return true;
}
void animateMoveImpl(final RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) {
final View view = holder.itemView;
final int deltaX = toX - fromX;
final int deltaY = toY - fromY;
if (deltaX != 0) {
view.animate().translationX(0);
}
if (deltaY != 0) {
view.animate().translationY(0);
}
// TODO: make EndActions end listeners instead, since end actions aren't called when
// vpas are canceled (and can't end them. why?)
// need listener functionality in VPACompat for this. Ick.
final ViewPropertyAnimator animation = view.animate();
mMoveAnimations.add(holder);
animation.setDuration(getMoveDuration()).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchMoveStarting(holder);
}
@Override
public void onAnimationCancel(Animator animator) {
if (deltaX != 0) {
view.setTranslationX(0);
}
if (deltaY != 0) {
view.setTranslationY(0);
}
}
@Override
public void onAnimationEnd(Animator animator) {
animation.setListener(null);
dispatchMoveFinished(holder);
mMoveAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
@Override
public boolean animateChange(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder,
int fromX, int fromY, int toX, int toY) {
if (oldHolder == newHolder) {
// Don't know how to run change animations when the same view holder is re-used.
// run a move animation to handle position changes.
return animateMove(oldHolder, fromX, fromY, toX, toY);
}
final float prevTranslationX = oldHolder.itemView.getTranslationX();
final float prevTranslationY = oldHolder.itemView.getTranslationY();
final float prevAlpha = oldHolder.itemView.getAlpha();
resetAnimation(oldHolder);
int deltaX = (int) (toX - fromX - prevTranslationX);
int deltaY = (int) (toY - fromY - prevTranslationY);
// recover prev translation state after ending animation
oldHolder.itemView.setTranslationX(prevTranslationX);
oldHolder.itemView.setTranslationY(prevTranslationY);
oldHolder.itemView.setAlpha(prevAlpha);
if (newHolder != null) {
// carry over translation values
resetAnimation(newHolder);
newHolder.itemView.setTranslationX(-deltaX);
newHolder.itemView.setTranslationY(-deltaY);
newHolder.itemView.setAlpha(0);
}
mPendingChanges.add(new ChangeInfo(oldHolder, newHolder, fromX, fromY, toX, toY));
return true;
}
void animateChangeImpl(final ChangeInfo changeInfo) {
final RecyclerView.ViewHolder holder = changeInfo.oldHolder;
final View view = holder == null ? null : holder.itemView;
final RecyclerView.ViewHolder newHolder = changeInfo.newHolder;
final View newView = newHolder != null ? newHolder.itemView : null;
if (view != null) {
final ViewPropertyAnimator oldViewAnim = view.animate().setDuration(
getChangeDuration());
mChangeAnimations.add(changeInfo.oldHolder);
oldViewAnim.translationX((float) (changeInfo.toX - changeInfo.fromX));
oldViewAnim.translationY((float) (changeInfo.toY - changeInfo.fromY));
oldViewAnim.alpha(0).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchChangeStarting(changeInfo.oldHolder, true);
}
@Override
public void onAnimationEnd(Animator animator) {
oldViewAnim.setListener(null);
view.setAlpha(1);
view.setTranslationX(0);
view.setTranslationY(0);
dispatchChangeFinished(changeInfo.oldHolder, true);
mChangeAnimations.remove(changeInfo.oldHolder);
dispatchFinishedWhenDone();
}
}).start();
}
if (newView != null) {
final ViewPropertyAnimator newViewAnimation = newView.animate();
mChangeAnimations.add(changeInfo.newHolder);
newViewAnimation.translationX(0).translationY(0).setDuration(getChangeDuration())
.alpha(1).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchChangeStarting(changeInfo.newHolder, false);
}
@Override
public void onAnimationEnd(Animator animator) {
newViewAnimation.setListener(null);
newView.setAlpha(1);
newView.setTranslationX(0);
newView.setTranslationY(0);
dispatchChangeFinished(changeInfo.newHolder, false);
mChangeAnimations.remove(changeInfo.newHolder);
dispatchFinishedWhenDone();
}
}).start();
}
}
private void endChangeAnimation(List<ChangeInfo> infoList, RecyclerView.ViewHolder item) {
for (int i = infoList.size() - 1; i >= 0; i--) {
ChangeInfo changeInfo = infoList.get(i);
if (endChangeAnimationIfNecessary(changeInfo, item)) {
if (changeInfo.oldHolder == null && changeInfo.newHolder == null) {
infoList.remove(changeInfo);
}
}
}
}
private void endChangeAnimationIfNecessary(ChangeInfo changeInfo) {
if (changeInfo.oldHolder != null) {
endChangeAnimationIfNecessary(changeInfo, changeInfo.oldHolder);
}
if (changeInfo.newHolder != null) {
endChangeAnimationIfNecessary(changeInfo, changeInfo.newHolder);
}
}
private boolean endChangeAnimationIfNecessary(ChangeInfo changeInfo, RecyclerView.ViewHolder item) {
boolean oldItem = false;
if (changeInfo.newHolder == item) {
changeInfo.newHolder = null;
} else if (changeInfo.oldHolder == item) {
changeInfo.oldHolder = null;
oldItem = true;
} else {
return false;
}
item.itemView.setAlpha(1);
item.itemView.setTranslationX(0);
item.itemView.setTranslationY(0);
dispatchChangeFinished(item, oldItem);
return true;
}
@Override
public void endAnimation(RecyclerView.ViewHolder item) {
final View view = item.itemView;
// this will trigger end callback which should set properties to their target values.
view.animate().cancel();
// TODO if some other animations are chained to end, how do we cancel them as well?
for (int i = mPendingMoves.size() - 1; i >= 0; i--) {
MoveInfo moveInfo = mPendingMoves.get(i);
if (moveInfo.holder == item) {
view.setTranslationY(0);
view.setTranslationX(0);
dispatchMoveFinished(item);
mPendingMoves.remove(i);
}
}
endChangeAnimation(mPendingChanges, item);
if (mPendingRemovals.remove(item)) {
view.setAlpha(1);
dispatchRemoveFinished(item);
}
if (mPendingAdditions.remove(item)) {
view.setAlpha(1);
dispatchAddFinished(item);
}
for (int i = mChangesList.size() - 1; i >= 0; i--) {
ArrayList<ChangeInfo> changes = mChangesList.get(i);
endChangeAnimation(changes, item);
if (changes.isEmpty()) {
mChangesList.remove(i);
}
}
for (int i = mMovesList.size() - 1; i >= 0; i--) {
ArrayList<MoveInfo> moves = mMovesList.get(i);
for (int j = moves.size() - 1; j >= 0; j--) {
MoveInfo moveInfo = moves.get(j);
if (moveInfo.holder == item) {
view.setTranslationY(0);
view.setTranslationX(0);
dispatchMoveFinished(item);
moves.remove(j);
if (moves.isEmpty()) {
mMovesList.remove(i);
}
break;
}
}
}
for (int i = mAdditionsList.size() - 1; i >= 0; i--) {
ArrayList<RecyclerView.ViewHolder> additions = mAdditionsList.get(i);
if (additions.remove(item)) {
view.setAlpha(1);
dispatchAddFinished(item);
if (additions.isEmpty()) {
mAdditionsList.remove(i);
}
}
}
// animations should be ended by the cancel above.
//noinspection Pointless BooleanExpression,ConstantConditions
if (mRemoveAnimations.remove(item) && DEBUG) {
throw new IllegalStateException("after animation is cancelled, item should not be in "
+ "mRemoveAnimations list");
}
//noinspection Pointless BooleanExpression,ConstantConditions
if (mAddAnimations.remove(item) && DEBUG) {
throw new IllegalStateException("after animation is cancelled, item should not be in "
+ "mAddAnimations list");
}
//noinspection Pointless BooleanExpression,ConstantConditions
if (mChangeAnimations.remove(item) && DEBUG) {
throw new IllegalStateException("after animation is cancelled, item should not be in "
+ "mChangeAnimations list");
}
//noinspection Pointless BooleanExpression,ConstantConditions
if (mMoveAnimations.remove(item) && DEBUG) {
throw new IllegalStateException("after animation is cancelled, item should not be in "
+ "mMoveAnimations list");
}
dispatchFinishedWhenDone();
}
private void resetAnimation(RecyclerView.ViewHolder holder) {
if (sDefaultInterpolator == null) {
sDefaultInterpolator = new ValueAnimator().getInterpolator();
}
holder.itemView.animate().setInterpolator(sDefaultInterpolator);
endAnimation(holder);
}
@Override
public boolean isRunning() {
return (!mPendingAdditions.isEmpty()
|| !mPendingChanges.isEmpty()
|| !mPendingMoves.isEmpty()
|| !mPendingRemovals.isEmpty()
|| !mMoveAnimations.isEmpty()
|| !mRemoveAnimations.isEmpty()
|| !mAddAnimations.isEmpty()
|| !mChangeAnimations.isEmpty()
|| !mMovesList.isEmpty()
|| !mAdditionsList.isEmpty()
|| !mChangesList.isEmpty());
}
/**
* Check the state of currently pending and running animations. If there are none
* pending/running, call {@link #dispatchAnimationsFinished()} to notify any
* listeners.
*/
void dispatchFinishedWhenDone() {
if (!isRunning()) {
dispatchAnimationsFinished();
}
}
@Override
public void endAnimations() {
int count = mPendingMoves.size();
for (int i = count - 1; i >= 0; i--) {
MoveInfo item = mPendingMoves.get(i);
View view = item.holder.itemView;
view.setTranslationY(0);
view.setTranslationX(0);
dispatchMoveFinished(item.holder);
mPendingMoves.remove(i);
}
count = mPendingRemovals.size();
for (int i = count - 1; i >= 0; i--) {
RecyclerView.ViewHolder item = mPendingRemovals.get(i);
dispatchRemoveFinished(item);
mPendingRemovals.remove(i);
}
count = mPendingAdditions.size();
for (int i = count - 1; i >= 0; i--) {
RecyclerView.ViewHolder item = mPendingAdditions.get(i);
item.itemView.setAlpha(1);
dispatchAddFinished(item);
mPendingAdditions.remove(i);
}
count = mPendingChanges.size();
for (int i = count - 1; i >= 0; i--) {
endChangeAnimationIfNecessary(mPendingChanges.get(i));
}
mPendingChanges.clear();
if (!isRunning()) {
return;
}
int listCount = mMovesList.size();
for (int i = listCount - 1; i >= 0; i--) {
ArrayList<MoveInfo> moves = mMovesList.get(i);
count = moves.size();
for (int j = count - 1; j >= 0; j--) {
MoveInfo moveInfo = moves.get(j);
RecyclerView.ViewHolder item = moveInfo.holder;
View view = item.itemView;
view.setTranslationY(0);
view.setTranslationX(0);
dispatchMoveFinished(moveInfo.holder);
moves.remove(j);
if (moves.isEmpty()) {
mMovesList.remove(moves);
}
}
}
listCount = mAdditionsList.size();
for (int i = listCount - 1; i >= 0; i--) {
ArrayList<RecyclerView.ViewHolder> additions = mAdditionsList.get(i);
count = additions.size();
for (int j = count - 1; j >= 0; j--) {
RecyclerView.ViewHolder item = additions.get(j);
View view = item.itemView;
view.setAlpha(1);
dispatchAddFinished(item);
additions.remove(j);
if (additions.isEmpty()) {
mAdditionsList.remove(additions);
}
}
}
listCount = mChangesList.size();
for (int i = listCount - 1; i >= 0; i--) {
ArrayList<ChangeInfo> changes = mChangesList.get(i);
count = changes.size();
for (int j = count - 1; j >= 0; j--) {
endChangeAnimationIfNecessary(changes.get(j));
if (changes.isEmpty()) {
mChangesList.remove(changes);
}
}
}
cancelAll(mRemoveAnimations);
cancelAll(mMoveAnimations);
cancelAll(mAddAnimations);
cancelAll(mChangeAnimations);
dispatchAnimationsFinished();
}
void cancelAll(List<RecyclerView.ViewHolder> viewHolders) {
for (int i = viewHolders.size() - 1; i >= 0; i--) {
viewHolders.get(i).itemView.animate().cancel();
}
}
/**
* {@inheritDoc}
* <p>
* If the payload list is not empty, DefaultItemAnimator returns <code>true</code>.
* When this is the case:
* <ul>
* <li>If you override {@link #animateChange(RecyclerView.ViewHolder, RecyclerView.ViewHolder, int, int, int, int)}, both
* ViewHolder arguments will be the same instance.
* </li>
* <li>
* If you are not overriding {@link #animateChange(RecyclerView.ViewHolder, RecyclerView.ViewHolder, int, int, int, int)},
* then DefaultItemAnimator will call {@link #animateMove(RecyclerView.ViewHolder, int, int, int, int)} and
* run a move animation instead.
* </li>
* </ul>
*/
@Override
public boolean canReuseUpdatedViewHolder(@NonNull RecyclerView.ViewHolder viewHolder,
@NonNull List<Object> payloads) {
return !payloads.isEmpty() || super.canReuseUpdatedViewHolder(viewHolder, payloads);
}
}

View File

@@ -0,0 +1,37 @@
package com.mogo.och.taxi.ui.routing
import android.content.Intent
import android.os.Bundle
import com.mogo.commons.mvp.BaseFragment
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.taxi.R
import kotlinx.android.synthetic.main.routing_fragment.btnChooseTask
class TaxiRoutingFragment : BaseFragment() {
companion object {
const val TAG = SceneConstant.M_TAXI + "RoutingFragment"
fun newInstance(): TaxiRoutingFragment {
val args = Bundle()
val fragment = TaxiRoutingFragment()
fragment.arguments = args
return fragment
}
}
override fun getLayoutId(): Int {
return R.layout.routing_fragment
}
override fun getTagName(): String {
return "RoutingFragment"
}
override fun initViews() {
btnChooseTask.setOnClickListener {
val intent = Intent(context, TaxiRoutingChooseLineActivity::class.java)
startActivity(intent)
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/routing_choose_line_btn_submit_bg_pressed" android:state_pressed="true" /> <!-- pressed -->
<item android:drawable="@drawable/routing_choose_line_btn_submit_bg_default" /> <!-- default -->
</selector>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="24dp" />
<gradient
android:angle="0"
android:endColor="#0056FF"
android:startColor="#029DFF"
android:type="linear" />
</shape>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="24dp" />
<gradient
android:angle="0"
android:endColor="#800056FF"
android:startColor="#80029DFF"
android:type="linear" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:endColor="#660043FF"
android:startColor="#0028345E" />
</shape>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:endColor="#CC0043FF"
android:startColor="#0028345E" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/routing_click_btn_bg_pressed" android:state_pressed="true" /> <!-- pressed -->
<item android:drawable="@drawable/routing_click_btn_bg_default" /> <!-- default -->
</selector>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="@color/routing_verify_click_btn_color" />
<corners
android:bottomLeftRadius="42dp"
android:bottomRightRadius="42dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp" />
</shape>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="@color/routing_verify_click_btn_pressed_color" />
<corners
android:bottomLeftRadius="42dp"
android:bottomRightRadius="42dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp" />
</shape>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="42dp"/>
<gradient
android:angle="315"
android:type="linear"
android:startColor="#E6687FDC"
android:endColor="#E62C387D" /> <!-- #00344180-->
</shape>
</item>
<item
android:left="4dp"
android:top="4dp"
android:bottom="4dp"
android:right="4dp">
<shape android:shape="rectangle">
<corners android:radius="42dp"/>
<gradient
android:type="linear"
android:startColor="#80435AB2"
android:endColor="#802C387D"
android:angle="315" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,73 @@
<?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="match_parent"
android:layout_height="match_parent"
android:background="@color/routing_verify_choose_line_bg">
<View
android:id="@+id/chooseLineHint"
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_50"
android:layout_marginStart="@dimen/dp_80"
android:background="@color/routing_verify_choose_line"
app:layout_constraintBottom_toBottomOf="@+id/chooseLineHeaderTitle"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/chooseLineHeaderTitle" />
<TextView
android:id="@+id/chooseLineHeaderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_113"
android:layout_marginTop="@dimen/dp_97"
android:text="@string/routing_verify_choose_line_title"
android:textColor="@android:color/white"
android:textSize="@dimen/taxi_routing_choose_line_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/btnClose"
android:layout_width="@dimen/dp_107"
android:layout_height="@dimen/dp_107"
android:layout_marginTop="@dimen/dp_67"
android:layout_marginRight="@dimen/dp_40"
android:src="@drawable/routing_choose_line_close"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/chooseLineListView"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0"
android:layout_marginTop="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_30"
app:layout_constraintBottom_toTopOf="@+id/btnChooseLineSubmit"
app:layout_constraintLeft_toLeftOf="@+id/chooseLineHint"
app:layout_constraintTop_toBottomOf="@+id/chooseLineHint" />
<TextView
android:id="@+id/btnChooseLineSubmit"
android:layout_width="match_parent"
android:layout_height="126dp"
android:layout_marginStart="@dimen/dp_80"
android:layout_marginEnd="@dimen/dp_80"
android:layout_marginBottom="@dimen/taxi_choose_line_btn_margin_b"
android:background="@drawable/routing_choose_line_btn_submit_bg"
android:gravity="center"
android:text="@string/routing_verify_choose_line_btn_txt"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_42"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<include
layout="@layout/routing_no_data_common_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/routing_choose_line_shape_select_line_item_bg_normal">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/switchLineNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_80"
android:layout_marginTop="@dimen/dp_34"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_46"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="线路名称线路名称线路名称" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/todayVerifyNumTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_35"
android:maxLines="1"
android:textColor="@color/taxi_color_ccb9c3e9"
android:textSize="@dimen/dp_36"
app:layout_constraintStart_toStartOf="@+id/switchLineNameTextView"
app:layout_constraintTop_toBottomOf="@+id/switchLineNameTextView"
tools:text="本车今日已验证1次" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/historyVerifyNumTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_35"
android:maxLines="1"
android:textColor="@color/taxi_color_ccb9c3e9"
android:textSize="@dimen/dp_36"
app:layout_constraintLeft_toRightOf="@+id/todayVerifyNumTextView"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toEndOf="@+id/todayVerifyNumTextView"
app:layout_constraintTop_toBottomOf="@+id/switchLineNameTextView"
tools:text="路线累计反馈0可用1不可用" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,275 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/module_och_taxi_panel_width"
android:layout_height="@dimen/taxi_routing_verify_view_height"
android:background="@drawable/taxi_routing_bg"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/headerTitleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/taskTitleTv"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_132"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/dp_40"
android:gravity="center_vertical"
android:text="灰度路线123456"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_44"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/module_och_taxi_order_status_divider"
android:layout_width="match_parent"
android:layout_height="4dp"
android:background="@drawable/taxi_line_bg1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/taskTitleTv" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/headerTitleContainer">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottomBtnContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/btnChooseTask"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_132"
android:background="@drawable/routing_click_btn_bg"
android:gravity="center"
android:text="@string/routing_verify_btn_choose_task"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_44"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/mCurrentTaskLayout"
android:layout_width="@dimen/module_och_taxi_panel_width"
android:layout_height="match_parent"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/bottomBtnContainer"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/taskStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_54"
android:text="前往接驾"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_34"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/taskTypeTv"
android:layout_width="@dimen/dp_92"
android:layout_height="@dimen/dp_38"
android:layout_marginStart="@dimen/dp_16"
android:background="@drawable/task_order_type_btn_bg"
android:gravity="center"
android:text="运营单"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24"
app:layout_constraintBottom_toBottomOf="@+id/taskStatus"
app:layout_constraintStart_toEndOf="@+id/taskStatus"
app:layout_constraintTop_toTopOf="@+id/taskStatus" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/cancelOrder"
android:layout_width="@dimen/dp_42"
android:layout_height="@dimen/dp_42"
android:layout_marginEnd="@dimen/dp_40"
android:src="@drawable/taxi_report_order_cancel_icon"
app:layout_constraintBottom_toBottomOf="@+id/taskStatus"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/taskStatus" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/orderPhoneAndNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:text="183XXXX5400 | -人"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_28"
app:layout_constraintLeft_toLeftOf="@+id/taskStatus"
app:layout_constraintTop_toBottomOf="@+id/taskStatus" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/pathwayPoint"
android:layout_width="@dimen/dp_478"
android:layout_height="@dimen/dp_68"
android:layout_marginTop="@dimen/dp_30"
android:background="@drawable/task_pathway_point_bg"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingLeft="@dimen/dp_36"
android:text="途径: "
android:textColor="@color/station_tag_color"
android:textSize="@dimen/dp_32"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@+id/taskStatus"
app:layout_constraintTop_toBottomOf="@+id/orderPhoneAndNum"
app:layout_goneMarginTop="@dimen/dp_40" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/startStationTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_78"
android:layout_marginTop="@dimen/dp_30"
android:text="上车:"
android:textColor="@color/station_tag_color"
android:textSize="@dimen/dp_32"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pathwayPoint"
app:layout_goneMarginTop="@dimen/dp_68" />
<com.mogo.och.common.module.wigets.MarqueeTextView
android:id="@+id/startStationName"
android:layout_width="@dimen/dp_366"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:text="始发站"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_44"
app:layout_constraintLeft_toLeftOf="@+id/startStationTag"
app:layout_constraintTop_toBottomOf="@+id/startStationTag" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/naviToStart"
android:layout_width="@dimen/dp_48"
android:layout_height="@dimen/dp_48"
android:src="@drawable/taxi_navi_icon"
app:layout_constraintBottom_toBottomOf="@id/startStationName"
app:layout_constraintRight_toRightOf="@+id/cancelOrder"
app:layout_constraintTop_toTopOf="@+id/startStationName"
app:layout_goneMarginEnd="@dimen/dp_40" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/naviToEnd"
android:layout_width="@dimen/dp_48"
android:layout_height="@dimen/dp_48"
android:src="@drawable/taxi_navi_icon"
app:layout_constraintBottom_toBottomOf="@id/endStationName"
app:layout_constraintRight_toRightOf="@+id/cancelOrder"
app:layout_constraintTop_toTopOf="@+id/endStationName"
app:layout_goneMarginEnd="@dimen/dp_40" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/endStationTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_52"
android:text="下车:"
android:textColor="@color/station_tag_color"
android:textSize="@dimen/dp_32"
app:layout_constraintStart_toStartOf="@+id/startStationTag"
app:layout_constraintTop_toBottomOf="@+id/startStationName" />
<com.mogo.och.common.module.wigets.MarqueeTextView
android:id="@+id/endStationName"
android:layout_width="@dimen/dp_366"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:text="终点站"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_44"
app:layout_constraintLeft_toLeftOf="@+id/startStationTag"
app:layout_constraintTop_toBottomOf="@+id/endStationTag" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/startPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/taxi_driver_circle_green_big"
app:layout_constraintBottom_toBottomOf="@+id/startStationName"
app:layout_constraintLeft_toLeftOf="@+id/taskStatus"
app:layout_constraintTop_toTopOf="@+id/startStationName" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/taper"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:scaleType="fitXY"
android:src="@drawable/taxi_grab_dot_line"
app:layout_constraintBottom_toTopOf="@+id/endPoint"
app:layout_constraintLeft_toLeftOf="@+id/startPoint"
app:layout_constraintRight_toRightOf="@+id/startPoint"
app:layout_constraintTop_toBottomOf="@+id/startPoint" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/endPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/taxi_driver_circle_blue_big"
app:layout_constraintBottom_toBottomOf="@+id/endStationName"
app:layout_constraintLeft_toLeftOf="@+id/taskStatus"
app:layout_constraintTop_toTopOf="@+id/endStationName" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/taskOtherInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="36dp"
android:text="距离 -- 公里, 用时 -- 分钟"
android:textColor="@color/station_tag_color"
android:textSize="@dimen/dp_30"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/taskStatus"
app:layout_goneMarginBottom="@dimen/dp_172" />
</androidx.constraintlayout.widget.ConstraintLayout>
<include
android:id="@+id/noDataContainer"
layout="@layout/routing_no_data_common_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/bottomBtnContainer"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,33 @@
<?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/noDataContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/bottomBtnContainer"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/no_routing_data_iv"
android:layout_width="@dimen/dp_386"
android:layout_height="@dimen/dp_350"
android:src="@drawable/no_order_data"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/noRoutingTaskDataTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:text="暂无任务"
android:textColor="#91A1EA"
android:textSize="@dimen/dp_30"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/no_routing_data_iv" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -28,5 +28,10 @@
<color name="station_tag_color">#CAD6FF</color>
<color name="go_to_station_color">#00FFF8</color>
<color name="task_click_btn_color">#1D5EF3</color>
<color name="routing_verify_click_btn_color">#1D5EF3</color>
<color name="routing_verify_click_btn_pressed_color">#801D5EF3</color>
<color name="routing_verify_choose_line_bg">#F7151D41</color>
<color name="routing_verify_choose_line">#2966EC</color>
<color name="taxi_color_ccb9c3e9">#CCB9C3E9</color>
<color name="taxi_color_4dffffff">#4Dffffff</color>
</resources>

View File

@@ -117,6 +117,9 @@
<dimen name="taxi_traffic_light_time_size">60dp</dimen>
<dimen name="taxi_passenger_txt_size">34dp</dimen>
<dimen name="taxi_debug_view_width">1000dp</dimen>
<dimen name="taxi_routing_verify_view_height">934dp</dimen>
<dimen name="taxi_routing_choose_line_title">46dp</dimen>
<dimen name="taxi_choose_line_btn_margin_b">50dp</dimen>
</resources>

View File

@@ -60,5 +60,15 @@
<string name="view_data">查看</string>
<string name="routing_verify_btn_choose_task">选择任务</string>
<string name="routing_verify_choose_line_title">任务列表</string>
<string name="routing_verify_choose_line_btn_txt">确认</string>
<string name="routing_verify_choose_line_no_task">暂无任务</string>
<string name="routing_verify_choose_line_select_task">选择时间</string>
<string name="routing_verify_choose_line_name">路线: </string>
<string name="routing_verify_choose_line_start">起点: </string>
<string name="routing_verify_choose_line_end">终点:</string>
<string name="routing_verify_line_item_goto_end">往%1$s方向</string>
<!-- endregion -->
</resources>

View File

@@ -23,4 +23,25 @@
<style name="och_speed_style2">
<item name="android:textSize">32dp</item>
</style>
<style name="RoutingChooseLineDialogStyle" parent="Theme.AppCompat.Dialog">
<item name="theme">@android:style/Theme.Translucent</item>
<!--是否去除标题 -->
<item name="windowNoTitle">true</item>
<!-- 背景透明 -->
<item name="android:background">#00000000</item>
<item name="android:windowBackground">#00000000</item>
<!-- 没有windowActionBar-->
<item name="windowActionBar">false</item>
<item name="android:windowContentOverlay">@null</item>
<!-- 设置窗体外面允不允许点击-->
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>

View File

@@ -557,9 +557,9 @@
android:scaleX="1.2"
android:scaleY="1.2"
android:text="自主算路验证模式"
app:layout_constraintLeft_toLeftOf="@id/otherGuideLine"
app:layout_constraintLeft_toRightOf="@id/scShowBagRecordWindow"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/scShowBagRecordWindow" />
app:layout_constraintTop_toBottomOf="@id/scIPCReport" />
<TextView
android:id="@+id/tvPullTimeTitle"