结束页面抽取成独立View
添加debug位置
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
public interface ITaxiPassengerCommonValueCallback<T> {
|
||||
void onCommonCallback(T t);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.mogo.och.taxi.passenger.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils
|
||||
import com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonValueCallback
|
||||
|
||||
/**
|
||||
*
|
||||
* 评价View
|
||||
* Created on 2022/5/16
|
||||
*/
|
||||
class TaxiPassengerArrivedView :RelativeLayout, View.OnClickListener {
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
companion object {
|
||||
const val TAG = "TaxiPassengerArrivedView"
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView(context)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
private lateinit var mArrivedEndStation: TextView
|
||||
private lateinit var ochShadowLayout: OCHBorderShadowLayout
|
||||
|
||||
var taxiPassengerCommonValueCallback: ITaxiPassengerCommonValueCallback<Int>?=null
|
||||
var trAnimation = AnimationUtils.loadAnimation(
|
||||
context, R.anim.left_to_right
|
||||
)
|
||||
|
||||
private fun initView(context: Context) {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_arrived_end_panel, this, true)
|
||||
mArrivedEndStation = findViewById(R.id.arrived_end_station)
|
||||
ochShadowLayout = findViewById(R.id.och_shadow_layout)
|
||||
findViewById<View>(R.id.tv_please_score).setOnClickListener(this)
|
||||
findViewById<View>(R.id.arrived_end_station_title).setOnLongClickListener {
|
||||
OverlayViewUtils.dismissOverlayView(this)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.tv_taxi_passenger_number_one -> {
|
||||
taxiPassengerCommonValueCallback?.onCommonCallback(2)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun setDataAndStartAnimation(endSiteAddr: String?) {
|
||||
mArrivedEndStation.text = endSiteAddr
|
||||
ochShadowLayout.startAnimation(trAnimation)
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,7 @@ import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.och.taxi.passenger.R;
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonValueCallback;
|
||||
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
@@ -51,10 +52,8 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
private TaxiPassengerV2XNotificationView mV2XNotificationView;
|
||||
|
||||
// private ConstraintLayout mArrivedEndCL;
|
||||
private WeakReference<View> mArrivedEndView;
|
||||
private WeakReference<View> ochShadowLayout;
|
||||
private WeakReference<TaxiPassengerArrivedView> mArrivedEndView;
|
||||
private WeakReference<TaxiPassengerCheckView> mArrivedCheckView;
|
||||
private WeakReference<TextView> mArrivedEndStation;
|
||||
|
||||
protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null;
|
||||
|
||||
@@ -84,7 +83,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
mV2XNotificationView = new TaxiPassengerV2XNotificationView(getContext());
|
||||
CallerHmiManager.INSTANCE.setProxyNotificationView(mV2XNotificationView);
|
||||
|
||||
// mArrivedEndCL = findViewById(R.id.taxi_p_arrive_end_bg);
|
||||
initArrivedView();
|
||||
initCheckView();
|
||||
|
||||
@@ -115,24 +113,29 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initArrivedView(){
|
||||
View mArrivedEndViewInner = LayoutInflater.from(getContext()).inflate(R.layout.taxi_p_arrived_end_panel,null);
|
||||
mArrivedEndView = new WeakReference<>(mArrivedEndViewInner);
|
||||
mArrivedEndStation = new WeakReference<>(mArrivedEndViewInner.findViewById(R.id.arrived_end_station)) ;
|
||||
ochShadowLayout = new WeakReference<>(mArrivedEndViewInner.findViewById(R.id.och_shadow_layout)) ;
|
||||
mArrivedEndViewInner.findViewById(R.id.tv_please_score).setOnClickListener(new View.OnClickListener() {
|
||||
findViewById(R.id.iv_temp).setOnLongClickListener(new View.OnLongClickListener() {
|
||||
int i = 0;
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getPresenter().arrivedAndScore(2);
|
||||
public boolean onLongClick(View v) {
|
||||
if(i%2==0){
|
||||
showOrHideArrivedEndLayout(true,"北京北京北京");
|
||||
}else {
|
||||
showOrHidePressengerCheckPager(true, "开始站点开", "开始站点开始站点开始", "2", "京A888888", "18811539480");
|
||||
}
|
||||
i++;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initArrivedView(){
|
||||
mArrivedEndView = new WeakReference<>(new TaxiPassengerArrivedView(getContext()));
|
||||
mArrivedEndView.get().setTaxiPassengerCommonValueCallback(integer -> getPresenter().arrivedAndScore(integer));
|
||||
}
|
||||
|
||||
private void initCheckView() {
|
||||
TaxiPassengerCheckView mArrivedCheckViewInner = new TaxiPassengerCheckView(getContext());
|
||||
mArrivedCheckView = new WeakReference<>(mArrivedCheckViewInner);
|
||||
mArrivedCheckView = new WeakReference<>(new TaxiPassengerCheckView(getContext()));
|
||||
mArrivedCheckView.get().setOnCheckPhoneAndUpdateStatusListener(phoneTail -> getPresenter().checkAndUpdateStatus(phoneTail));
|
||||
}
|
||||
|
||||
@@ -273,13 +276,11 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
*/
|
||||
public void showOrHideArrivedEndLayout(boolean isShow, String arrivedEndStation){
|
||||
if (isShow){
|
||||
if(mArrivedEndView.get()==null||ochShadowLayout.get()==null||mArrivedEndStation.get()==null){
|
||||
if(mArrivedEndView.get()==null){
|
||||
initArrivedView();
|
||||
}
|
||||
OverlayViewUtils.showOverlayView(getActivity(),mArrivedEndView.get(), R.style.och_window_anim_alpha);
|
||||
Animation trAnimation = AnimationUtils.loadAnimation(getContext(), R.anim.left_to_right);
|
||||
ochShadowLayout.get().startAnimation(trAnimation);
|
||||
mArrivedEndStation.get().setText(arrivedEndStation);
|
||||
mArrivedEndView.get().setDataAndStartAnimation(arrivedEndStation);
|
||||
}else {
|
||||
OverlayViewUtils.dismissOverlayView(mArrivedEndView.get());
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCheckPhoneCallback
|
||||
@@ -83,6 +84,11 @@ class TaxiPassengerCheckView :RelativeLayout, View.OnClickListener {
|
||||
tvTaxiPassengerNumberSecond.setOnClickListener(this)
|
||||
tvTaxiPassengerNumberThird.setOnClickListener(this)
|
||||
tvTaxiPassengerNumberFourth.setOnClickListener(this)
|
||||
|
||||
findViewById<TextView>(R.id.tv_hello).setOnLongClickListener {
|
||||
OverlayViewUtils.dismissOverlayView(this)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
|
||||
Reference in New Issue
Block a user