app/src/main/java/com/liuzhou/callcar/driver/pad/base/MainBroadCastReceiver.kt
@@ -35,7 +35,7 @@ loginOut(contexts) CacheUtil.get().clear() NettyClient.getInstance().stopService() getInstance()?.stopUpPoint() // getInstance()?.stopUpPoint() EventBus.getDefault().post(BaseEvent(BaseEvent.OUT_APP)) } else { if (getToken().isNullOrEmpty()) { app/src/main/java/com/liuzhou/callcar/driver/pad/base/MyApplication.kt
@@ -48,6 +48,18 @@ var aMapTrackClient: AMapTrackClient? = null var trackParam: TrackParam? = null val bean = CarLocationBean().apply { data = CarLocationBean.DataBean( 0, "", "", 0.0, 0.0, 0.0, 0.0 ) } override fun setSharedPreferencesName(): String { return "MyApplication" } @@ -75,9 +87,6 @@ } private fun initSocket() { Handler(Looper.getMainLooper()).post { // toast("websocket初始化") } NettyClient.getInstance().init(this, Api.SOCKET_SERVER, Api.SOCKET_PORT, true) NettyClient.getInstance() .addOnMessageListener { message: String? -> @@ -90,9 +99,6 @@ if (method != "OK" && method != "PONG") upLog("收到服务端推送,method:${method}") Handler(Looper.getMainLooper()).post { // toast("收到websocket=$method") } val data = json.optString("data") val code = json.optInt("code", -1) if (code == 200) { @@ -266,23 +272,21 @@ private fun sendLocation() { if (getUserId() != -1 && aMapLocation != null) { val bean = CarLocationBean() val dataBean = CarLocationBean.DataBean( getUserId(), currentOrderId, currentOrderType, aMapLocation!!.longitude, aMapLocation!!.latitude, aMapLocation!!.bearing.toDouble(), aMapLocation!!.altitude ) bean.data = dataBean bean.data.apply { driverId = getUserId() orderId = currentOrderId orderType = currentOrderType lon = aMapLocation!!.longitude lat = aMapLocation!!.latitude computeAzimuth = aMapLocation!!.bearing.toDouble() altitude = aMapLocation!!.altitude } NettyClient.getInstance() .sendMessage(Gson().toJson(bean)) Handler(Looper.getMainLooper()).post { // toast("发送location --> $dataBean") } sysErr(dataBean.toString()) sysErr(bean.data.toString()) } } @@ -352,10 +356,10 @@ } } set(value) { // value?.apply { // latitude = 30.59 // longitude = 104.06 // } value?.apply { latitude = 30.59 longitude = 104.06 } field = value CacheKey.putKeyStr("location", if (value == null) "" else Gson().toJson(value)) } app/src/main/java/com/liuzhou/callcar/driver/pad/base/MyBaseActivity.java
@@ -30,7 +30,6 @@ import com.google.gson.Gson; import com.liuzhou.callcar.driver.pad.R; import com.liuzhou.callcar.driver.pad.slab.util.DialogUtil; import com.liuzhou.callcar.driver.pad.utils.ActivityCollector; import com.liuzhou.callcar.driver.pad.utils.EasePopup.EasyPopup; import org.greenrobot.eventbus.EventBus; @@ -76,8 +75,6 @@ super.onCreate(savedInstanceState); initParam(); EventBus.getDefault().register(this); ActivityCollector.addActivity(this, getClass()); ActivityCollector.getActivityCollector().addActivity(this); setTouMing(); initData(); setBlcakShow(isBlackshow); @@ -244,8 +241,6 @@ @Override protected void onDestroy() { super.onDestroy(); ActivityCollector.removeActivity(this); ActivityCollector.getActivityCollector().finishActivity(this); EventBus.getDefault().unregister(this); } app/src/main/java/com/liuzhou/callcar/driver/pad/netUtls/MyObserver.java
@@ -94,7 +94,7 @@ if (baseBean.getCode() == 600) { CacheUtil.get().clear(); NettyClient.getInstance().stopService(); MyApplication.Companion.getInstance().stopUpPoint(); // MyApplication.Companion.getInstance().stopUpPoint(); Intent intent = new Intent(); intent.setClass(MyApplication.Companion.getAppContext(), SlabLoginActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); app/src/main/java/com/liuzhou/callcar/driver/pad/slab/MySlabBaseActivity.java
@@ -32,7 +32,6 @@ import com.liuzhou.callcar.driver.pad.slab.util.DialogUtil; import com.github.zackratos.ultimatebar.UltimateBar; import com.google.gson.Gson; import com.liuzhou.callcar.driver.pad.utils.ActivityCollector; import com.liuzhou.callcar.driver.pad.utils.EasePopup.EasyPopup; import com.liuzhou.callcar.driver.pad.utils.MyUtils; @@ -83,8 +82,6 @@ initParam(); MyUtils.getInstans().keepScreenLongLight(this,true); EventBus.getDefault().register(this); ActivityCollector.addActivity(this, getClass()); ActivityCollector.getActivityCollector().addActivity(this); setTouMing(); initData(); setBlcakShow(isBlackshow); @@ -273,8 +270,6 @@ protected void onDestroy() { super.onDestroy(); closePop(); ActivityCollector.removeActivity(this); ActivityCollector.getActivityCollector().finishActivity(this); EventBus.getDefault().unregister(this); } app/src/main/java/com/liuzhou/callcar/driver/pad/slab/SlabMainActivity.kt
@@ -66,7 +66,7 @@ tv_current_time.textColor(this, R.color.write) tv_company.textColor(this, R.color.write) tv_time.textColor(this, R.color.write) tv_car_statue.textColor(this, R.color.write) // tv_car_statue.textColor(this, R.color.write) tv_title.textColor(this, R.color.slab_yellow_zhong) } else { ll_top.setBackgroundResource(R.drawable.bg_green_top) @@ -81,7 +81,7 @@ tv_current_time.textColor(this, R.color.black) tv_company.textColor(this, R.color.black) tv_time.textColor(this, R.color.black) tv_car_statue.textColor(this, R.color.black) // tv_car_statue.textColor(this, R.color.black) tv_title.textColor(this, R.color.yellow_ffa72d) } } @@ -97,7 +97,7 @@ aMapLocationClient = AMapKit.initLocation(this, this) initCall() NettyClient.getInstance().startService() MyApplication.getInstance()?.initUpPoint() // MyApplication.getInstance()?.initUpPoint() callPersion() // showOrder("2221", "2", 100, 2) callVersion() app/src/main/java/com/liuzhou/callcar/driver/pad/slab/SlabTripActivity.kt
@@ -149,7 +149,7 @@ onclick() addSockectCancel() changeMode() MyApplication.getInstance()?.initUpPoint() // MyApplication.getInstance()?.initUpPoint() } private fun addSockectCancel() { app/src/main/java/com/liuzhou/callcar/driver/pad/utils/ActivityCollector.java
File was deleted app/src/main/java/com/liuzhou/callcar/driver/pad/utils/UniException.java
File was deleted app/src/main/res/layout/slab_activity_main.xml
@@ -228,29 +228,29 @@ app:layout_constraintTop_toBottomOf="@+id/iv_head" /> <com.wang.avi.AVLoadingIndicatorView style="@style/AVLoadingIndicatorView.Small" android:layout_width="150dp" android:layout_height="150dp" android:layout_marginEnd="52dp" android:layout_marginBottom="5dp" app:indicatorColor="#E8340C" app:indicatorName="BallScaleMultipleIndicator" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/tv_car" /> <!-- <com.wang.avi.AVLoadingIndicatorView--> <!-- style="@style/AVLoadingIndicatorView.Small"--> <!-- android:layout_width="150dp"--> <!-- android:layout_height="150dp"--> <!-- android:layout_marginEnd="52dp"--> <!-- android:layout_marginBottom="5dp"--> <!-- app:indicatorColor="#E8340C"--> <!-- app:indicatorName="BallScaleMultipleIndicator"--> <!-- app:layout_constraintBottom_toBottomOf="parent"--> <!-- app:layout_constraintEnd_toStartOf="@+id/tv_car" />--> <TextView android:id="@+id/tv_car_statue" android:layout_width="150dp" android:layout_height="150dp" android:layout_marginEnd="52dp" android:layout_marginBottom="5dp" android:gravity="center" android:text="听单中" android:textColor="@color/black" android:textSize="40sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/tv_car" /> <!-- <TextView--> <!-- android:id="@+id/tv_car_statue"--> <!-- android:layout_width="150dp"--> <!-- android:layout_height="150dp"--> <!-- android:layout_marginEnd="52dp"--> <!-- android:layout_marginBottom="5dp"--> <!-- android:gravity="center"--> <!-- android:text="听单中"--> <!-- android:textColor="@color/black"--> <!-- android:textSize="40sp"--> <!-- app:layout_constraintBottom_toBottomOf="parent"--> <!-- app:layout_constraintEnd_toStartOf="@+id/tv_car" />--> <TextView xldUtils/proguard-rules.pro
@@ -122,8 +122,8 @@ # Gson -keepattributes Signature-keepattributes *Annotation* -keep class sun.misc.Unsafe { *; } #-keepattributes Signature-keepattributes *Annotation* #-keep class sun.misc.Unsafe { *; } -keep class com.google.gson.stream.** { *; } # Application classes that will be serialized/deserialized over Gson # 正式项目需添加对应的java bean目录 xldUtils/src/main/java/cn/sinata/xldutils/activitys/BaseActivity.java
@@ -28,8 +28,6 @@ private ProgressDialog dialog; public boolean isDestroy = false; protected ViewHolder mHolder; protected Context mContext;//上下文 protected int mScreenWidth;//设备宽 protected int mScreenHeight;//设备高 public static final int REQUEST_NORMAL = 43214; @@ -86,9 +84,7 @@ mScreenHeight = DensityUtil.getDeviceHeight(this); mScreenWidth = DensityUtil.getDeviceWidth(this); mContext = this; isDestroy = false; mHolder = new ViewHolder(this); mNetChangeObserver = new NetChangeObserver() { @Override @@ -128,9 +124,6 @@ } if (mHolder!=null){ mHolder.unBind(); } isDestroy = true; dismissDialog(); if (!compositeSubscription.isDisposed()){ @@ -200,7 +193,7 @@ */ @SuppressWarnings("unchecked") protected <T extends View> T bind(int resId){ return (T) mHolder.bind(resId); return (T) findViewById(resId); } /** @@ -228,7 +221,7 @@ return; } if(dialog==null){ dialog=new ProgressDialog(mContext,R.style.Theme_ProgressDialog); dialog=new ProgressDialog(this,R.style.Theme_ProgressDialog); } dialog.setCanceledOnTouchOutside(canCancel); dialog.setMessage(msg); xldUtils/src/main/java/cn/sinata/xldutils/activitys/CropImageActivity.java
@@ -54,11 +54,11 @@ @Override public void onClick(View v) { if (!Utils.ExistSDCard()) { Toast.create(mContext).show("未检测到SD卡!请安装后重试!"); Toast.create(CropImageActivity.this).show("未检测到SD卡!请安装后重试!"); return; } if (Utils.getSDFreeSize() < 10) { Toast.create(mContext).show("SD卡剩余空间太小!"); Toast.create(CropImageActivity.this).show("SD卡剩余空间太小!"); return; } final Bitmap bitmap = mZoomImageView.clip(); xldUtils/src/main/java/cn/sinata/xldutils/activitys/SlabBaseActivity.java
@@ -26,7 +26,6 @@ public abstract class SlabBaseActivity extends RxFragmentActivity { private ProgressDialog dialog; protected ViewHolder mHolder; protected int mScreenWidth;//设备宽 protected int mScreenHeight;//设备高 public static final int REQUEST_NORMAL = 43214; @@ -83,7 +82,6 @@ mScreenHeight = DensityUtil.getDeviceHeight(this); mScreenWidth = DensityUtil.getDeviceWidth(this); mHolder = new ViewHolder(this); mNetChangeObserver = new NetChangeObserver() { @Override @@ -123,9 +121,6 @@ } if (mHolder!=null){ mHolder.unBind(); } dismissDialog(); if (!compositeSubscription.isDisposed()){ compositeSubscription.dispose(); @@ -194,7 +189,7 @@ */ @SuppressWarnings("unchecked") protected <T extends View> T bind(int resId){ return (T) mHolder.bind(resId); return (T) findViewById(resId); } /**