| | |
| | | applicationId "com.future.driver" |
| | | minSdkVersion 21 |
| | | targetSdkVersion 29 |
| | | versionCode 1 |
| | | versionName "1.0" |
| | | versionCode 2 |
| | | versionName "1.1" |
| | | multiDexEnabled true |
| | | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| | | ndk { |
| | |
| | | public static final int START_RECORD = 10032; //开始录音任务 |
| | | public static final int FINISH_RECORD = 10033; //结束录音任务 |
| | | |
| | | public static final int EXIT_NAVI = 10035; // 退出导航 |
| | | |
| | | private String msg; |
| | | private int code; |
| | |
| | | |
| | | |
| | | object AMapKit { |
| | | |
| | | fun initLocation(context: Context, lisener: AMapLocationListener) { //初始化定位 |
| | | var mlocationClient = AMapLocationClient(context) |
| | | //初始化定位参数 |
| | |
| | | } |
| | | |
| | | fun moveCamera(aMap: AMap, start: LatLng?, end: LatLng?) { |
| | | var bounds: LatLngBounds? = null |
| | | if (start!!.latitude < end!!.latitude) |
| | | bounds = LatLngBounds(start, end) |
| | | else |
| | | bounds = LatLngBounds(end, start) |
| | | var bounds: LatLngBounds = getLatLngBounds(start!!,end!!) |
| | | val mCameraUpdate = CameraUpdateFactory.newLatLngBounds(bounds, 150) |
| | | aMap.animateCamera(mCameraUpdate, object : AMap.CancelableCallback { |
| | | override fun onFinish() { |
| | |
| | | sysErr("onCancel") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | fun getLatLngBounds(start: LatLng, end: LatLng): LatLngBounds { |
| | | val b = LatLngBounds.builder() |
| | | b.include(LatLng(start.latitude, start.longitude)) |
| | | b.include(LatLng(end.latitude, end.longitude)) |
| | | return b.build() |
| | | } |
| | | |
| | | fun moveCamera(aMap: AMap, start: LatLng?, end: LatLng?, padd: Int) { |
| | |
| | | /*** |
| | | * 绘制圆形形围栏 |
| | | */ |
| | | fun drawFenceByCricle(context: Context, dPoint: DPoint,bg:Float, va1: GeoFenceListener) { |
| | | fun drawFenceByCricle(context: Context, dPoint: DPoint, bg: Float, va1: GeoFenceListener) { |
| | | val mGeoFenceClient = GeoFenceClient(context) |
| | | mGeoFenceClient.setActivateAction(GeoFenceClient.GEOFENCE_IN) |
| | | mGeoFenceClient.addGeoFence("", "",dPoint,bg,-1,"") |
| | | mGeoFenceClient.addGeoFence("", "", dPoint, bg, -1, "") |
| | | mGeoFenceClient.setGeoFenceListener(va1); |
| | | } |
| | | |
| | |
| | | fun drawFace(context: Context, aMap: AMap, latLngs: List<LatLng?>?): Polygon? { |
| | | var po = PolygonOptions().addAll(latLngs) |
| | | .fillColor(ContextCompat.getColor(context, R.color.l_transparent_10)).strokeColor( |
| | | Color.RED |
| | | ).strokeWidth(1f) |
| | | Color.RED |
| | | ).strokeWidth(1f) |
| | | return aMap.addPolygon(po) |
| | | } |
| | | |
| | | fun drawCricle(context: Context, aMap: AMap, latLng: LatLng,bg:Double): Circle? { |
| | | return aMap.addCircle(CircleOptions(). |
| | | center(latLng). |
| | | radius(bg). |
| | | fillColor(ContextCompat.getColor(context, R.color.l_transparent_10)). |
| | | strokeColor( Color.RED). |
| | | strokeWidth(1f)); |
| | | fun drawCricle(context: Context, aMap: AMap, latLng: LatLng, bg: Double): Circle? { |
| | | return aMap.addCircle( |
| | | CircleOptions().center(latLng).radius(bg) |
| | | .fillColor(ContextCompat.getColor(context, R.color.l_transparent_10)) |
| | | .strokeColor(Color.RED).strokeWidth(1f) |
| | | ); |
| | | } |
| | | |
| | | |
| | |
| | | /*** |
| | | * 逆地址编码 |
| | | */ |
| | | fun getAddress(context: Context,lat:Double,lon:Double,function:(String)->Unit) { |
| | | fun getAddress(context: Context, lat: Double, lon: Double, function: (String) -> Unit) { |
| | | var geocoderSearch = GeocodeSearch(context); |
| | | // 第一个参数表示一个Latlng,第二参数表示范围多少米,第三个参数表示是火系坐标系还是GPS原生坐标系 |
| | | var query = RegeocodeQuery(LatLonPoint(lat,lon), 500f,GeocodeSearch.AMAP); |
| | | var query = RegeocodeQuery(LatLonPoint(lat, lon), 500f, GeocodeSearch.AMAP); |
| | | geocoderSearch.getFromLocationAsyn(query); |
| | | geocoderSearch.setOnGeocodeSearchListener(object : GeocodeSearch.OnGeocodeSearchListener { |
| | | override fun onRegeocodeSearched(p0: RegeocodeResult?, p1: Int) { |
| | | p0?.let { |
| | | if (p1 != 1000){ |
| | | if (p1 != 1000) { |
| | | function("") |
| | | }else{ |
| | | } else { |
| | | function(it.regeocodeAddress.adCode) |
| | | } |
| | | } |
| | |
| | | /*** |
| | | * 逆地址编码 |
| | | */ |
| | | fun getAddressReg(context: Context,lat:Double,lon:Double,function:(RegeocodeAddress)->Unit) { |
| | | fun getAddressReg( |
| | | context: Context, |
| | | lat: Double, |
| | | lon: Double, |
| | | function: (RegeocodeAddress) -> Unit |
| | | ) { |
| | | var geocoderSearch = GeocodeSearch(context); |
| | | // 第一个参数表示一个Latlng,第二参数表示范围多少米,第三个参数表示是火系坐标系还是GPS原生坐标系 |
| | | var query = RegeocodeQuery(LatLonPoint(lat,lon), 500f,GeocodeSearch.AMAP); |
| | | var query = RegeocodeQuery(LatLonPoint(lat, lon), 500f, GeocodeSearch.AMAP); |
| | | geocoderSearch.getFromLocationAsyn(query); |
| | | geocoderSearch.setOnGeocodeSearchListener(object : GeocodeSearch.OnGeocodeSearchListener { |
| | | override fun onRegeocodeSearched(p0: RegeocodeResult?, p1: Int) { |
| | | p0?.let { |
| | | if (p1 != 1000){ |
| | | if (p1 != 1000) { |
| | | |
| | | }else{ |
| | | } else { |
| | | function(it.regeocodeAddress) |
| | | } |
| | | } |
| | |
| | | import com.amap.api.navi.AMapNaviListener; |
| | | import com.amap.api.navi.AMapNaviView; |
| | | import com.amap.api.navi.AMapNaviViewListener; |
| | | import com.amap.api.navi.enums.BroadcastMode; |
| | | import com.amap.api.navi.model.AMapCalcRouteResult; |
| | | import com.amap.api.navi.model.AMapLaneInfo; |
| | | import com.amap.api.navi.model.AMapModelCross; |
| | |
| | | |
| | | |
| | | public class BaseGpsMapActivity extends Activity implements AMapNaviListener, AMapNaviViewListener { |
| | | |
| | | protected AMapNaviView mAMapNaviView; |
| | | protected AMapNavi mAMapNavi; |
| | | protected TTSController mTtsManager; |
| | |
| | | mStartLatlng = new NaviLatLng(mStart.latitude, mStart.longitude); |
| | | mEndLatlng = new NaviLatLng(mEnd.latitude, mEnd.longitude); |
| | | //设置模拟导航的行车速度 |
| | | mAMapNavi.setEmulatorNaviSpeed(75); |
| | | mAMapNavi.setEmulatorNaviSpeed(100); |
| | | mAMapNavi.setBroadcastMode(BroadcastMode.DETAIL); |
| | | |
| | | sList.add(mStartLatlng); |
| | | eList.add(mEndLatlng); |
| | | } |
| | |
| | | @Override |
| | | public void onStartNavi(int type) { |
| | | //开始导航回调 |
| | | // mTtsManager.setVideoText("准备出发"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void onGetNavigationText(int type, String text) { |
| | | //播报类型和播报文字回调 |
| | | mTtsManager.setVideoText(text); |
| | | AMapNavi.setTtsPlaying(true); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void notifyParallelRoad(int i) { |
| | | if (i == 0) { |
| | | // Toast.makeText(this, "当前在主辅路过渡", Toast.LENGTH_SHORT).show(); |
| | | mTtsManager.setVideoText("当前在主辅路过渡"); |
| | | // mTtsManager.setVideoText("当前在主辅路过渡"); |
| | | Log.d("wlx", "当前在主辅路过渡"); |
| | | return; |
| | | } |
| | | if (i == 1) { |
| | | // Toast.makeText(this, "当前在主路", Toast.LENGTH_SHORT).show(); |
| | | mTtsManager.setVideoText("当前在主路"); |
| | | // mTtsManager.setVideoText("当前在主路"); |
| | | Log.d("wlx", "当前在主路"); |
| | | return; |
| | | } |
| | | if (i == 2) { |
| | | // Toast.makeText(this, "当前在辅路", Toast.LENGTH_SHORT).show(); |
| | | mTtsManager.setVideoText("当前在辅路"); |
| | | // mTtsManager.setVideoText("当前在辅路"); |
| | | Log.d("wlx", "当前在辅路"); |
| | | } |
| | | } |
| | |
| | | public boolean onNaviBackClick() { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.future.driver.base.gaode.gpsnav; |
| | | |
| | | import android.os.Bundle; |
| | | import android.view.WindowManager; |
| | | |
| | | import com.amap.api.navi.AMapNaviViewOptions; |
| | | import com.amap.api.navi.enums.NaviType; |
| | | import com.future.driver.R; |
| | | import com.future.driver.base.BaseEvent; |
| | | |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | |
| | | public class GPSNaviActivity extends BaseGpsMapActivity { |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); |
| | | super.onCreate(savedInstanceState); |
| | | |
| | | setContentView(R.layout.activity_basic_navi); |
| | |
| | | AMapNaviViewOptions options = new AMapNaviViewOptions(); |
| | | options.setScreenAlwaysBright(false); |
| | | mAMapNaviView.setViewOptions(options); |
| | | |
| | | EventBus.getDefault().register(this); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void onCalculateRouteSuccess(int[] ids) { |
| | | super.onCalculateRouteSuccess(ids); |
| | | mAMapNavi.startNavi(NaviType.GPS); |
| | | // mAMapNavi.startNavi(NaviType.EMULATOR); |
| | | |
| | | } |
| | | |
| | | @Subscribe |
| | | public void exitNavi(BaseEvent e){ |
| | | if (e.getCode() == BaseEvent.EXIT_NAVI) |
| | | finish(); |
| | | } |
| | | |
| | | @Override |
| | | public void onArriveDestination() { |
| | | super.onArriveDestination(); |
| | | finish(); |
| | | } |
| | | |
| | | @Override |
| | | public void onEndEmulatorNavi() { |
| | | super.onEndEmulatorNavi(); |
| | | finish(); |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | } |
| | |
| | | import android.os.Message; |
| | | import android.util.Log; |
| | | |
| | | import com.amap.api.navi.AMapNavi; |
| | | import com.amap.api.navi.AMapNaviListener; |
| | | import com.amap.api.navi.model.AMapCalcRouteResult; |
| | | import com.amap.api.navi.model.AMapLaneInfo; |
| | |
| | | */ |
| | | public class TTSController implements AMapNaviListener, ICallBack { |
| | | |
| | | |
| | | @Override |
| | | public void onCompleted(int code) { |
| | | AMapNavi.setTtsPlaying(false); |
| | | |
| | | if (handler != null) { |
| | | handler.obtainMessage(1).sendToTarget(); |
| | | } |
| | |
| | | } |
| | | |
| | | public void init() { |
| | | Log.e("mmp","初始化"); |
| | | if (systemTTS != null) { |
| | | systemTTS.init(); |
| | | } |
| | |
| | | private long addTime; |
| | | private String avatar=""; |
| | | public String faceImgUrl=""; |
| | | public String wechatPic=""; |
| | | private String nickname; |
| | | private String brand; |
| | | private String licensePlate; |
| | |
| | | fun setDateSite(list:MutableList<Tip>):MutableList<SiteBean>{ |
| | | var siteList = mutableListOf<SiteBean>() |
| | | for (poiItem in list){ |
| | | var bean = SiteBean() |
| | | bean.lat = poiItem.point.latitude |
| | | bean.lng = poiItem.point.longitude |
| | | bean.site = poiItem.name |
| | | bean.siteDetail = poiItem.address |
| | | siteList.add(bean) |
| | | if (poiItem.point!=null){ |
| | | var bean = SiteBean() |
| | | bean.lat = poiItem.point.latitude |
| | | bean.lng = poiItem.point.longitude |
| | | bean.site = poiItem.name |
| | | bean.siteDetail = poiItem.address |
| | | siteList.add(bean) |
| | | } |
| | | |
| | | } |
| | | return siteList |
| | | } |
| | |
| | | it.itemView.tv_start_address.text = item!!.startAddress |
| | | it.itemView.tv_end_address.text = item!!.endAddress |
| | | it.itemView.iv_phone.visibility = if (item.orderState in 6..10) View.GONE else View.VISIBLE |
| | | it.itemView.tv_passenger_phone.visibility = if (item.orderState in 6..10) View.GONE else View.VISIBLE |
| | | it.itemView.tv_passenger_phone.text = item.phone |
| | | it.itemView.iv_phone.clickDelay { |
| | | callPhone(context, item.phone) |
| | | } |
| | |
| | | ll_pay_result.gone() |
| | | tv_show_pay_over.gone() |
| | | iv_phone.gone() |
| | | tv_passenger_phone.gone() |
| | | } |
| | | |
| | | override fun initView() { |
| | |
| | | ll_order_cancel.visible() |
| | | setTitleText("已取消") |
| | | iv_phone.gone() |
| | | tv_passenger_phone.gone() |
| | | tv_cancel_to.text = it.data.cancelUser |
| | | tv_cancel_money.text = doubleOne(it.data.cancelPayMoney) + "元" |
| | | tv_cancel_result.text = it.data.cancelReason |
| | |
| | | import android.os.CountDownTimer |
| | | import android.os.Handler |
| | | import android.os.Looper |
| | | import android.util.Log |
| | | import android.view.Gravity |
| | | import android.view.View |
| | | import cn.sinata.xldutils.utils.* |
| | | import com.amap.api.location.AMapLocationListener |
| | | import com.amap.api.maps.AMap |
| | | import com.amap.api.maps.AMapUtils |
| | | import com.amap.api.maps.model.LatLng |
| | | import com.amap.api.maps.model.Marker |
| | | import com.amap.api.maps.model.Polyline |
| | |
| | | import io.reactivex.android.schedulers.AndroidSchedulers |
| | | import io.reactivex.disposables.Disposable |
| | | import io.reactivex.schedulers.Schedulers |
| | | import kotlinx.android.synthetic.main.activity_change_one.* |
| | | import kotlinx.android.synthetic.main.activity_select_start_point.* |
| | | import kotlinx.android.synthetic.main.activity_trip.* |
| | | import kotlinx.android.synthetic.main.activity_trip.map_view |
| | |
| | | |
| | | |
| | | class TripActivity : MyBaseActivity() { |
| | | |
| | | /*** |
| | | * // 流程操作状态(3=开始出发预约点,4=到达预约点,5=开始服务,6=服务结束) |
| | | * 页面一共4个marker 1:预约地点 2:起点 3终点 4:司机点 |
| | |
| | | var markerLine: Polyline? = null |
| | | lateinit var aMap: AMap |
| | | lateinit var orderBean: OrderBean |
| | | |
| | | var autoExitNavi = false //是否自动退出过,只自动退出一次即可 |
| | | |
| | | private val rxPermissions by lazy { |
| | | RxPermissions(this) |
| | |
| | | changeCarFive(false) |
| | | } |
| | | } |
| | | if (it.data.orderState == 3){ |
| | | val calculateLineDistance = AMapUtils.calculateLineDistance( |
| | | carMarker!!.position, |
| | | LatLng(it.data.startLat, it.data.startLon) |
| | | ) |
| | | if (calculateLineDistance<80&&!autoExitNavi){ |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.EXIT_NAVI)) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | private fun changeCarThree(isMove: Boolean) { |
| | | if (makeMarker != null && carMarker != null) { |
| | | AMapKit.initRouteLine( |
| | | this, |
| | | makeMarker!!.position, |
| | | carMarker!!.position, |
| | | object : (MutableList<LatLng>, Float, Long) -> Unit { |
| | | override fun invoke(p1: MutableList<LatLng>, p2: Float, p3: Long) { |
| | | var view = creatCarView("距预约点" + AMapKit.getTance(p2)) |
| | | carMarker!!.setIcon(getIcon(view)) |
| | | addline(p1) |
| | | if (isMove) |
| | | moveCamera(aMap, makeMarker!!.position, carMarker!!.position) |
| | | } |
| | | }) |
| | | val calculateLineDistance = AMapUtils.calculateLineDistance(makeMarker!!.position, carMarker!!.position) |
| | | Log.e("mmp","两点直线距离:${calculateLineDistance}m") |
| | | if (calculateLineDistance>100) //大于100米才规划路径 |
| | | AMapKit.initRouteLine( |
| | | this, |
| | | makeMarker!!.position, |
| | | carMarker!!.position, |
| | | object : (MutableList<LatLng>, Float, Long) -> Unit { |
| | | override fun invoke(p1: MutableList<LatLng>, p2: Float, p3: Long) { |
| | | var view = creatCarView("距预约点" + AMapKit.getTance(p2)) |
| | | carMarker!!.setIcon(getIcon(view)) |
| | | addline(p1) |
| | | if (isMove) |
| | | moveCamera(aMap, makeMarker!!.position, carMarker!!.position) |
| | | } |
| | | }) |
| | | else{ |
| | | var view = creatCarView("距预约点" + AMapKit.getTance(calculateLineDistance)) |
| | | carMarker!!.setIcon(getIcon(view)) |
| | | if (isMove) |
| | | moveCamera(aMap, makeMarker!!.position, carMarker!!.position) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | private fun showUi(orderBean: OrderBean?) { |
| | | orderBean?.let { |
| | | tv_name.text = orderBean.data.nickName |
| | | tv_passenger_phone.text = orderBean.data.phone |
| | | tv_car_num.text = it.data.historyNum.toString() + "次乘车" |
| | | tv_time.text = it.data.travelTime_ |
| | | tv_start_address.text = it.data.startAddress |
| | |
| | | carMarker?.isVisible = true |
| | | changeCarFive(true) |
| | | setTitleText("服务中") |
| | | slide_btn.changeButtonText("送达该乘客") |
| | | slide_btn.changeButtonText("乘客已到达") |
| | | if (!MyApplication.isRecording){ |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.START_RECORD)) |
| | | } |
| | |
| | | handler?.removeCallbacksAndMessages(null) |
| | | } |
| | | closeTimeStart() |
| | | map_view.onDestroy() |
| | | } |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | map_view.onPause() |
| | | } |
| | | |
| | | override fun onLowMemory() { |
| | | super.onLowMemory() |
| | | map_view.onLowMemory() |
| | | } |
| | | |
| | | override fun onResume() { |
| | | super.onResume() |
| | | map_view.onResume() |
| | | } |
| | | |
| | | private fun addline(allLine: MutableList<LatLng>) { |
| | | closeLine() |
| | |
| | | } |
| | | |
| | | override fun initView() { |
| | | setTitleText("更换车辆") |
| | | setTitleText("车辆管理") |
| | | rcy_car.layoutManager = LinearLayoutManager(this) |
| | | rcy_car.adapter = adapter |
| | | callcarAll() |
| | |
| | | import cn.sinata.xldutils.utils.clickDelay |
| | | import cn.sinata.xldutils.utils.getContent |
| | | import com.future.driver.R |
| | | import com.future.driver.base.BaseEvent |
| | | import com.future.driver.base.MyApplication |
| | | import com.future.driver.base.MyBaseActivity |
| | | import com.future.driver.netUtls.Api |
| | | import com.future.driver.netUtls.callNet |
| | |
| | | import kotlinx.android.synthetic.main.dialog_change_phone.view.* |
| | | import kotlinx.android.synthetic.main.include_login_code.view.* |
| | | import kotlinx.android.synthetic.main.include_login_phone.view.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | import java.util.concurrent.TimeUnit |
| | |
| | | user.phone = view.et_login_phone.getContent() |
| | | CacheKey.saveUserInfo(user) |
| | | showPhone() |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.FACE_FAILED)) |
| | | dialog.dismiss() |
| | | CacheUtil.get().clear() |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.OUT_APP)) |
| | | startActivity<LoginActivity>() |
| | | } |
| | | } |
| | |
| | | import com.umeng.socialize.media.UMWeb |
| | | import kotlinx.android.synthetic.main.activity_mine.* |
| | | import kotlinx.android.synthetic.main.pop_share.view.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class MineActivity: MyBaseActivity() { |
| | |
| | | CacheKey.putKeyStr("isAgreen", "1") |
| | | NettyClient.getInstance().stopService() |
| | | MyApplication.isLogin = false |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.OUT_APP)) |
| | | startActivity<LoginActivity>() |
| | | }) |
| | | } |
| | |
| | | package com.future.driver.ui.mine |
| | | |
| | | import android.Manifest |
| | | import android.app.Activity |
| | | import android.graphics.Bitmap |
| | | import android.os.Environment |
| | | import android.provider.MediaStore |
| | | import android.util.Log |
| | | import androidx.core.view.drawToBitmap |
| | | import com.future.driver.R |
| | | import com.future.driver.base.MyBaseActivity |
| | | import com.future.driver.netUtls.Api |
| | | import com.future.driver.ui.DialogUtil |
| | | import com.future.driver.utils.Cache.CacheKey |
| | | import com.future.driver.utils.QRCodeUtil |
| | | import com.future.driver.utils.glide.GlideUtil |
| | | import com.scwang.smartrefresh.layout.util.SmartUtil.dp2px |
| | | import com.tbruyelle.rxpermissions2.RxPermissions |
| | | import com.umeng.socialize.ShareAction |
| | | import com.umeng.socialize.ShareContent |
| | | import com.umeng.socialize.UMShareListener |
| | |
| | | |
| | | override fun initView() { |
| | | setTitleText("二维码") |
| | | // tv_Right.text = "分享二维码" |
| | | var bit = QRCodeUtil.createQRCodeBitmap("driverId:"+CacheKey.getUserId(), dp2px(220f), dp2px(220f)) |
| | | iv_qr_code.setImageBitmap(bit) |
| | | GlideUtil.load(this,CacheKey.getUserInfo().wechatPic,iv_qr_code,0) |
| | | } |
| | | |
| | | override fun setOnclick() { |
| | | // tv_Right.setOnClickListener { |
| | | // showShareDialog() |
| | | // } |
| | | |
| | | iv_qr_code.setOnLongClickListener { |
| | | try { |
| | | var bit = QRCodeUtil.createQRCodeBitmap("driverId:"+CacheKey.getUserId(), dp2px(220f), dp2px(220f)) |
| | | val copyPath = |
| | | getExternalFilesDir(Environment.DIRECTORY_DCIM)!!.absolutePath + "/" + System.currentTimeMillis() + ".png" |
| | | val file = File(copyPath) |
| | | if (!file.exists()) { |
| | | file.createNewFile() |
| | | } |
| | | val fors = FileOutputStream(file) |
| | | bit!!.compress(Bitmap.CompressFormat.PNG, 0, fors) |
| | | fors.flush() |
| | | fors.close() |
| | | MediaStore.Images.Media.insertImage(this.contentResolver, file.absolutePath, copyPath, null); |
| | | // val uri: Uri = Uri.fromFile(file) |
| | | // context.sendBroadcast(Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri)) |
| | | toast("保存成功") |
| | | } catch (e: Exception) { |
| | | toast("保存失败") |
| | | RxPermissions(this).request(Manifest.permission.WRITE_EXTERNAL_STORAGE).subscribe { |
| | | if (it) |
| | | try { |
| | | val copyPath = |
| | | getExternalFilesDir(Environment.DIRECTORY_DCIM)!!.absolutePath + "/" + System.currentTimeMillis() + ".png" |
| | | val file = File(copyPath) |
| | | if (!file.exists()) { |
| | | file.createNewFile() |
| | | } |
| | | val fors = FileOutputStream(file) |
| | | iv_qr_code.drawToBitmap()?.compress(Bitmap.CompressFormat.PNG, 0, fors) |
| | | fors.flush() |
| | | fors.close() |
| | | MediaStore.Images.Media.insertImage(this.contentResolver, file.absolutePath, copyPath, null); |
| | | toast("保存成功") |
| | | } catch (e: Exception) { |
| | | toast("保存失败") |
| | | } |
| | | } |
| | | return@setOnLongClickListener false |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | var content = "未来出行为客户提供安全、便捷、优质的个性化商旅出行用车体验,并带领客户探秘当地人文地理、风俗民情、户外运动、商务活动及相关代订业务的综合性服务平台。" |
| | |
| | | return@clickDelay |
| | | } |
| | | if (!PhoneCheckUtil.isCheckPwd(et_login_pwd.getString())){ |
| | | toast("密码必须包含数字,大小写字母,特殊字符") |
| | | toast("密码必须包含数字和英文字母") |
| | | return@clickDelay |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | if (!PhoneCheckUtil.isCheckPwd(et_login_pwd.getString())){ |
| | | toast("密码必须包含数字,大小写字母,特殊字符") |
| | | toast("密码必须包含数字和英文字母") |
| | | currentNum-- |
| | | return |
| | | } |
| | |
| | | return@clickDelay |
| | | } |
| | | if (!PhoneCheckUtil.isCheckPwd(et_login_pwd.getString())){ |
| | | toast("密码必须包含数字,大小写字母,特殊字符") |
| | | toast("密码必须包含数字和英文字母") |
| | | return@clickDelay |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | public static String PW_PATTERN = "^(?![A-Za-z0-9]+$)(?![a-z0-9\\W]+$)(?![A-Za-z\\W]+$)(?![A-Z0-9\\W]+$)[a-zA-Z0-9\\W]{8,}$"; |
| | | public static String PW_PATTERN = "^(?=.*[a-zA-Z])(?=.*\\d)[a-zA-Z\\d]+$"; |
| | | |
| | | public static boolean isCheckPwd(String pwd){ |
| | | if (pwd != null && !pwd.isEmpty()){ |
| | |
| | | paint = Paint() |
| | | paint.isAntiAlias = true |
| | | paint.style = Paint.Style.FILL |
| | | paint.textSize = dip(17).toFloat() |
| | | paint.textSize = dip(22).toFloat() |
| | | paint.color = ContextCompat.getColor(context, R.color.white) |
| | | |
| | | bmp = BitmapFactory.decodeResource(context.resources, R.mipmap.slide) |
| | |
| | | android:layout_toRightOf="@+id/iv_head" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="12sp" /> |
| | | |
| | | |
| | | </RelativeLayout> |
| | | |
| | | <LinearLayout |
| | |
| | | android:background="@drawable/bg_gray_top_mine" |
| | | android:elevation="4dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_order_num" |
| | | android:layout_width="wrap_content" |
| | |
| | | android:textColor="#F07207" |
| | | android:textSize="18sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="接单数" |
| | | android:textColor="#333333" |
| | | android:textSize="12sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_star" |
| | | android:layout_width="wrap_content" |
| | |
| | | android:text="我的评分" |
| | | android:textColor="#333333" |
| | | android:textSize="12sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_money" |
| | | android:layout_width="wrap_content" |
| | |
| | | android:textColor="#F07207" |
| | | android:textSize="18sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="余额" |
| | | android:textColor="#333333" |
| | | android:textSize="12sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | |
| | | android:drawableTop="@mipmap/icon_me_evaluation" |
| | | android:text="我的评价" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | <RelativeLayout |
| | |
| | | android:drawableTop="@mipmap/icon_me_safety" |
| | | android:text="账户安全" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | <RelativeLayout |
| | |
| | | android:drawableTop="@mipmap/icon_me_edit" |
| | | android:text="意见反馈" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | <RelativeLayout |
| | |
| | | android:drawableTop="@mipmap/icon_me_orders" |
| | | android:text="接单设置" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | |
| | | android:drawableTop="@mipmap/icon_me_line" |
| | | android:text="班次管理" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | <RelativeLayout |
| | |
| | | android:drawablePadding="8dp" |
| | | android:gravity="center_vertical" |
| | | android:drawableTop="@mipmap/icon_me_car" |
| | | android:text="更换车辆" |
| | | android:text="车辆管理" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | <RelativeLayout |
| | |
| | | android:drawableTop="@mipmap/icon_me_people" |
| | | android:text="推荐给好友" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | |
| | | android:drawableTop="@mipmap/icon_me_services" |
| | | android:text="联系客服" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | |
| | | android:drawableTop="@mipmap/icon_me_code" |
| | | android:text="二维码" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | |
| | | <!-- android:drawableTop="@mipmap/icon_me_code"--> |
| | | <!-- android:text="二维码"--> |
| | | <!-- android:textColor="@color/textColor66"--> |
| | | <!-- android:textSize="12sp" />--> |
| | | <!-- android:textSize="15sp" />--> |
| | | |
| | | <!-- </RelativeLayout>--> |
| | | <RelativeLayout |
| | |
| | | android:drawableTop="@mipmap/icon_me_set" |
| | | android:text="设置" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" /> |
| | | android:textSize="15sp" /> |
| | | |
| | | </RelativeLayout> |
| | | <RelativeLayout |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_margin="14dp" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_height="40dp"/> |
| | | android:layout_height="60dp"/> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_move" |
| | |
| | | <com.future.driver.utils.view.SlidingButton |
| | | android:id="@+id/slide_btn" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_height="60dp" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_margin="14dp" /> |
| | | |
| | |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/icon_dial"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_passenger_phone" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:alpha="0.6" |
| | | android:layout_centerVertical="true" |
| | | android:layout_marginEnd="5dp" |
| | | android:layout_toStartOf="@id/iv_phone" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | | |
| | |
| | | android:orientation="vertical" |
| | | android:layout_marginBottom="6dp" |
| | | android:background="@color/white" |
| | | android:paddingBottom="6dp" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <RelativeLayout |
| | |
| | | |
| | | </RelativeLayout> |
| | | |
| | | <include layout="@layout/include_line_left_12"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_time" |
| | |
| | | android:layout_marginStart="15dp" |
| | | android:textColor="#ff666666" |
| | | android:drawablePadding="4dp" |
| | | android:layout_marginTop="10dp" |
| | | android:drawableStart="@mipmap/icon_time_gray" |
| | | android:textSize="14sp" |
| | | /> |
| | |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="6dp" |
| | | android:layout_marginTop="8dp" |
| | | android:background="@color/bg_main"/> |
| | | |
| | | </LinearLayout> |
| | |
| | | android:textColor="#ff666666" |
| | | android:textSize="12sp" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_bottom_site" |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_start_address" |
| | | android:layout_width="match_parent" |
| | | android:layout_toStartOf="@+id/iv_phone" |
| | | android:layout_below="@+id/tv_name" |
| | | android:layout_alignLeft="@+id/iv_phone" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignStart="@+id/tv_name" |
| | | android:layout_marginTop="6dp" |
| | | android:drawableStart="@mipmap/icon_starting_point" |
| | | android:drawablePadding="3dp" |
| | | tools:text="柳州市政府" |
| | | android:textColor="#ff27282d" |
| | | android:textSize="12sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_end_address" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:drawableStart="@mipmap/icon_end_point" |
| | | android:drawablePadding="3dp" |
| | | android:layout_toStartOf="@+id/iv_phone" |
| | | android:layout_alignStart="@+id/tv_name" |
| | | android:layout_below="@+id/tv_start_address" |
| | | android:layout_marginTop="6dp" |
| | | android:layout_marginBottom="11dp" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_start_address" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:drawableStart="@mipmap/icon_starting_point" |
| | | android:drawablePadding="3dp" |
| | | tools:text="柳州市政府" |
| | | android:textColor="#ff27282d" |
| | | android:textSize="12sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_end_address" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:drawableStart="@mipmap/icon_end_point" |
| | | android:drawablePadding="3dp" |
| | | tools:text="成都天府广场" |
| | | android:textColor="#ff27282d" |
| | | android:textSize="12sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | |
| | | |
| | | </LinearLayout> |
| | | tools:text="成都天府广场" |
| | | android:textColor="#ff27282d" |
| | | android:textSize="12sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_wait_up" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignBottom="@+id/ll_bottom_site" |
| | | android:layout_alignParentEnd="true" |
| | | android:drawablePadding="2dp" |
| | | android:layout_marginEnd="12dp" |
| | | android:layout_below="@id/tv_passenger_phone" |
| | | android:text="待上车" |
| | | android:layout_marginTop="5dp" |
| | | android:layout_marginBottom="10dp" |
| | | android:drawableTop="@mipmap/icon_top" |
| | | android:textColor="@color/red_price" |
| | | android:textSize="12sp" |
| | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_phone" |
| | | android:layout_toStartOf="@+id/tv_wait_up" |
| | | android:layout_marginEnd="10dp" |
| | | android:layout_alignBottom="@+id/ll_bottom_site" |
| | | android:layout_width="22dp" |
| | | android:layout_height="22dp" |
| | | android:layout_marginEnd="8dp" |
| | | android:layout_alignParentEnd="true" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:padding="8dp" |
| | | android:src="@mipmap/icon_dial" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_passenger_phone" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:alpha="0.6" |
| | | tools:text="18555555555" |
| | | android:layout_marginEnd="5dp" |
| | | android:layout_alignParentEnd="true" |
| | | android:textColor="#ff000000" |
| | | android:layout_below="@id/iv_phone" |
| | | android:textSize="12sp" /> |
| | | |
| | | </RelativeLayout> |
| | | |