添加查看车辆位置功能
This commit is contained in:
parent
367caff796
commit
b0a1b04422
@ -10,6 +10,7 @@
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/keybordlib" />
|
||||
<option value="$PROJECT_DIR$/mylibrary" />
|
||||
</set>
|
||||
</option>
|
||||
|
@ -176,4 +176,5 @@ dependencies {
|
||||
|
||||
|
||||
implementation project(path: ':mylibrary')
|
||||
implementation project(':keybordlib')
|
||||
}
|
@ -72,6 +72,7 @@
|
||||
<activity android:name=".ui.LoginActivity" android:screenOrientation="portrait"/>
|
||||
<activity android:name=".ui.ForgetPwdActivity" android:screenOrientation="portrait"/>
|
||||
<activity android:name=".ui.my.AddressActivity" android:screenOrientation="portrait"/>
|
||||
<activity android:name=".ui.my.CheckCarLocActivity" android:screenOrientation="portrait"/>
|
||||
<activity android:name=".ui.my.AddressAddActivity" android:screenOrientation="portrait"/>
|
||||
<activity android:name=".ui.home.GoodsActivity" android:screenOrientation="portrait"/>
|
||||
<activity android:name=".ui.WebActivity" android:screenOrientation="portrait"/>
|
||||
|
@ -97,5 +97,9 @@ public class AddressRequest {
|
||||
RequestTest.test(1,COMPANY_SAVE,re,con,hd);
|
||||
}
|
||||
|
||||
|
||||
//获取车辆地址
|
||||
public void getCarLoca(String carNum){
|
||||
Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCarLocation()+carNum, "post", ""),getToken(con),con);
|
||||
RequestTest.test(1,"getcarlocation",re,con,hd);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.oneclouds.cargo.request.bean
|
||||
|
||||
/**
|
||||
* @ClassName GridBean
|
||||
* @Author 用户
|
||||
* @Date 2024/1/23 10:37
|
||||
* @Description TODO
|
||||
*/
|
||||
data class CarLocaBean(
|
||||
var adr:String,
|
||||
var carNumber:String,
|
||||
var utc : String,
|
||||
var lat : String,
|
||||
var lon : String,
|
||||
)
|
@ -67,6 +67,7 @@ public class UrlManager {
|
||||
private static final String ADDRESS_FIND_PAGE_MY_SELF = "/app/shipper/address/findPageMySelf";
|
||||
//地址信息保存
|
||||
private static final String ADDRESS_SAVE = "/app/shipper/address/save";
|
||||
private static final String CAR_LOCAION = "waybill/getCarPositioning?carNumber=";
|
||||
private static final String COMPANY_SAVE = "/app/shipper/auth/companyInfo";
|
||||
|
||||
/*--货主认证--*/
|
||||
@ -155,7 +156,7 @@ public class UrlManager {
|
||||
private static final String ORDER_DEL = "/app/shipper/order/orderDel";
|
||||
//货源撤销
|
||||
private static final String ORDER_REVOKE = "/cost/cancelOrder";
|
||||
// private static final String ORDER_REVOKE = "/app/shipper/order/orderRevoke";
|
||||
// private static final String ORDER_REVOKE = "/app/shipper/order/orderRevoke";
|
||||
//货源查询状态列表
|
||||
private static final String ORDER_STATELIST = "/app/shipper/order/orderStateList";
|
||||
//包装方式
|
||||
@ -330,6 +331,10 @@ public class UrlManager {
|
||||
return BASE_URL + ADDRESS_SAVE;
|
||||
}
|
||||
|
||||
public static String getCarLocation() {
|
||||
return BASE_URL + CAR_LOCAION;
|
||||
}
|
||||
|
||||
public static String getCompanyInfo() {
|
||||
return BASE_URL + COMPANY_SAVE;
|
||||
}
|
||||
|
@ -4,10 +4,12 @@ package com.oneclouds.cargo.request.net;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.oneclouds.cargo.BuildConfig;
|
||||
import com.oneclouds.cargo.bean.OrderBean2;
|
||||
import com.oneclouds.cargo.request.bean.CarLocaBean;
|
||||
import com.oneclouds.cargo.request.bean.CommonBodyBean;
|
||||
import com.oneclouds.cargo.request.bean.OrderInputBean;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import kotlin.ParameterName;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
@ -35,5 +37,9 @@ public interface Api {
|
||||
|
||||
@POST(BASE_URL+"app/shipper/order/publishOrder")
|
||||
Observable<CommonResponseBean> againOrder(@Body OrderInputBean bean);
|
||||
|
||||
@POST(BASE_URL+"waybill/getCarPositioning")
|
||||
Observable<CommonResponseBean<CarLocaBean>> getCarPositioning(@Query("carNumber") String carNumber);
|
||||
// Observable<CommonResponseBean<CarLocaBean>> getCarPositioning(@Body CarLocaBean carLocaBean);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,224 @@
|
||||
package com.oneclouds.cargo.ui.my
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import com.amap.api.maps.AMap
|
||||
import com.amap.api.maps.CameraUpdate
|
||||
import com.amap.api.maps.CameraUpdateFactory
|
||||
import com.amap.api.maps.CoordinateConverter
|
||||
import com.amap.api.maps.MapView
|
||||
import com.amap.api.maps.model.BitmapDescriptorFactory
|
||||
import com.amap.api.maps.model.CameraPosition
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.amap.api.maps.model.MarkerOptions
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.king.keyboard.KingKeyboard
|
||||
import com.oneclouds.cargo.R
|
||||
import com.oneclouds.cargo.request.AddressRequest
|
||||
import com.oneclouds.cargo.request.bean.CarLocaBean
|
||||
import com.oneclouds.cargo.util.cache.CacheGroup
|
||||
import com.oneclouds.cargo.util.titleutil.StateStyleUtil
|
||||
import kotlinx.android.synthetic.main.activity_check_car_loca.btnSearch
|
||||
import kotlinx.android.synthetic.main.activity_check_car_loca.etCar
|
||||
import kotlinx.android.synthetic.main.activity_check_car_loca.keyboardParent
|
||||
import kotlinx.android.synthetic.main.activity_check_car_loca.llContent
|
||||
import kotlinx.android.synthetic.main.activity_check_car_loca.map
|
||||
import kotlinx.android.synthetic.main.activity_check_car_loca.tvCarDate
|
||||
import kotlinx.android.synthetic.main.activity_check_car_loca.tvCarLoca
|
||||
import kotlinx.android.synthetic.main.assembly_title_block.return_btn
|
||||
import kotlinx.android.synthetic.main.assembly_title_block.title_view
|
||||
import java.math.BigDecimal
|
||||
import java.math.RoundingMode
|
||||
|
||||
/**
|
||||
* @ClassName CheckCarLocActivity
|
||||
* @Author john
|
||||
* @Date 2024/8/21 08:40
|
||||
* @Description TODO
|
||||
*/
|
||||
class CheckCarLocActivity : BaseActivity() {
|
||||
|
||||
private lateinit var kingKeyboard: KingKeyboard
|
||||
private lateinit var addressRequest: AddressRequest
|
||||
|
||||
|
||||
override fun msgMethod(m: Message) {
|
||||
super.msgMethod(m)
|
||||
when (m.what) {
|
||||
200 -> if (CacheGroup.cacheList["getcarlocation"] != null) {
|
||||
val type = object : TypeToken<CommonResponseBean<CarLocaBean?>?>() {}.type
|
||||
val u: CommonResponseBean<CarLocaBean> =
|
||||
Gson().fromJson<CommonResponseBean<CarLocaBean>>(
|
||||
CacheGroup.cacheList["getcarlocation"],
|
||||
type
|
||||
)
|
||||
val data = u.data
|
||||
dealData(data)
|
||||
CacheGroup.cacheList.remove(CacheGroup.cacheList["getcarlocation"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var ZHONGGUANCUN = LatLng(39.983456, 116.3154950) // 北京市中关村经纬度
|
||||
|
||||
|
||||
private var aMap: AMap? = null
|
||||
override fun getLayout() = R.layout.activity_check_car_loca
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
StateStyleUtil.stateTextColor(this)
|
||||
addressRequest = AddressRequest(mContext, hd)
|
||||
title_view.text = "查看位置"
|
||||
return_btn.setOnClickListener { finish() }
|
||||
map.onCreate(savedInstanceState)
|
||||
init(map)
|
||||
|
||||
kingKeyboard = KingKeyboard(this, keyboardParent)
|
||||
kingKeyboard.register(etCar, KingKeyboard.KeyboardType.LICENSE_PLATE_PROVINCE)
|
||||
|
||||
|
||||
btnSearch.setOnClickListener {
|
||||
val toString = etCar.text.toString()
|
||||
if (TextUtils.isEmpty(toString)) {
|
||||
ToastUtils.showToast(mContext, "请输入车牌号")
|
||||
return@setOnClickListener
|
||||
}
|
||||
addressRequest.getCarLoca(toString)
|
||||
// DataManager.getInstance().getCarPositioning("豫RWC376")
|
||||
// .compose(DataManager.setThread())
|
||||
// .subscribe(BaseObserver(mContext,object : RxHttpCallBack<CarLocaBean>(){
|
||||
// override fun onSuccess(t: CommonResponseBean<CarLocaBean>?) {
|
||||
// super.onSuccess(t)
|
||||
// }
|
||||
// }))
|
||||
|
||||
// XPopup.Builder(mContext)
|
||||
// .hasShadowBg(false)
|
||||
//// .moveUpToKeyboard(false) //如果不加这个,评论弹窗会移动到软键盘上面
|
||||
//// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
// // .isThreeDrag(true) //是否开启三阶拖拽,如果设置enableDrag(false)则无效
|
||||
// .asCustom(ZhihuCommentPopup(mContext,CarLocaBean("安徽省滁州市明光市夏桥,西南方向,463.9米","豫RWC376","2024-08-21 10:33:38",0.0,0.0)))
|
||||
// .show()
|
||||
|
||||
|
||||
// changeCamera(
|
||||
// CameraUpdateFactory.newCameraPosition(
|
||||
// CameraPosition(
|
||||
// ZHONGGUANCUN, 16f, 30f, 30f
|
||||
// )
|
||||
// )
|
||||
// )
|
||||
// Handler().postDelayed({
|
||||
// changeCamera(CameraUpdateFactory.scrollBy(0f , 150f))
|
||||
// }, 2000)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
|
||||
}
|
||||
|
||||
private fun dealData(data: CarLocaBean?) {
|
||||
kingKeyboard.hide()
|
||||
if (data == null) {
|
||||
ToastUtils.showToast(mContext, "未查到该车辆位置信息,请确认车牌号是否正确")
|
||||
return
|
||||
}
|
||||
|
||||
val lat = BigDecimal(data.lat).setScale(5, RoundingMode.HALF_UP)
|
||||
.divide(BigDecimal(600000), RoundingMode.HALF_UP).toDouble()
|
||||
|
||||
val lon = BigDecimal(data.lon).setScale(5, RoundingMode.HALF_UP)
|
||||
.divide(BigDecimal(600000), RoundingMode.HALF_UP).toDouble()
|
||||
|
||||
//gws84转高德经纬度
|
||||
val converter = CoordinateConverter(mContext)
|
||||
converter.from(CoordinateConverter.CoordType.GPS)
|
||||
converter.coord(LatLng(lat, lon))
|
||||
val desLatLng: LatLng = converter.convert()
|
||||
|
||||
ZHONGGUANCUN = desLatLng
|
||||
changeCamera(
|
||||
CameraUpdateFactory.newCameraPosition(
|
||||
CameraPosition(
|
||||
ZHONGGUANCUN, 16f, 30f, 30f
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
llContent.visibility = View.VISIBLE
|
||||
tvCarLoca.text = data.adr
|
||||
tvCarDate.text = data.utc
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化AMap对象
|
||||
*/
|
||||
private fun init(mapView: MapView) {
|
||||
if (aMap == null) {
|
||||
aMap = mapView.map
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法必须重写
|
||||
*/
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
map.onResume()
|
||||
kingKeyboard.onResume()
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法必须重写
|
||||
*/
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
map.onPause()
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法必须重写
|
||||
*/
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
map.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法必须重写
|
||||
*/
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
map.onDestroy()
|
||||
kingKeyboard.onDestroy()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据动画按钮状态,调用函数animateCamera或moveCamera来改变可视区域
|
||||
*/
|
||||
private fun changeCamera(update: CameraUpdate) {
|
||||
aMap?.run {
|
||||
animateCamera(update, 1000, null);
|
||||
//添加mark
|
||||
clear()
|
||||
addMarker(
|
||||
MarkerOptions().position(ZHONGGUANCUN)
|
||||
.icon(
|
||||
BitmapDescriptorFactory.fromResource(R.drawable.icon_gua)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
package com.oneclouds.cargo.ui.my;
|
||||
|
||||
import static com.oneclouds.cargo.request.AddressRequest.COMPANY_SAVE;
|
||||
import static com.oneclouds.cargo.request.PublicRequest.USER_DATA;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@ -16,11 +20,15 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.oneclouds.cargo.R;
|
||||
import com.oneclouds.cargo.bean.UserBean;
|
||||
import com.oneclouds.cargo.constant.SPConstant;
|
||||
import com.oneclouds.cargo.request.PublicRequest;
|
||||
import com.oneclouds.cargo.request.manager.UrlManager;
|
||||
import com.oneclouds.cargo.ui.WebActivity;
|
||||
|
||||
import com.oneclouds.cargo.ui.home.OrderListActivity;
|
||||
@ -28,11 +36,21 @@ import com.oneclouds.cargo.ui.my.auth.MyAuthActivity;
|
||||
import com.oneclouds.cargo.ui.my.invoice.InvoiceActivity;
|
||||
import com.oneclouds.cargo.ui.parts.ConfigParts;
|
||||
import com.oneclouds.cargo.ui.parts.UserParts;
|
||||
import com.oneclouds.cargo.util.MapUtil;
|
||||
import com.oneclouds.cargo.util.SPUtil;
|
||||
import com.oneclouds.cargo.util.StringUtil;
|
||||
|
||||
import com.oneclouds.cargo.util.cache.CacheGroup;
|
||||
import com.oneclouds.cargo.util.http.OkDate;
|
||||
import com.oneclouds.cargo.util.http.OkHttpUtil;
|
||||
import com.oneclouds.cargo.util.http.RequestTest;
|
||||
import com.oneclouds.cargo.util.view.BaseFragment;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.Request;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
@ -51,15 +69,15 @@ public class MyFragment extends BaseFragment {
|
||||
super.msgMethod(m);
|
||||
switch (m.what){
|
||||
case 200:
|
||||
if(CacheGroup.cacheList.get(PublicRequest.USER_DATA)!=null){
|
||||
if(CacheGroup.cacheList.get(USER_DATA)!=null){
|
||||
refreshLayout.finishRefresh();
|
||||
UserBean u=gson.fromJson(CacheGroup.cacheList.get(PublicRequest.USER_DATA),UserBean.class);
|
||||
UserBean u=gson.fromJson(CacheGroup.cacheList.get(USER_DATA),UserBean.class);
|
||||
if (ub.getCode()==200) {
|
||||
ub=u;
|
||||
UserParts.setUser(con,ub);
|
||||
initAuth();
|
||||
}
|
||||
CacheGroup.cacheList.remove(CacheGroup.cacheList.get(PublicRequest.USER_DATA));
|
||||
CacheGroup.cacheList.remove(CacheGroup.cacheList.get(USER_DATA));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -94,7 +112,7 @@ public class MyFragment extends BaseFragment {
|
||||
|
||||
|
||||
private LinearLayout onGetUser,onAllOrder,onAuth,onDriverHome;
|
||||
private ImageView onContact,onOpinion,onUpdate,onSetUp;
|
||||
private ImageView onContact,onOpinion,onUpdate,onSetUp,onSeeLocation;
|
||||
private TextView name,phone;
|
||||
private ImageView dang_auth,no_auth,name_auth;
|
||||
private LinearLayout auth_box;
|
||||
@ -117,6 +135,7 @@ public class MyFragment extends BaseFragment {
|
||||
onOpinion=root.findViewById(R.id.onOpinion);
|
||||
onUpdate=root.findViewById(R.id.onUpdate);
|
||||
onSetUp=root.findViewById(R.id.onSetUp);
|
||||
onSeeLocation=root.findViewById(R.id.onSeeLocation);
|
||||
img_head=root.findViewById(R.id.img_head);
|
||||
//
|
||||
ll_type_1=root.findViewById(R.id.ll_type_1);
|
||||
@ -197,6 +216,23 @@ public class MyFragment extends BaseFragment {
|
||||
in.putExtra("url",url);
|
||||
startActivity(in);
|
||||
});
|
||||
|
||||
onSeeLocation.setOnClickListener(v->{
|
||||
|
||||
// Map<String,Object> map=new HashMap();
|
||||
// map.put("carNumber","豫RMH562");
|
||||
Request re = OkHttpUtil.posts(new OkDate("http://app.test.dahehuoyun.com/api/"+"waybill/getCarPositioning?carNumber="+"豫RWC376", "post", ""),getToken(con),con);
|
||||
RequestTest.test(1,USER_DATA+"safdsfas",re,con,hd);
|
||||
|
||||
// Request re = OkHttpUtil.get(new OkDate("http://app.test.dahehuoyun.com/api/"+"waybill/getCarPositioning?carNumber="+"豫RWC376", "post", ""),getToken(con),con);
|
||||
// RequestTest.test(1,COMPANY_SAVE+"asdfas",re,con,hd);
|
||||
|
||||
ActivityUtils.startActivity(con,CheckCarLocActivity.class);
|
||||
});
|
||||
}
|
||||
|
||||
public String getToken(Context con) {
|
||||
return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN);
|
||||
}
|
||||
|
||||
public void initAuth(){
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.oneclouds.cargo.weight.pop;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.lxj.xpopup.util.XPopupUtils;
|
||||
import com.oneclouds.cargo.R;
|
||||
import com.oneclouds.cargo.request.bean.CarLocaBean;
|
||||
|
||||
|
||||
/**
|
||||
* Description: 仿知乎底部评论弹窗
|
||||
* Create by dance, at 2018/12/25
|
||||
*/
|
||||
public class ZhihuCommentPopup extends BottomPopupView {
|
||||
|
||||
|
||||
private CarLocaBean data;
|
||||
public ZhihuCommentPopup(@NonNull Context context, CarLocaBean data) {
|
||||
super(context);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.custom_bottom_popup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
((TextView)findViewById(R.id.tvCarLoca)).setText(data.getAdr());
|
||||
((TextView)findViewById(R.id.tvCarDate)).setText(data.getUtc());
|
||||
|
||||
}
|
||||
|
||||
//完全可见执行
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
Log.e("tag", "知乎评论 onShow");
|
||||
}
|
||||
|
||||
//完全消失执行
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
Log.e("tag", "知乎评论 onDismiss");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxHeight() {
|
||||
return (int) (XPopupUtils.getScreenHeight(getContext()) * .7f);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected boolean onBackPressed() {
|
||||
// Toast.makeText(getContext(), "拦截返回", Toast.LENGTH_SHORT).show();
|
||||
// return true;
|
||||
// }
|
||||
}
|
BIN
app/src/main/res/drawable-xxhdpi/login_car.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/login_car.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 211 KiB |
BIN
app/src/main/res/drawable-xxhdpi/search.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/search.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
6
app/src/main/res/drawable/bg_round.xml
Normal file
6
app/src/main/res/drawable/bg_round.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp"/>
|
||||
<solid android:color="#fff"/>
|
||||
</shape>
|
BIN
app/src/main/res/drawable/icon_gua.png
Normal file
BIN
app/src/main/res/drawable/icon_gua.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
11
app/src/main/res/drawable/search_bg.xml
Normal file
11
app/src/main/res/drawable/search_bg.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#fff5f5f5" />
|
||||
<corners
|
||||
android:radius="@dimen/dp_22"
|
||||
></corners>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
app/src/main/res/drawable/shape_search_bg.xml
Normal file
9
app/src/main/res/drawable/shape_search_bg.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#ffff4a02" />
|
||||
<corners
|
||||
android:radius="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
</shape>
|
137
app/src/main/res/layout/activity_check_car_loca.xml
Normal file
137
app/src/main/res/layout/activity_check_car_loca.xml
Normal file
@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/assembly_title_block" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etCar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/search_bg"
|
||||
android:drawableLeft="@drawable/search"
|
||||
android:drawablePadding="@dimen/dp_6"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入车牌号"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/sp_12"></EditText>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSearch"
|
||||
android:layout_width="@dimen/dp_57"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_9"
|
||||
android:background="@drawable/shape_search_bg"
|
||||
android:text="搜索"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"></Button>
|
||||
</LinearLayout>
|
||||
|
||||
<com.amap.api.maps.MapView
|
||||
android:id="@+id/map"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/bg_round"
|
||||
android:maxHeight="500dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:paddingBottom="@dimen/dp_22">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivHead"
|
||||
android:layout_width="@dimen/dp_84"
|
||||
android:layout_height="@dimen/dp_84"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:background="@drawable/login_car" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCarLoca"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_weight="1"
|
||||
android:text="王师傅"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCarDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:text="15835201103"
|
||||
android:textColor="@color/color_9"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_alignParentBottom="true"
|
||||
android:id="@+id/keyboardParent"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</RelativeLayout>
|
73
app/src/main/res/layout/custom_bottom_popup.xml
Normal file
73
app/src/main/res/layout/custom_bottom_popup.xml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxHeight="500dp"
|
||||
android:background="@drawable/bg_round"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingBottom="@dimen/dp_22"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivHead"
|
||||
android:layout_width="@dimen/dp_84"
|
||||
android:layout_height="@dimen/dp_84"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:background="@drawable/login_car" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/tvCarLoca"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:text="王师傅"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCarDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:text="15835201103"
|
||||
android:textColor="@color/color_9"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -391,6 +391,16 @@
|
||||
android:src="@mipmap/icon_my_8"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/onSeeLocation"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:src="@mipmap/icon_my_8"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<View android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_90"/>
|
||||
|
||||
|
@ -4,11 +4,14 @@ import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.DrawableRes;
|
||||
@ -39,6 +42,28 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
protected Toolbar mToolbar;
|
||||
protected int mRefreshPage = 1;
|
||||
protected int mRefreshCount = 15;
|
||||
|
||||
public Handler hd=new Handler(msg -> {
|
||||
msgMethod(msg);
|
||||
return false;
|
||||
});
|
||||
|
||||
public void msgMethod(Message m){
|
||||
switch (m.what){
|
||||
case -1:
|
||||
Toast.makeText(mContext,"请求失败,请检查网络状况",Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case 404:
|
||||
Toast.makeText(mContext,"请求地址未找到",Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case 500:
|
||||
Toast.makeText(mContext,"服务器出现异常",Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case 502:
|
||||
Toast.makeText(mContext,"网关错误",Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -1,3 +1,4 @@
|
||||
rootProject.name = "app-dhhy-cargo"
|
||||
include ':app'
|
||||
include ':mylibrary'
|
||||
include ':keybordlib'
|
||||
|
Loading…
Reference in New Issue
Block a user