mirror of
https://github.com/ZCShou/GoGoGo.git
synced 2026-06-05 21:00:50 +08:00
清理
This commit is contained in:
parent
3646b2afc4
commit
3decd9dbcf
@ -251,8 +251,6 @@ public class MainActivity extends BaseActivity
|
||||
startActivity(intent);
|
||||
} else if (id == R.id.main_menu_action_latlng) {
|
||||
showInputLatLngDialog();
|
||||
} else if (id == R.id.action_faq) {
|
||||
showFaqDialog();
|
||||
} else if (id == R.id.main_menu_action_history) {
|
||||
Intent intent = new Intent(MainActivity.this, HistoryActivity.class);
|
||||
startActivity(intent);
|
||||
@ -564,30 +562,6 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
//地图上各按键的监听
|
||||
private void initListenerMapBtn() {
|
||||
RadioGroup mGroupMapTrack = this.findViewById(R.id.RadioGroupMapTrack);
|
||||
mGroupMapTrack.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
if (checkedId == R.id.normalloc) {
|
||||
mBaiduMap.setMyLocationConfiguration(new MyLocationConfiguration(
|
||||
MyLocationConfiguration.LocationMode.NORMAL, true, null));
|
||||
MapStatus.Builder builder1 = new MapStatus.Builder();
|
||||
builder1.overlook(0);
|
||||
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder1.build()));
|
||||
}
|
||||
|
||||
if (checkedId == R.id.trackloc) {
|
||||
mBaiduMap.setMyLocationConfiguration(new MyLocationConfiguration(
|
||||
MyLocationConfiguration.LocationMode.FOLLOWING, true, null));
|
||||
MapStatus.Builder builder = new MapStatus.Builder();
|
||||
builder.overlook(0);
|
||||
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
|
||||
}
|
||||
|
||||
if (checkedId == R.id.compassloc) {
|
||||
mBaiduMap.setMyLocationConfiguration(new MyLocationConfiguration(
|
||||
MyLocationConfiguration.LocationMode.COMPASS, true, null));
|
||||
}
|
||||
});
|
||||
|
||||
RadioGroup mGroupMapType = this.findViewById(R.id.RadioGroupMapType);
|
||||
mGroupMapType.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
if (checkedId == R.id.normal) {
|
||||
@ -1191,38 +1165,6 @@ public class MainActivity extends BaseActivity
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private void showFaqDialog() {
|
||||
final android.app.AlertDialog alertDialog = new android.app.AlertDialog.Builder(this).create();
|
||||
alertDialog.show();
|
||||
// alertDialog.setCancelable(false);
|
||||
Window window = alertDialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setContentView(R.layout.faq);
|
||||
window.setGravity(Gravity.CENTER);
|
||||
window.setWindowAnimations(R.style.DialogAnimFadeInFadeOut);
|
||||
|
||||
TextView tvContent = window.findViewById(R.id.faq_content);
|
||||
String str = "Q:Android 虚拟定位的实现原理是什么?\n"
|
||||
+ "A:具有 ROOT 权限的,一般直接拦截和位置相关的接口更改位置数据。没有 ROOT 权限的,一种是使用 Android 提供的模拟位置 API,一种基于 VirtualApp。\n"
|
||||
+ "\nQ:为何定位总是闪回真实位置?\n"
|
||||
+ "A:这和虚拟定位的实现方式有关系。Android 提供的模拟位置 API 只能模拟 GPS。而安卓的定位数据会同时使用 GPS、网络/WIFI等来实现更精确的定位\n"
|
||||
+ "\nQ:如何防止虚拟定位闪回真实位置?\n"
|
||||
+ "A:对于多数手机,是可以设置定位数据来源的。可以直接关闭从网络/WIFI定位,只允许 GPS 定位;同时关闭 WIFI,仅使用数据流量来上网可有效防止闪回\n"
|
||||
+ "\nQ:为啥在某些软件上没有效果?\n"
|
||||
+ "A:目前仅适用于百度地图和高德地图的SDK定位. 腾讯系列无法使用\n"
|
||||
+ "\nQ:使用位置的 APP 如何检测有没有虚拟定位?\n"
|
||||
+ "A:对于使用 ROOT 权限的虚拟定位,是无法被检测的(但是会检测到 ROOT 权限);使用 Android 提供的模拟位置 API,在 Android 6.0 之后,系统也没有挺检测方式。基于 VirtualApp 的检测方式要多一些。但是通常,如果位置变化较大、较快,APP 会认为定位异常\n";
|
||||
|
||||
SpannableStringBuilder ssb = new SpannableStringBuilder();
|
||||
ssb.append(str);
|
||||
|
||||
tvContent.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
tvContent.setText(ssb, TextView.BufferType.SPANNABLE);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initStoreHistory() {
|
||||
try {
|
||||
//定位历史
|
||||
|
||||
@ -20,39 +20,6 @@
|
||||
android:focusable="true" >
|
||||
</com.baidu.mapapi.map.MapView>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/RadioGroupMapTrack"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginTop="4dip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/normalloc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:checked="true"
|
||||
android:text="@string/map_normal" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/trackloc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/map_track" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/compassloc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/map_compass" />
|
||||
</RadioGroup>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/RadioGroupMapType"
|
||||
android:layout_width="90dp"
|
||||
@ -60,7 +27,7 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginTop="100dip"
|
||||
android:layout_marginTop="4dip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RadioButton
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
<?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:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/faq_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="10dp"
|
||||
android:text="@string/label_faq"
|
||||
android:textColor="#282828"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/faq_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textColor="#282828"
|
||||
android:textSize="15sp" />
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@ -9,12 +9,6 @@
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
app:showAsAction="always|collapseActionView" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_faq"
|
||||
android:icon="@drawable/ic_faq"
|
||||
android:title=""
|
||||
app:showAsAction="always" />
|
||||
|
||||
<item
|
||||
android:id="@+id/main_menu_action_latlng"
|
||||
android:orderInCategory="100"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user