version:4.6
fix: update:优化订单页,增加快递详情页
This commit is contained in:
@@ -201,6 +201,11 @@
|
||||
android:name=".activity.OrderListActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="userPortrait" />
|
||||
<activity
|
||||
android:name=".activity.ExpressActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="userPortrait" />
|
||||
|
||||
|
||||
<receiver
|
||||
android:name=".receiver.BootReceiver"
|
||||
|
||||
112
app/src/main/java/com/uiuios/aios/activity/ExpressActivity.java
Normal file
112
app/src/main/java/com/uiuios/aios/activity/ExpressActivity.java
Normal file
@@ -0,0 +1,112 @@
|
||||
package com.uiuios.aios.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.base.BaseDataBindingActivity;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.ExpressData;
|
||||
import com.uiuios.aios.bean.LogisticsTrace;
|
||||
import com.uiuios.aios.bean.LogisticsTraceDeta;
|
||||
import com.uiuios.aios.databinding.ActivityExpressBinding;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.utils.TimeUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
public class ExpressActivity extends BaseDataBindingActivity {
|
||||
private static final String TAG = ExpressActivity.class.getSimpleName();
|
||||
|
||||
private ActivityExpressBinding mBinding;
|
||||
|
||||
/**
|
||||
* 初始化视图
|
||||
*/
|
||||
@Override
|
||||
public void initView() {
|
||||
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_express);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
@Override
|
||||
public void initData() {
|
||||
Intent intent = getIntent();
|
||||
if (intent == null) {
|
||||
Log.e(TAG, "initData: intent is null");
|
||||
return;
|
||||
}
|
||||
String orderSn = intent.getStringExtra("order_sn");
|
||||
String orderId = intent.getStringExtra("order_id");
|
||||
if (TextUtils.isEmpty(orderSn) || TextUtils.isEmpty(orderId)) {
|
||||
Log.e(TAG, "initData: orderSn is empty or orderId is empty");
|
||||
return;
|
||||
}
|
||||
getOrderExpress(orderSn, orderId);
|
||||
}
|
||||
|
||||
private void getOrderExpress(String orderSn, String orderId) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getOrderExpressObservable(orderSn, orderId)
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycleSubject, ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<ExpressData>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getOrderExpress", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<ExpressData> expressDataBaseResponse) {
|
||||
Log.e("getOrderExpress", "onNext: " + expressDataBaseResponse);
|
||||
if (expressDataBaseResponse.code == 200) {
|
||||
ExpressData expressData = expressDataBaseResponse.data;
|
||||
if (expressData.isSuccess()) {
|
||||
LogisticsTrace logisticsTrace = expressData.getLogisticsTrace();
|
||||
mBinding.tvExpressNo.setText(logisticsTrace.getMailNo());
|
||||
List<LogisticsTraceDeta> logisticsTraceDetaList = logisticsTrace.getLogisticsTraceDetailList();
|
||||
for (LogisticsTraceDeta logisticsTraceDeta : logisticsTraceDetaList) {
|
||||
View view = LayoutInflater.from(ExpressActivity.this).inflate(R.layout.item_timeline, mBinding.timelineLayout, false);
|
||||
((TextView) view.findViewById(R.id.tv_action)).setText(logisticsTraceDeta.getDesc());
|
||||
((TextView) view.findViewById(R.id.tv_action_time)).setText(TimeUtils.transferLongToDate(logisticsTraceDeta.getTime()));
|
||||
((TextView) view.findViewById(R.id.tv_action_status)).setText(logisticsTraceDeta.getAreaName());
|
||||
mBinding.timelineLayout.addView(view);
|
||||
}
|
||||
mBinding.timelineLayout.setVisibility(View.VISIBLE);
|
||||
mBinding.clNodata.setVisibility(View.GONE);
|
||||
}else {
|
||||
mBinding.timelineLayout.setVisibility(View.GONE);
|
||||
mBinding.clNodata.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
mBinding.timelineLayout.setVisibility(View.GONE);
|
||||
mBinding.clNodata.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getOrderExpress", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getOrderExpress", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -38,10 +38,11 @@ import io.reactivex.rxjava3.disposables.Disposable;
|
||||
public class InformationActivity extends DataBindingActivity {
|
||||
private static final String TAG = InformationActivity.class.getSimpleName();
|
||||
|
||||
|
||||
@BindView(R.id.tabLayout)
|
||||
TabLayout tabLayout;
|
||||
@BindView(R.id.root)
|
||||
ConstraintLayout root;
|
||||
@BindView(R.id.cl_bar)
|
||||
ConstraintLayout cl_bar;
|
||||
@BindView(R.id.rv_video)
|
||||
RecyclerView rv_video;
|
||||
@BindView(R.id.cl_nodata)
|
||||
@@ -60,7 +61,7 @@ public class InformationActivity extends DataBindingActivity {
|
||||
.transparent()
|
||||
.apply();
|
||||
|
||||
UltimateBarX.addStatusBarTopPadding(tabLayout);
|
||||
UltimateBarX.addStatusBarTopPadding(cl_bar);
|
||||
|
||||
mInformationAdapter = new InformationAdapter();
|
||||
LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(this);
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
@@ -81,6 +82,12 @@ public class OrderListActivity extends BaseDataBindingActivity {
|
||||
Log.e(TAG, "onTabReselected: " + tab.getText());
|
||||
}
|
||||
});
|
||||
mBinding.ivExit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,14 +124,22 @@ public class OrderListActivity extends BaseDataBindingActivity {
|
||||
OrderIndexData orderIndexData = baseResponse.data;
|
||||
List<OrderIndexBean> orderIndexBeanList = orderIndexData.getData();
|
||||
mOrderAdapter.setOrderIndexBeans(orderIndexBeanList);
|
||||
}else {
|
||||
mBinding.rvOrder.setVisibility(View.VISIBLE);
|
||||
mBinding.clNodata.setVisibility(View.GONE);
|
||||
} else {
|
||||
mOrderAdapter.setOrderIndexBeans(null);
|
||||
mBinding.rvOrder.setVisibility(View.GONE);
|
||||
mBinding.clNodata.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAllOrderListObserver", "onError: " + e.getMessage());
|
||||
mOrderAdapter.setOrderIndexBeans(null);
|
||||
mBinding.rvOrder.setVisibility(View.GONE);
|
||||
mBinding.clNodata.setVisibility(View.VISIBLE);
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class InformationAdapter extends RecyclerView.Adapter<InformationAdapter.
|
||||
ArticleInfo articleInfo = mArticleInfos.get(position);
|
||||
holder.tv_consult_title.setText(articleInfo.getTitle());
|
||||
GlideLoadUtils.getInstance().glideLoad(mContext, articleInfo.getImg(), holder.nv_consult);
|
||||
holder.tv_time.setText(TimeUtils.transferSecondgToDate(articleInfo.getUpdate_time()));
|
||||
holder.tv_time.setText(TimeUtils.transferSecondgToHour(articleInfo.getUpdate_time()));
|
||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package com.uiuios.aios.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.ExpressActivity;
|
||||
import com.uiuios.aios.bean.OrderGoods;
|
||||
import com.uiuios.aios.bean.OrderIndexBean;
|
||||
import com.uiuios.aios.utils.GlideLoadUtils;
|
||||
@@ -63,6 +65,21 @@ public class OrderAdapter extends RecyclerView.Adapter<OrderAdapter.OrderHolder>
|
||||
holder.tv_unit_price.setText("¥" + orderGoods.getBuy_price());
|
||||
holder.tv_amount.setText(String.valueOf(orderIndexBean.getGoods_total()));
|
||||
holder.tv_paid.setText("实付:¥" + orderIndexBean.getPrice_total() + "元");
|
||||
String latest_transport = orderIndexBean.getLatest_transport();
|
||||
if (TextUtils.isEmpty(latest_transport)) {
|
||||
holder.tv_express_info.setText("暂无物流信息");
|
||||
} else {
|
||||
holder.tv_express_info.setText(latest_transport);
|
||||
}
|
||||
holder.tv_express.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(mContext, ExpressActivity.class);
|
||||
intent.putExtra("order_sn",orderIndexBean.getOrder_sn());
|
||||
intent.putExtra("order_id",orderIndexBean.getId());
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,7 +88,7 @@ public class OrderAdapter extends RecyclerView.Adapter<OrderAdapter.OrderHolder>
|
||||
}
|
||||
|
||||
class OrderHolder extends RecyclerView.ViewHolder {
|
||||
TextView tv_statu, tv_title, tv_unit_price, tv_amount, tv_paid, tv_express;
|
||||
TextView tv_statu, tv_title, tv_unit_price, tv_amount, tv_paid, tv_express, tv_express_info;
|
||||
ImageView iv_goods;
|
||||
|
||||
public OrderHolder(@NonNull View itemView) {
|
||||
@@ -83,6 +100,7 @@ public class OrderAdapter extends RecyclerView.Adapter<OrderAdapter.OrderHolder>
|
||||
tv_paid = itemView.findViewById(R.id.tv_paid);
|
||||
tv_express = itemView.findViewById(R.id.tv_express);
|
||||
iv_goods = itemView.findViewById(R.id.iv_goods);
|
||||
tv_express_info = itemView.findViewById(R.id.tv_express_info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
44
app/src/main/java/com/uiuios/aios/bean/ExpressData.java
Normal file
44
app/src/main/java/com/uiuios/aios/bean/ExpressData.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ExpressData implements Serializable {
|
||||
private static final long serialVersionUID = 6282718995656979667L;
|
||||
|
||||
String traceId;
|
||||
String trace_id;
|
||||
boolean success;
|
||||
LogisticsTrace logisticsTrace;
|
||||
|
||||
public String getTraceId() {
|
||||
return traceId;
|
||||
}
|
||||
|
||||
public void setTraceId(String traceId) {
|
||||
this.traceId = traceId;
|
||||
}
|
||||
|
||||
public String getTrace_id() {
|
||||
return trace_id;
|
||||
}
|
||||
|
||||
public void setTrace_id(String trace_id) {
|
||||
this.trace_id = trace_id;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public LogisticsTrace getLogisticsTrace() {
|
||||
return logisticsTrace;
|
||||
}
|
||||
|
||||
public void setLogisticsTrace(LogisticsTrace logisticsTrace) {
|
||||
this.logisticsTrace = logisticsTrace;
|
||||
}
|
||||
}
|
||||
99
app/src/main/java/com/uiuios/aios/bean/LogisticsTrace.java
Normal file
99
app/src/main/java/com/uiuios/aios/bean/LogisticsTrace.java
Normal file
@@ -0,0 +1,99 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class LogisticsTrace implements Serializable {
|
||||
private static final long serialVersionUID = 3064293483233992595L;
|
||||
|
||||
String theLastTime;
|
||||
String cpCode;
|
||||
String cpUrl;
|
||||
String logisticsStatusDesc;
|
||||
List<LogisticsTraceDeta> logisticsTraceDetailList;
|
||||
String mailNo;
|
||||
String theLastMessage;
|
||||
String cpMobile;
|
||||
String logisticsCompanyName;
|
||||
String logisticsStatus;
|
||||
|
||||
public String getTheLastTime() {
|
||||
return theLastTime;
|
||||
}
|
||||
|
||||
public void setTheLastTime(String theLastTime) {
|
||||
this.theLastTime = theLastTime;
|
||||
}
|
||||
|
||||
public String getCpCode() {
|
||||
return cpCode;
|
||||
}
|
||||
|
||||
public void setCpCode(String cpCode) {
|
||||
this.cpCode = cpCode;
|
||||
}
|
||||
|
||||
public String getCpUrl() {
|
||||
return cpUrl;
|
||||
}
|
||||
|
||||
public void setCpUrl(String cpUrl) {
|
||||
this.cpUrl = cpUrl;
|
||||
}
|
||||
|
||||
public String getLogisticsStatusDesc() {
|
||||
return logisticsStatusDesc;
|
||||
}
|
||||
|
||||
public void setLogisticsStatusDesc(String logisticsStatusDesc) {
|
||||
this.logisticsStatusDesc = logisticsStatusDesc;
|
||||
}
|
||||
|
||||
public List<LogisticsTraceDeta> getLogisticsTraceDetailList() {
|
||||
return logisticsTraceDetailList;
|
||||
}
|
||||
|
||||
public void setLogisticsTraceDetailList(List<LogisticsTraceDeta> logisticsTraceDetailList) {
|
||||
this.logisticsTraceDetailList = logisticsTraceDetailList;
|
||||
}
|
||||
|
||||
public String getMailNo() {
|
||||
return mailNo;
|
||||
}
|
||||
|
||||
public void setMailNo(String mailNo) {
|
||||
this.mailNo = mailNo;
|
||||
}
|
||||
|
||||
public String getTheLastMessage() {
|
||||
return theLastMessage;
|
||||
}
|
||||
|
||||
public void setTheLastMessage(String theLastMessage) {
|
||||
this.theLastMessage = theLastMessage;
|
||||
}
|
||||
|
||||
public String getCpMobile() {
|
||||
return cpMobile;
|
||||
}
|
||||
|
||||
public void setCpMobile(String cpMobile) {
|
||||
this.cpMobile = cpMobile;
|
||||
}
|
||||
|
||||
public String getLogisticsCompanyName() {
|
||||
return logisticsCompanyName;
|
||||
}
|
||||
|
||||
public void setLogisticsCompanyName(String logisticsCompanyName) {
|
||||
this.logisticsCompanyName = logisticsCompanyName;
|
||||
}
|
||||
|
||||
public String getLogisticsStatus() {
|
||||
return logisticsStatus;
|
||||
}
|
||||
|
||||
public void setLogisticsStatus(String logisticsStatus) {
|
||||
this.logisticsStatus = logisticsStatus;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LogisticsTraceDeta implements Serializable {
|
||||
private static final long serialVersionUID = 6775968129767296804L;
|
||||
|
||||
String areaCode;
|
||||
String areaName;
|
||||
String subLogisticsStatus;
|
||||
long time;
|
||||
String logisticsStatus;
|
||||
String desc;
|
||||
|
||||
public String getAreaCode() {
|
||||
return areaCode;
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode) {
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getSubLogisticsStatus() {
|
||||
return subLogisticsStatus;
|
||||
}
|
||||
|
||||
public void setSubLogisticsStatus(String subLogisticsStatus) {
|
||||
this.subLogisticsStatus = subLogisticsStatus;
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(long time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getLogisticsStatus() {
|
||||
return logisticsStatus;
|
||||
}
|
||||
|
||||
public void setLogisticsStatus(String logisticsStatus) {
|
||||
this.logisticsStatus = logisticsStatus;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import java.io.Serializable;
|
||||
public class OrderIndexBean implements Serializable {
|
||||
private static final long serialVersionUID = 4544929539747251262L;
|
||||
|
||||
int id;
|
||||
String id;
|
||||
String order_sn;
|
||||
String sn_id;
|
||||
String sn;
|
||||
@@ -39,11 +39,11 @@ public class OrderIndexBean implements Serializable {
|
||||
AdminInfo admin;// 关联企业
|
||||
|
||||
|
||||
public int getId() {
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ public class SecondFragment extends BaseFragment implements SecondContact.View,
|
||||
if (mNewGoodsAdapter.getItemCount() == 0 || mGoodsScrolling) {
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "run: " + mNewGoodsAdapter.getItemCount());
|
||||
Log.i(TAG, "run: " + mNewGoodsAdapter.getItemCount());
|
||||
if (mNewGoodsAdapter.getItemCount() <= mCurrentGoodsIndex) {
|
||||
mCurrentGoodsIndex = 0;
|
||||
} else {
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.CategoryBean;
|
||||
import com.uiuios.aios.bean.Contact;
|
||||
import com.uiuios.aios.bean.DemandBean;
|
||||
import com.uiuios.aios.bean.ExpressData;
|
||||
import com.uiuios.aios.bean.GoodsList;
|
||||
import com.uiuios.aios.bean.GoodsType;
|
||||
import com.uiuios.aios.bean.HealthCode;
|
||||
@@ -79,6 +80,7 @@ import com.uiuios.aios.network.api.UpdateDesktopApi;
|
||||
import com.uiuios.aios.network.api.UserInfoControl;
|
||||
import com.uiuios.aios.network.api.amap.GeocodingApi;
|
||||
import com.uiuios.aios.network.api.order.AllOrderApi;
|
||||
import com.uiuios.aios.network.api.order.OrderExpressApi;
|
||||
import com.uiuios.aios.network.api.order.OrderIndexApi;
|
||||
import com.uiuios.aios.network.interceptor.RepeatRequestInterceptor;
|
||||
|
||||
@@ -485,6 +487,12 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ExpressData>> getOrderExpressObservable(String order_sn, String order_id) {
|
||||
return mRetrofit.create(OrderExpressApi.class)
|
||||
.getOrderExpress(RemoteManager.getInstance().getSerial(), order_sn,order_id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public RegionListApi getRegionListApi() {
|
||||
return mRetrofit.create(RegionListApi.class);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.uiuios.aios.network.api.order;
|
||||
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.ExpressData;
|
||||
import com.uiuios.aios.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface OrderExpressApi {
|
||||
@GET(UrlAddress.ORDER_EXPRESS)
|
||||
Observable<BaseResponse<ExpressData>> getOrderExpress(
|
||||
@Query("sn") String sn,
|
||||
@Query("order_sn") String order_sn,
|
||||
@Query("order_id") String order_id
|
||||
);
|
||||
}
|
||||
@@ -33,6 +33,12 @@ public class TimeUtils {
|
||||
return sdf.format(date);
|
||||
}
|
||||
|
||||
public static String transferSecondgToHour(long second) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
|
||||
Date date = new Date(second * 1000);
|
||||
return sdf.format(date);
|
||||
}
|
||||
|
||||
public static String secToTime(int totalSecs) {
|
||||
int hours = totalSecs / 3600;
|
||||
int minutes = (totalSecs % 3600) / 60;
|
||||
|
||||
162
app/src/main/java/com/uiuios/aios/view/TimelineLayout.java
Normal file
162
app/src/main/java/com/uiuios/aios/view/TimelineLayout.java
Normal file
@@ -0,0 +1,162 @@
|
||||
package com.uiuios.aios.view;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.uiuios.aios.R;
|
||||
|
||||
/**
|
||||
* Created by Jackie on 2017/3/8.
|
||||
* 时间轴控件
|
||||
*/
|
||||
|
||||
public class TimelineLayout extends LinearLayout {
|
||||
private Context mContext;
|
||||
|
||||
private int mLineMarginLeft;
|
||||
private int mLineMarginTop;
|
||||
private int mLineStrokeWidth;
|
||||
private int mLineColor;
|
||||
private int mPointSize;
|
||||
private int mPointColor;
|
||||
private Bitmap mIcon;
|
||||
|
||||
private Paint mLinePaint; //线的画笔
|
||||
private Paint mPointPaint; //点的画笔
|
||||
|
||||
|
||||
//第一个点的位置
|
||||
private int mFirstX;
|
||||
private int mFirstY;
|
||||
//最后一个图标的位置
|
||||
private int mLastX;
|
||||
private int mLastY;
|
||||
|
||||
public TimelineLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public TimelineLayout(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public TimelineLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.TimelineLayout);
|
||||
mLineMarginLeft = ta.getDimensionPixelOffset(R.styleable.TimelineLayout_line_margin_left, 10);
|
||||
mLineMarginTop = ta.getDimensionPixelOffset(R.styleable.TimelineLayout_line_margin_top, 0);
|
||||
mLineStrokeWidth = ta.getDimensionPixelOffset(R.styleable.TimelineLayout_line_stroke_width, 5);
|
||||
mLineColor = ta.getColor(R.styleable.TimelineLayout_line_color, 0xff3dd1a5);
|
||||
mPointSize = ta.getDimensionPixelSize(R.styleable.TimelineLayout_point_size, 8);
|
||||
mPointColor = ta.getDimensionPixelOffset(R.styleable.TimelineLayout_point_color, 0xff3dd1a5);
|
||||
|
||||
int iconRes = ta.getResourceId(R.styleable.TimelineLayout_icon_src, R.drawable.ic_ok);
|
||||
BitmapDrawable drawable = (BitmapDrawable) context.getResources().getDrawable(iconRes);
|
||||
if (drawable != null) {
|
||||
mIcon = drawable.getBitmap();
|
||||
}
|
||||
|
||||
ta.recycle();
|
||||
|
||||
setWillNotDraw(false);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
this.mContext = context;
|
||||
|
||||
mLinePaint = new Paint();
|
||||
mLinePaint.setAntiAlias(true);
|
||||
mLinePaint.setDither(true);
|
||||
mLinePaint.setColor(mLineColor);
|
||||
mLinePaint.setStrokeWidth(mLineStrokeWidth);
|
||||
mLinePaint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||
|
||||
mPointPaint = new Paint();
|
||||
mPointPaint.setAntiAlias(true);
|
||||
mPointPaint.setDither(true);
|
||||
mPointPaint.setColor(mPointColor);
|
||||
mPointPaint.setStyle(Paint.Style.FILL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
drawTimeline(canvas);
|
||||
Log.e("TimelineLayout", "onDraw: ");
|
||||
}
|
||||
|
||||
private void drawTimeline(Canvas canvas) {
|
||||
Log.e("TimelineLayout", "drawTimeline: ");
|
||||
int childCount = getChildCount();
|
||||
if (childCount > 0) {
|
||||
if (childCount > 1) {
|
||||
//大于1,证明至少有2个,也就是第一个和第二个之间连成线,第一个和最后一个分别有点和icon
|
||||
drawFirstPoint(canvas);
|
||||
drawLastIcon(canvas);
|
||||
drawBetweenLine(canvas);
|
||||
} else if (childCount == 1) {
|
||||
drawFirstPoint(canvas);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawFirstPoint(Canvas canvas) {
|
||||
View child = getChildAt(0);
|
||||
if (child != null) {
|
||||
int top = child.getTop();
|
||||
mFirstX = mLineMarginLeft;
|
||||
mFirstY = top + child.getPaddingTop() + mLineMarginTop;
|
||||
//画圆
|
||||
canvas.drawCircle(mFirstX, mFirstY, mPointSize, mPointPaint);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawLastIcon(Canvas canvas) {
|
||||
View child = getChildAt(getChildCount() - 1);
|
||||
if (child != null) {
|
||||
int top = child.getTop();
|
||||
mLastX = mLineMarginLeft;
|
||||
mLastY = top + child.getPaddingTop() + mLineMarginTop;
|
||||
//画图
|
||||
canvas.drawBitmap(mIcon, mLastX - (mIcon.getWidth() >> 1), mLastY, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawBetweenLine(Canvas canvas) {
|
||||
Log.e("TimelineLayout", "drawBetweenLine: " + getChildCount());
|
||||
//从开始的点到最后的图标之间,画一条线
|
||||
canvas.drawLine(mFirstX, mFirstY, mLastX, mLastY, mLinePaint);
|
||||
Log.e("TimelineLayout", "drawBetweenLine: mFirstX = " + mFirstX);
|
||||
Log.e("TimelineLayout", "drawBetweenLine: mFirstY = " + mFirstY);
|
||||
Log.e("TimelineLayout", "drawBetweenLine: mLastX = " + mLastX);
|
||||
Log.e("TimelineLayout", "drawBetweenLine: mLastY = " + mLastY);
|
||||
for (int i = 0; i < getChildCount() - 1; i++) {
|
||||
//画圆
|
||||
int top = getChildAt(i).getTop();
|
||||
int y = top + getChildAt(i).getPaddingTop() + mLineMarginTop;
|
||||
canvas.drawCircle(mFirstX, y, mPointSize, mPointPaint);
|
||||
Log.e("TimelineLayout", "drawBetweenLine: y = " + y);
|
||||
}
|
||||
}
|
||||
|
||||
public int getLineMarginLeft() {
|
||||
return mLineMarginLeft;
|
||||
}
|
||||
|
||||
public void setLineMarginLeft(int lineMarginLeft) {
|
||||
this.mLineMarginLeft = lineMarginLeft;
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable-hdpi/goods_placeholder.png
Normal file
BIN
app/src/main/res/drawable-hdpi/goods_placeholder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_ok.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_ok.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_list_nodata.png
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_list_nodata.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
13
app/src/main/res/drawable/express_background.xml
Normal file
13
app/src/main/res/drawable/express_background.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/alarm_background_color" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_4"
|
||||
android:left="@dimen/dp_8"
|
||||
android:right="@dimen/dp_8"
|
||||
android:top="@dimen/dp_4" />
|
||||
</shape>
|
||||
@@ -3,6 +3,6 @@
|
||||
<!-- <solid android:color="#FFFFFF" />-->
|
||||
<stroke
|
||||
android:width="3px"
|
||||
android:color="#EA4F77" />
|
||||
android:color="@color/action_bar_red" />
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
</shape>
|
||||
106
app/src/main/res/layout/activity_express.xml
Normal file
106
app/src/main/res/layout/activity_express.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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"
|
||||
tools:context=".activity.ExpressActivity">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout18"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_company"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_express_no"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_company"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout18">
|
||||
|
||||
<com.uiuios.aios.view.TimelineLayout
|
||||
android:id="@+id/timeline_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="vertical"
|
||||
app:line_margin_left="25dp"
|
||||
app:line_margin_top="8dp" />
|
||||
</ScrollView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_nodata"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout18">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_list_nodata"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.45" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:text="没有数据"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="@+id/imageView"
|
||||
app:layout_constraintStart_toStartOf="@+id/imageView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -78,10 +78,12 @@
|
||||
android:id="@+id/tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
|
||||
app:tabIndicatorColor="@color/action_bar_red"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabSelectedTextColor="@color/action_bar_red"
|
||||
app:tabTextAppearance="@style/TabLayoutTextStyle"
|
||||
app:tabTextColor="@color/black"
|
||||
app:tabSelectedTextColor="@color/red"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||
app:tabTextColor="@color/black" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_nodata"
|
||||
@@ -98,7 +100,7 @@
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nodata"
|
||||
android:src="@drawable/icon_list_nodata"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -109,6 +111,7 @@
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:text="没有数据"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv1" />
|
||||
|
||||
@@ -14,23 +14,34 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabLayout"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:background="@color/action_bar_red"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabIndicatorColor="@color/white"
|
||||
app:tabTextAppearance="@style/InformationTextStyle"
|
||||
app:tabTextColor="@color/noti_text_gray" />
|
||||
android:background="@color/action_bar_red"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tabIndicatorColor="@color/white"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabTextAppearance="@style/InformationTextStyle"
|
||||
app:tabTextColor="@color/noti_text_gray" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_video"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tabLayout" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_bar" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_nodata"
|
||||
@@ -38,7 +49,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tabLayout">
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_bar">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
@@ -46,7 +57,7 @@
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_nodata"
|
||||
android:src="@drawable/icon_list_nodata"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
@@ -57,11 +68,11 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:text="没有数据"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="@+id/imageView"
|
||||
app:layout_constraintStart_toStartOf="@+id/imageView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
app:error="@{@drawable/he999}"
|
||||
app:error="@{@drawable/goods_placeholder}"
|
||||
app:imageUrl="@{goodsInfo.img}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_exit"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
@@ -52,8 +53,10 @@
|
||||
android:id="@+id/tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabIndicatorColor="@color/action_bar_red"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout21"
|
||||
app:tabSelectedTextColor="@color/red"
|
||||
app:tabSelectedTextColor="@color/action_bar_red"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabTextAppearance="@style/TabLayoutTextStyle"
|
||||
app:tabTextColor="@color/black">
|
||||
|
||||
@@ -94,8 +97,46 @@
|
||||
android:id="@+id/rv_order"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/gray"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tabLayout" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_nodata"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tabLayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_list_nodata"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.45" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:text="没有数据"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="@+id/imageView"
|
||||
app:layout_constraintStart_toStartOf="@+id/imageView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -58,7 +58,7 @@
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:error="@{@drawable/he999}"
|
||||
app:error="@{@drawable/goods_placeholder}"
|
||||
app:imageUrl="@{wxpayBean.goods_img}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -94,7 +94,7 @@
|
||||
android:id="@+id/tv_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="@{wxpayBean.price}"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_18"
|
||||
@@ -103,7 +103,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView13"
|
||||
tools:text="100.00" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wx_qrcode"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
android:layout_width="@dimen/dp_140"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:corner_radius="@dimen/dp_8"
|
||||
@@ -21,10 +22,13 @@
|
||||
android:id="@+id/tv_consult_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textColor="@color/black"
|
||||
android:maxLines="3"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_time"
|
||||
app:layout_constraintEnd_toStartOf="@+id/nv_consult"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -35,12 +39,22 @@
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:textColor="@color/gray"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/nv_consult"
|
||||
app:layout_constraintEnd_toStartOf="@+id/nv_consult"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@color/noti_color"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -11,6 +11,8 @@
|
||||
android:background="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
@@ -75,34 +77,71 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_unit_price"
|
||||
tools:text="1" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/sp_1"
|
||||
android:background="@color/gray"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_goods" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_paid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_goods"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view1"
|
||||
tools:text="实付:¥0元" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/sp_1"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:background="@color/gray"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_paid" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_express_info"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@drawable/express_background"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_express"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_express"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_express"
|
||||
tools:text="物流信息" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_express"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:background="@drawable/check_express_bg"
|
||||
android:maxLines="1"
|
||||
android:text="查看物流"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:background="@drawable/check_express_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_paid"
|
||||
android:text="查看物流" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view2" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/sp_1"
|
||||
android:background="@color/gray"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
58
app/src/main/res/layout/item_timeline.xml
Normal file
58
app/src/main/res/layout/item_timeline.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?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="@color/white"
|
||||
android:paddingStart="@dimen/dp_32"
|
||||
android:paddingEnd="@dimen/dp_32">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_action_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:textColor="@color/action_bar_red"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="完成" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_action"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:minLines="2"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_action_status"
|
||||
tools:text="测试一" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_action_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tv_action"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:textColor="#8e8e8e"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_action"
|
||||
tools:text="2017年3月8日16:49:12" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:background="@color/lightGray"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -50,4 +50,21 @@
|
||||
<attr name="tbAnimate" format="reference|boolean" />
|
||||
<attr name="tbAsDefaultOn" format="reference|boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TimelineLayout">
|
||||
<!--时间轴左偏移值-->
|
||||
<attr name="line_margin_left" format="dimension"/>
|
||||
<!--时间轴上偏移值-->
|
||||
<attr name="line_margin_top" format="dimension"/>
|
||||
<!--线宽-->
|
||||
<attr name="line_stroke_width" format="dimension"/>
|
||||
<!--线的颜色-->
|
||||
<attr name="line_color" format="color"/>
|
||||
<!--点的大小-->
|
||||
<attr name="point_size" format="dimension"/>
|
||||
<!--点的颜色-->
|
||||
<attr name="point_color" format="color"/>
|
||||
<!--图标-->
|
||||
<attr name="icon_src" format="reference"/>
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user