fix: 修改拍摄和自动捕捉界面主定位模式切换
This commit is contained in:
parent
8b8866d3fb
commit
bd22ede488
@ -15,6 +15,11 @@ android {
|
||||
versionCode 41
|
||||
versionName "8.230109"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
ndk {
|
||||
// 设置支持的SO库架构(开发者可以根据需要,选择一个或多个平台的so)
|
||||
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
@ -170,4 +175,6 @@ dependencies {
|
||||
// implementation 'com.github.JiongBull:jlog-storage-qiniu:0.1.0'
|
||||
// https://github.com/elvishew/xLog/blob/master/README_ZH.md 日志记录
|
||||
implementation 'com.elvishew:xlog:1.10.1'
|
||||
// // 百度定位
|
||||
// implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.3.7'
|
||||
}
|
@ -100,6 +100,11 @@
|
||||
android:name="design_height_in_dp"
|
||||
android:value="640" />
|
||||
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.baidu.lbsapi.API_KEY"-->
|
||||
<!-- android:value="tqrlve3Njjz0GEu73BhSjxyyzIhTjCQz" >-->
|
||||
<!-- </meta-data>-->
|
||||
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
@ -236,9 +236,11 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
private Polyline currentNaviLine; // 当前界面上正显示的导航路径线,重绘路径时需要清除此前已绘制的路径
|
||||
private boolean startMatchEnableDirection = true; // 是否启用方向匹配起点
|
||||
private Logger logger;
|
||||
private ImageView imgLocationType;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
SharedPreferences sharedPreferences = getSharedPreferences("pic", Context.MODE_PRIVATE);
|
||||
BRIGHTNESS = sharedPreferences.getInt("brightness", 40);
|
||||
FRAMENESS = sharedPreferences.getInt("framness", 30);
|
||||
@ -247,7 +249,8 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
setWindowBrightness(BRIGHTNESS);
|
||||
// 初始化提示音播放器
|
||||
mediaPlayer=MediaPlayer.create(this, R.raw.ding);
|
||||
super.onCreate(savedInstanceState);
|
||||
// 启动GPS定位
|
||||
LocationLifeCycle.getInstance().startGPSLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -288,6 +291,8 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
imgNaviDistance = findViewById(R.id.img_navi_distance);
|
||||
imgRoadDirection = findViewById(R.id.img_road_direction);
|
||||
imgRoadDirection.setSelected(true);
|
||||
imgLocationType = findViewById(R.id.img_location_type);
|
||||
imgLocationType.setOnClickListener(this::onClick);
|
||||
|
||||
//获取地图
|
||||
tencentMap = tvMapView.getMap();
|
||||
@ -1513,6 +1518,14 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
// 设置当前地图的定位显示模式为跟随
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
|
||||
break;
|
||||
case R.id.img_location_type: // 切换定位方式
|
||||
imgLocationType.setSelected(!imgLocationType.isSelected());
|
||||
if (imgLocationType.isSelected()) { // 选中状态,切换为GPS为主定位
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.ORIGIN);
|
||||
} else {
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.TENCENT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1708,6 +1721,9 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
if (mediaPlayer!=null) {
|
||||
mediaPlayer.release();
|
||||
}
|
||||
// 退出后切换主定位模式为腾讯定位
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.TENCENT);
|
||||
LocationLifeCycle.getInstance().stopGPSLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,6 +137,13 @@ public class HomeActivity extends BaseActivity {
|
||||
androidPrinter, // 添加任意多的打印器。如果没有添加任何打印器,会默认使用 AndroidPrinter(Android)/ConsolePrinter(java)
|
||||
consolePrinter,
|
||||
filePrinter);
|
||||
|
||||
// 注册位置更新的lifeCycle
|
||||
getLifecycle().addObserver(LocationLifeCycle.getInstance());
|
||||
// 尝试定位
|
||||
LocationLifeCycle.getInstance().init(getApplicationContext());
|
||||
// 开始获取腾讯定位信息
|
||||
LocationLifeCycle.getInstance().startTencentLocation();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
@ -559,5 +566,6 @@ public class HomeActivity extends BaseActivity {
|
||||
PoiDatabase.destroy();
|
||||
// 清空登录信息
|
||||
Constant.clearLoginInfo();
|
||||
getLifecycle().removeObserver(LocationLifeCycle.getInstance());
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.lifecycle.ProcessLifecycleOwner;
|
||||
|
||||
import com.github.lazylibrary.util.AppUtils;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
@ -31,6 +32,7 @@ import com.lzy.okgo.model.HttpParams;
|
||||
import com.lzy.okgo.model.Progress;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.api.UserApplication;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.navinfo.outdoor.bean.ApkVersionBean;
|
||||
@ -41,6 +43,7 @@ import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.http.UploadCallBack;
|
||||
import com.navinfo.outdoor.util.APKVersionCodeUtils;
|
||||
import com.navinfo.outdoor.util.LocationLifeCycle;
|
||||
import com.navinfo.outdoor.util.ToastUtils;
|
||||
|
||||
|
||||
@ -131,7 +134,7 @@ public class MainActivity extends BaseActivity {
|
||||
HttpInterface.initAppPath(Constant.USHERED);
|
||||
Constant.initRootFolder(Constant.USHERED);
|
||||
HttpInterface.initHttpInter(Constant.USHERED);
|
||||
//
|
||||
// 检查版本
|
||||
initCheckVersion();
|
||||
} else {
|
||||
initTime();
|
||||
|
@ -181,16 +181,18 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
});
|
||||
private boolean booleanExtra;
|
||||
private ImageView imgLocationType; // 切换定位方式
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
SharedPreferences sharedPreferences = getSharedPreferences("pic", Context.MODE_PRIVATE);
|
||||
BRIGHTNESS = sharedPreferences.getInt("brightness", 40);
|
||||
FRAMENESS = sharedPreferences.getInt("framness", 30);
|
||||
|
||||
// 设置当前界面亮度为40%
|
||||
setWindowBrightness(BRIGHTNESS);
|
||||
super.onCreate(savedInstanceState);
|
||||
LocationLifeCycle.getInstance().startGPSLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -465,6 +467,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
|
||||
}
|
||||
});
|
||||
imgLocationType = findViewById(R.id.img_location_type);
|
||||
imgLocationType.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
class Jpg2WebpRunnable implements Runnable {
|
||||
@ -696,6 +700,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
|
||||
break;
|
||||
case R.id.img_location_type: // 切换定位方式
|
||||
imgLocationType.setSelected(!imgLocationType.isSelected());
|
||||
if (imgLocationType.isSelected()) { // 选中状态,切换为GPS为主定位
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.ORIGIN);
|
||||
} else {
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.TENCENT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -901,6 +913,9 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
// 退出后切换主定位模式为腾讯定位
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.TENCENT);
|
||||
LocationLifeCycle.getInstance().stopGPSLocation();
|
||||
}
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
@ -17,14 +17,6 @@ import com.lzy.okgo.cookie.CookieJarImpl;
|
||||
import com.lzy.okgo.cookie.store.DBCookieStore;
|
||||
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
|
||||
import com.lzy.okgo.model.HttpHeaders;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.HomeActivity;
|
||||
import com.navinfo.outdoor.activity.WebActivity;
|
||||
import com.navinfo.outdoor.bean.NotificationBean;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.util.LocationLifeCycle;
|
||||
import com.navinfo.outdoor.util.TalentLocationUtils;
|
||||
import com.tencent.map.navi.TencentNavi;
|
||||
import com.tencent.navi.surport.utils.DeviceUtils;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
@ -67,9 +59,6 @@ public class UserApplication extends Application {
|
||||
// 或者设置开发者自己的的设备号config.setDeviceId(xxxxxxxx);
|
||||
TencentNavi.init(this, config);
|
||||
|
||||
LocationLifeCycle.getInstance().init(UserApplication.this);
|
||||
// 注册位置更新的lifeCycle
|
||||
ProcessLifecycleOwner.get().getLifecycle().addObserver(LocationLifeCycle.getInstance());
|
||||
}
|
||||
|
||||
public static UserApplication getUserApplication() {
|
||||
|
@ -430,7 +430,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
Spinner spnBaseLocation = findViewById(R.id.spn_main_location);
|
||||
Spinner spnRefrenceLocation = findViewById(R.id.spn_reference_location);
|
||||
ArrayAdapter arrayAdapter = new ArrayAdapter(getActivity(), android.R.layout.simple_spinner_dropdown_item, android.R.id.text1, new String[]{"GPS", "腾讯"});
|
||||
ArrayAdapter arrayAdapter = new ArrayAdapter(getActivity(), android.R.layout.simple_spinner_dropdown_item, android.R.id.text1, new String[]{"腾讯", "GPS"});
|
||||
spnBaseLocation.setAdapter(arrayAdapter);
|
||||
spnRefrenceLocation.setAdapter(arrayAdapter);
|
||||
spnRefrenceLocation.setSelection(1);
|
||||
@ -438,9 +438,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
if (i == 0) {
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.ORIGIN);
|
||||
} else if (i==1) {
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.TENCENT);
|
||||
} else if (i==1) {
|
||||
LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.ORIGIN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,9 +454,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
if (i == 0) {
|
||||
LocationLifeCycle.getInstance().setReferenceLocationFrom(LocationLifeCycle.LOCATION_FROM.ORIGIN);
|
||||
} else if (i==1) {
|
||||
LocationLifeCycle.getInstance().setReferenceLocationFrom(LocationLifeCycle.LOCATION_FROM.TENCENT);
|
||||
} else if (i==1) {
|
||||
LocationLifeCycle.getInstance().setReferenceLocationFrom(LocationLifeCycle.LOCATION_FROM.ORIGIN);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.navinfo.outdoor.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.os.Message;
|
||||
@ -10,10 +9,7 @@ import androidx.lifecycle.DefaultLifecycleObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.tencent.map.fusionlocation.model.TencentGeoLocation;
|
||||
import com.tencent.map.geolocation.TencentLocation;
|
||||
import com.tencent.map.location.api.GeoLocationObserver;
|
||||
import com.tencent.map.location.core.FusionGeoLocationAdapter;
|
||||
import com.tencent.tencentmap.mapsdk.maps.LocationSource;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@ -25,7 +21,7 @@ import java.util.List;
|
||||
|
||||
public class LocationLifeCycle implements DefaultLifecycleObserver {
|
||||
private Context mContext;
|
||||
private LOCATION_FROM mainLocationFrom = LOCATION_FROM.ORIGIN/*主要位置源*/, referenceLocationFrom = LOCATION_FROM.TENCENT/*参考位置源*/;
|
||||
private LOCATION_FROM mainLocationFrom = LOCATION_FROM.TENCENT/*主要位置源*/, referenceLocationFrom = LOCATION_FROM.ORIGIN/*参考位置源*/;
|
||||
private TencentLocation tencentLocation; // 腾讯定位获取到的最新位置信息
|
||||
private Location gpsLocation; // 原生系统获取到的最新位置
|
||||
private List<LocationSource.OnLocationChangedListener> locationChangedListenerList;
|
||||
@ -45,16 +41,29 @@ public class LocationLifeCycle implements DefaultLifecycleObserver {
|
||||
@Override
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
DefaultLifecycleObserver.super.onCreate(owner);
|
||||
locationChangedListenerList = new ArrayList<>();
|
||||
// 开启腾讯定位
|
||||
TalentLocationUtils.getInstance(mContext).startLocation(mContext);
|
||||
// 开启原生定位
|
||||
GPSUtils.getInstance(mContext).startLocation();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void startTencentLocation() {
|
||||
// 开启腾讯定位
|
||||
TalentLocationUtils.getInstance(mContext).startLocation(mContext);
|
||||
}
|
||||
|
||||
public void stopTencentLocation() {
|
||||
// 停止腾讯定位
|
||||
TalentLocationUtils.getInstance(mContext).stopLocation();
|
||||
}
|
||||
|
||||
public void startGPSLocation() {
|
||||
GPSUtils.getInstance(mContext).startLocation();
|
||||
}
|
||||
|
||||
public void stopGPSLocation() {
|
||||
GPSUtils.getInstance(mContext).startLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||
DefaultLifecycleObserver.super.onDestroy(owner);
|
||||
@ -69,7 +78,6 @@ public class LocationLifeCycle implements DefaultLifecycleObserver {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEventMessageMainThread(Message msg) {
|
||||
Location mapLocation;
|
||||
if (msg.what == Constant.EVENT_WHAT_LOCATION_CHANGE) { // 用户位置更新
|
||||
if (msg.arg1 == LOCATION_FROM.ORIGIN.ordinal()) {
|
||||
gpsLocation = (Location) msg.obj;
|
||||
@ -104,6 +112,9 @@ public class LocationLifeCycle implements DefaultLifecycleObserver {
|
||||
}
|
||||
|
||||
public List<LocationSource.OnLocationChangedListener> getLocationChangedListenerList() {
|
||||
if (locationChangedListenerList == null) {
|
||||
locationChangedListenerList = new ArrayList<>();
|
||||
}
|
||||
return locationChangedListenerList;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
|
||||
import com.elvishew.xlog.XLog;
|
||||
import com.github.lazylibrary.util.ToastUtils;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.tencent.map.fusionlocation.observer.TencentGeoLocationObserver;
|
||||
@ -55,6 +56,7 @@ public class TalentLocationUtils implements TencentLocationListener {
|
||||
}
|
||||
if (!isLocationStart) {
|
||||
int err = locationManager.requestLocationUpdates(locationRequest, this, Looper.myLooper(), 0);
|
||||
XLog.d( "开始腾讯定位");
|
||||
isLocationStart = true;
|
||||
switch (err) {
|
||||
case 1:
|
||||
@ -91,27 +93,27 @@ public class TalentLocationUtils implements TencentLocationListener {
|
||||
currentLocationMsg.what = Constant.EVENT_WHAT_LOCATION_CHANGE;
|
||||
currentLocationMsg.arg1 = LocationLifeCycle.LOCATION_FROM.TENCENT.ordinal(); // 设置定位来源
|
||||
currentLocationMsg.obj = tencentLocation;
|
||||
EventBus.getDefault().post(currentLocationMsg);
|
||||
EventBus.getDefault().postSticky(currentLocationMsg);
|
||||
}else if (i==TencentLocation.ERROR_NETWORK){//网络问题引起的定位失败
|
||||
Message currentLocationMsg = Message.obtain();
|
||||
currentLocationMsg.what = Constant.EVENT_MESSAGE;
|
||||
currentLocationMsg.obj = "网络问题引起的定位失败";
|
||||
EventBus.getDefault().post(currentLocationMsg);
|
||||
EventBus.getDefault().postSticky(currentLocationMsg);
|
||||
}else if (i==TencentLocation.ERROR_BAD_JSON){//GPS, Wi-Fi 或基站错误引起的定位失败: 1、用户的手机确实采集不到定位凭据,比如偏远地区比如地下车库电梯内等; 2、开关跟权限问题,比如用户关闭了位置信息,关闭了Wi-Fi,未授予app定位权限等。
|
||||
Message currentLocationMsg = Message.obtain();
|
||||
currentLocationMsg.what = Constant.EVENT_MESSAGE;
|
||||
currentLocationMsg.obj = "GPS, Wi-Fi 或基站错误引起的定位失败";
|
||||
EventBus.getDefault().post(currentLocationMsg);
|
||||
EventBus.getDefault().postSticky(currentLocationMsg);
|
||||
}else if (i==TencentLocation.ERROR_WGS84){
|
||||
Message currentLocationMsg = Message.obtain();
|
||||
currentLocationMsg.what = Constant.EVENT_MESSAGE;
|
||||
currentLocationMsg.obj ="无法将WGS84坐标转换成GCJ-02坐标时的定位失败";
|
||||
EventBus.getDefault().post(currentLocationMsg);
|
||||
EventBus.getDefault().postSticky(currentLocationMsg);
|
||||
}else if (i==TencentLocation.ERROR_UNKNOWN){
|
||||
Message currentLocationMsg = Message.obtain();
|
||||
currentLocationMsg.what = Constant.EVENT_MESSAGE;
|
||||
currentLocationMsg.obj ="未知原因引起的定位失败";
|
||||
EventBus.getDefault().post(currentLocationMsg);
|
||||
EventBus.getDefault().postSticky(currentLocationMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="32dp" android:tint="#000000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M15.44,0.59l-3.18,3.18c-0.78,0.78 -0.78,2.05 0,2.83l1.24,1.24l-0.71,0.71L11.55,7.3c-0.78,-0.78 -2.05,-0.78 -2.83,0L7.3,8.72c-0.78,0.78 -0.78,2.05 0,2.83l1.24,1.24l-0.71,0.71L6.6,12.25c-0.78,-0.78 -2.05,-0.78 -2.83,0l-3.18,3.18c-0.78,0.78 -0.78,2.05 0,2.83l3.54,3.54c0.78,0.78 2.05,0.78 2.83,0l3.18,-3.18c0.78,-0.78 0.78,-2.05 0,-2.83l-1.24,-1.24l0.71,-0.71l1.24,1.24c0.78,0.78 2.05,0.78 2.83,0l1.41,-1.41c0.78,-0.78 0.78,-2.05 0,-2.83L13.84,9.6l0.71,-0.71l1.24,1.24c0.78,0.78 2.05,0.78 2.83,0l3.18,-3.18c0.78,-0.78 0.78,-2.05 0,-2.83l-3.54,-3.54C17.48,-0.2 16.22,-0.2 15.44,0.59zM6.6,19.32l-1.06,1.06L2,16.85l1.06,-1.06L6.6,19.32zM8.72,17.2l-1.06,1.06l-3.54,-3.54l1.06,-1.06L8.72,17.2zM18.26,7.66L17.2,8.72l-3.54,-3.54l1.06,-1.06L18.26,7.66zM20.38,5.54L19.32,6.6l-3.54,-3.54L16.85,2L20.38,5.54zM14,21l0,2c4.97,0 9,-4.03 9,-9l-2,0C21,17.87 17.87,21 14,21zM14,17l0,2c2.76,0 5,-2.24 5,-5l-2,0C17,15.66 15.66,17 14,17z"/>
|
||||
</vector>
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="32dp" android:tint="#8C8C8C"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M15.44,0.59l-3.18,3.18c-0.78,0.78 -0.78,2.05 0,2.83l1.24,1.24l-0.71,0.71L11.55,7.3c-0.78,-0.78 -2.05,-0.78 -2.83,0L7.3,8.72c-0.78,0.78 -0.78,2.05 0,2.83l1.24,1.24l-0.71,0.71L6.6,12.25c-0.78,-0.78 -2.05,-0.78 -2.83,0l-3.18,3.18c-0.78,0.78 -0.78,2.05 0,2.83l3.54,3.54c0.78,0.78 2.05,0.78 2.83,0l3.18,-3.18c0.78,-0.78 0.78,-2.05 0,-2.83l-1.24,-1.24l0.71,-0.71l1.24,1.24c0.78,0.78 2.05,0.78 2.83,0l1.41,-1.41c0.78,-0.78 0.78,-2.05 0,-2.83L13.84,9.6l0.71,-0.71l1.24,1.24c0.78,0.78 2.05,0.78 2.83,0l3.18,-3.18c0.78,-0.78 0.78,-2.05 0,-2.83l-3.54,-3.54C17.48,-0.2 16.22,-0.2 15.44,0.59zM6.6,19.32l-1.06,1.06L2,16.85l1.06,-1.06L6.6,19.32zM8.72,17.2l-1.06,1.06l-3.54,-3.54l1.06,-1.06L8.72,17.2zM18.26,7.66L17.2,8.72l-3.54,-3.54l1.06,-1.06L18.26,7.66zM20.38,5.54L19.32,6.6l-3.54,-3.54L16.85,2L20.38,5.54zM14,21l0,2c4.97,0 9,-4.03 9,-9l-2,0C21,17.87 17.87,21 14,21zM14,17l0,2c2.76,0 5,-2.24 5,-5l-2,0C17,15.66 15.66,17 14,17z"/>
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_baseline_share_location_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_share_location_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector android:height="32dp" android:tint="#000000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M13.02,19.93v2.02c2.01,-0.2 3.84,-1 5.32,-2.21l-1.42,-1.43C15.81,19.17 14.48,19.75 13.02,19.93z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M4.03,12c0,-4.05 3.03,-7.41 6.95,-7.93V2.05C5.95,2.58 2.03,6.84 2.03,12c0,5.16 3.92,9.42 8.95,9.95v-2.02C7.06,19.41 4.03,16.05 4.03,12z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19.95,11h2.02c-0.2,-2.01 -1,-3.84 -2.21,-5.32l-1.43,1.43C19.19,8.21 19.77,9.54 19.95,11z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18.34,4.26c-1.48,-1.21 -3.32,-2.01 -5.32,-2.21v2.02c1.46,0.18 2.79,0.76 3.9,1.62L18.34,4.26z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18.33,16.9l1.43,1.42c1.21,-1.48 2.01,-3.31 2.21,-5.32h-2.02C19.77,14.46 19.19,15.79 18.33,16.9z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M16,11.1C16,8.61 14.1,7 12,7s-4,1.61 -4,4.1c0,1.66 1.33,3.63 4,5.9C14.67,14.73 16,12.76 16,11.1zM12,12c-0.59,0 -1.07,-0.48 -1.07,-1.07c0,-0.59 0.48,-1.07 1.07,-1.07s1.07,0.48 1.07,1.07C13.07,11.52 12.59,12 12,12z"/>
|
||||
</vector>
|
@ -0,0 +1,10 @@
|
||||
<vector android:height="32dp" android:tint="#8C8C8C"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M13.02,19.93v2.02c2.01,-0.2 3.84,-1 5.32,-2.21l-1.42,-1.43C15.81,19.17 14.48,19.75 13.02,19.93z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M4.03,12c0,-4.05 3.03,-7.41 6.95,-7.93V2.05C5.95,2.58 2.03,6.84 2.03,12c0,5.16 3.92,9.42 8.95,9.95v-2.02C7.06,19.41 4.03,16.05 4.03,12z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19.95,11h2.02c-0.2,-2.01 -1,-3.84 -2.21,-5.32l-1.43,1.43C19.19,8.21 19.77,9.54 19.95,11z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18.34,4.26c-1.48,-1.21 -3.32,-2.01 -5.32,-2.21v2.02c1.46,0.18 2.79,0.76 3.9,1.62L18.34,4.26z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18.33,16.9l1.43,1.42c1.21,-1.48 2.01,-3.31 2.21,-5.32h-2.02C19.77,14.46 19.19,15.79 18.33,16.9z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M16,11.1C16,8.61 14.1,7 12,7s-4,1.61 -4,4.1c0,1.66 1.33,3.63 4,5.9C14.67,14.73 16,12.76 16,11.1zM12,12c-0.59,0 -1.07,-0.48 -1.07,-1.07c0,-0.59 0.48,-1.07 1.07,-1.07s1.07,0.48 1.07,1.07C13.07,11.52 12.59,12 12,12z"/>
|
||||
</vector>
|
14
app/src/main/res/drawable/selector_location_type.xml
Normal file
14
app/src/main/res/drawable/selector_location_type.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/ic_baseline_satellite_alt_24"/> <!-- pressed -->
|
||||
<item android:state_focused="true"
|
||||
android:drawable="@drawable/ic_baseline_satellite_alt_24"/> <!-- focused -->
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@drawable/ic_baseline_satellite_alt_24"/>
|
||||
<item android:state_checked="true"
|
||||
android:drawable="@drawable/ic_baseline_satellite_alt_24"/>
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/ic_baseline_satellite_alt_24"/>
|
||||
<item android:drawable="@drawable/ic_baseline_share_location_24" /> <!-- default -->
|
||||
</selector>
|
@ -5,7 +5,7 @@
|
||||
<item android:state_focused="true"
|
||||
android:drawable="@drawable/round_bg_gray"/> <!-- focused -->
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@drawable/round_bg_gray"/>
|
||||
android:drawable="@drawable/round_bg_white"/>
|
||||
<item android:state_checked="true"
|
||||
android:drawable="@drawable/round_bg_gray"/>
|
||||
<item android:state_enabled="false"
|
||||
|
@ -184,6 +184,18 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/img_navi_distance"></ImageView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_location_type"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="@drawable/selector_round_bg"
|
||||
android:text="定位方式"
|
||||
android:src="@drawable/selector_location_type"
|
||||
android:padding="@dimen/default_widget_padding"
|
||||
android:layout_margin="@dimen/default_widget_padding"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/img_road_direction"></ImageView>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group_picture"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -144,6 +144,18 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_switch"
|
||||
app:layout_constraintRight_toRightOf="parent"></Button>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_location_type"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="@drawable/selector_round_bg"
|
||||
android:text="定位方式"
|
||||
android:src="@drawable/selector_location_type"
|
||||
android:padding="@dimen/default_widget_padding"
|
||||
android:layout_margin="@dimen/default_widget_padding"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_setting"></ImageView>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group_picture"
|
||||
android:layout_width="wrap_content"
|
||||
|
Loading…
x
Reference in New Issue
Block a user