mirror of
https://github.com/ZCShou/GoGoGo.git
synced 2026-06-13 21:00:55 +08:00
准备发布第一版
This commit is contained in:
parent
6e03614150
commit
684e3cc8f0
Binary file not shown.
@ -39,14 +39,6 @@ public class FragmentSettings extends PreferenceFragmentCompat implements OnPref
|
||||
pfAuthor.setSummary(R.string.author);
|
||||
}
|
||||
|
||||
// 设置 ID
|
||||
String sDid;
|
||||
sDid = DeviceIdUtils.getDeviceId(FragmentSettings.this.getContext());
|
||||
Preference pfDid = findPreference("setting_device_id");
|
||||
if (pfDid != null) {
|
||||
pfDid.setSummary(sDid);
|
||||
}
|
||||
|
||||
EditTextPreference pfWalk = findPreference("setting_walk");
|
||||
if (pfWalk != null) {
|
||||
pfWalk.setSummaryProvider(new Preference.SummaryProvider<EditTextPreference>() {// 使用自定义 SummaryProvider
|
||||
|
||||
@ -26,6 +26,7 @@ import android.os.SystemClock;
|
||||
import android.provider.Settings;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@ -117,9 +118,7 @@ import com.zcshou.service.GoGoGoService;
|
||||
import com.zcshou.database.HistoryLocationDataBaseHelper;
|
||||
import com.zcshou.database.HistorySearchDataBaseHelper;
|
||||
import com.zcshou.service.GoSntpClient;
|
||||
import com.zcshou.utils.AESUtils;
|
||||
import com.zcshou.utils.MapUtils;
|
||||
import com.zcshou.utils.RSAUtils;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static com.zcshou.gogogo.R.drawable;
|
||||
@ -709,6 +708,35 @@ 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(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"
|
||||
+ "Q:为何定位总是闪回真实位置?\n"
|
||||
+ "A:这和虚拟定位的实现方式有关系。Android 提供的模拟位置 API 只能模拟 GPS。而安卓的定位数据会同时使用 GPS、网络/WIFI等来实现更精确的定位\n"
|
||||
+ "Q:如何防止虚拟定位闪回真实位置?\n"
|
||||
+ "A:对于多数手机,是可以设置定位数据来源的。可以直接关闭从网络/WIFI定位,只允许 GPS 定位\n"
|
||||
+ "Q:使用位置的 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 openMapLocateLayer() {
|
||||
// 定位初始化
|
||||
@ -1686,16 +1714,17 @@ public class MainActivity extends BaseActivity
|
||||
//找到searchView
|
||||
searchItem = menu.findItem(id.action_search);
|
||||
searchView = (SearchView) searchItem.getActionView();
|
||||
searchView.setIconified(false);// 设置searchView处于展开状态
|
||||
//searchView.setIconified(false);// 设置searchView处于展开状态
|
||||
searchView.onActionViewExpanded();// 当展开无输入内容的时候,没有关闭的图标
|
||||
searchView.setIconifiedByDefault(true);//默认为true在框内,设置false则在框外
|
||||
searchView.setSubmitButtonEnabled(false);//显示提交按钮
|
||||
// searchView.setIconifiedByDefault(true);//默认为true在框内,设置false则在框外
|
||||
//searchView.setSubmitButtonEnabled(false);//显示提交按钮
|
||||
searchItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() {
|
||||
@Override
|
||||
public boolean onMenuItemActionCollapse(MenuItem item) {
|
||||
// Do something when collapsed
|
||||
menu.setGroupVisible(0, true);
|
||||
searchView.setIconified(false);// 设置searchView处于展开状态
|
||||
menu.setGroupVisible(1, true);
|
||||
// searchView.setIconified(false);// 设置searchView处于展开状态
|
||||
// mSearchList.setVisibility(View.GONE);
|
||||
mSearchlinearLayout.setVisibility(View.INVISIBLE);
|
||||
mHistorylinearLayout.setVisibility(View.INVISIBLE);
|
||||
@ -1705,6 +1734,7 @@ public class MainActivity extends BaseActivity
|
||||
public boolean onMenuItemActionExpand(MenuItem item) {
|
||||
// Do something when expanded
|
||||
menu.setGroupVisible(0, false);
|
||||
menu.setGroupVisible(1, false);
|
||||
mSearchlinearLayout.setVisibility(View.INVISIBLE);
|
||||
//展示搜索历史
|
||||
List<Map<String, Object>> data = getSearchHistory();
|
||||
@ -1807,6 +1837,8 @@ 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);
|
||||
|
||||
4
app/src/main/res/drawable/ic_faq.xml
Normal file
4
app/src/main/res/drawable/ic_faq.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024"
|
||||
android:viewportWidth="1024" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFFFF" android:pathData="M510.67,62.82c-247.15,0 -447.52,200.36 -447.52,447.51 0,247.15 200.37,447.51 447.52,447.51 247.15,0 447.51,-200.36 447.51,-447.51C958.18,263.18 757.82,62.82 510.67,62.82zM265.57,520.55 L265.57,295.87c0,-16.95 13.69,-30.63 30.63,-30.63l224.68,0c16.95,0 30.63,13.69 30.63,30.63l0,224.68c0,16.95 -13.69,30.63 -30.63,30.63L296.2,551.18C279.26,551.18 265.57,537.5 265.57,520.55zM755.77,724.79c0,16.96 -13.68,30.64 -30.64,30.64L500.46,755.43c-16.95,0 -30.64,-13.68 -30.64,-30.64L469.82,571.61l71.48,0c16.95,0 30.64,-13.68 30.64,-30.63l0,-71.5 153.18,0c16.96,0 30.64,13.69 30.64,30.64L755.76,724.79zM499.19,482.5c-1.74,-1.64 -5.41,-3.68 -10.83,-6.43 -5.41,-2.56 -10.52,-5.42 -15.01,-8.28 12.76,-15.01 19.29,-35.54 19.29,-61.48 0,-17.06 -3.16,-31.87 -9.59,-44.43 -6.33,-12.66 -15.73,-22.36 -28.19,-29.21 -12.46,-6.95 -27.37,-10.42 -44.53,-10.42 -12.76,0 -24.1,1.94 -34.21,5.72 -10.01,3.88 -18.48,9.29 -25.53,16.34 -6.95,7.15 -12.25,15.73 -15.93,25.84 -3.68,10.21 -5.42,21.24 -5.42,33.29 0,11.95 1.74,22.98 5.42,33.19 3.58,10.21 8.98,18.9 16.13,26.24 7.14,7.25 16.13,13.08 26.65,16.85 10.52,3.98 22.36,5.92 35.74,5.92 16.24,0 30.13,-2.04 41.47,-6.33 5.41,3.77 10.52,7.14 15.32,10.21 4.6,2.66 8.58,4.9 12.16,6.54 3.47,1.43 6.33,2.14 8.88,2.14 2.86,0 5.52,-1.13 7.66,-2.96 2.14,-2.25 3.26,-4.29 3.26,-6.23C501.94,486.17 500.93,484.03 499.19,482.5zM458.34,430.31c-2.35,7.66 -6.02,14.19 -11.13,19.61 -17.57,-12.15 -30.02,-18.17 -37.38,-18.17 -2.55,0 -4.8,0.91 -6.73,2.65 -2.05,1.94 -2.97,4.08 -2.97,6.23 0,2.96 0.92,5.01 3.17,6.43 2.05,1.64 6.03,3.68 11.85,6.33 5.72,2.76 10.51,5.52 14.29,8.17 -6.33,2.55 -12.56,3.68 -18.69,3.68 -14.61,0 -26.96,-5.31 -36.46,-15.93 -9.6,-10.72 -14.39,-26.05 -14.39,-45.86 0,-9.5 1.22,-18.28 3.88,-26.14 2.45,-7.87 6.02,-14.2 10.52,-19.31 4.39,-4.9 9.7,-8.77 15.93,-11.33 6.02,-2.55 12.76,-3.98 20.12,-3.98 10.21,0 19.1,2.35 27.06,7.15 7.87,4.8 13.89,11.65 18.28,20.94 4.08,9.29 6.33,20.22 6.33,32.88C462.02,413.87 460.79,422.65 458.34,430.31zM648.7,574.41c-2.04,-5.1 -3.78,-9.09 -5.11,-12.15 -1.22,-2.96 -2.86,-5.82 -4.8,-8.58 -1.94,-2.55 -4.39,-4.8 -7.46,-6.54 -3.17,-1.63 -7.04,-2.55 -11.64,-2.55 -4.7,0 -8.48,0.92 -11.65,2.55 -3.27,1.74 -5.61,3.99 -7.55,6.75 -1.84,2.65 -3.79,6.02 -5.42,10.21 -1.74,4.08 -3.17,7.65 -4.29,10.51L548.52,677.15c-1.73,4.18 -3.06,7.55 -3.68,9.8 -0.82,2.24 -1.13,4.49 -1.13,6.53 0,3.77 1.64,7.35 4.8,10.21s7.05,4.29 11.13,4.29c5,0 8.47,-1.22 10.72,-4.18 2.24,-2.86 4.8,-8.28 7.96,-16.24l7.87,-20.42 67.1,0 7.86,20.12c0.92,2.55 2.24,5.41 3.88,8.58 1.43,3.17 2.87,5.61 4.09,7.25 1.33,1.53 2.75,2.65 4.6,3.68 1.94,0.92 4.18,1.22 6.95,1.22 4.39,0 8.27,-1.43 11.43,-4.49 3.17,-2.97 4.8,-6.33 4.8,-10.21 0,-3.47 -1.74,-9.09 -5.11,-16.85L648.7,574.41zM594.98,646.71l24.41,-71.48 24.81,71.48L594.98,646.71z"/>
|
||||
</vector>
|
||||
35
app/src/main/res/layout/faq.xml
Normal file
35
app/src/main/res/layout/faq.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?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>
|
||||
@ -2,6 +2,7 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
@ -27,16 +28,36 @@
|
||||
android:drawablePadding="10dip"
|
||||
app:drawableStartCompat="@drawable/ic_user"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextDate"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="date"
|
||||
android:hint="@string/register_limit"
|
||||
android:autofillHints="date"
|
||||
android:drawablePadding="10dip"
|
||||
app:drawableStartCompat="@drawable/ic_date" />
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="2dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_date"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/register_limit" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/darkgray"
|
||||
android:text="@string/register_limit"/>
|
||||
|
||||
<DatePicker
|
||||
android:id="@+id/date_picker"
|
||||
style="@android:style/Widget.DatePicker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reg_request"
|
||||
@ -49,6 +70,7 @@
|
||||
android:drawablePadding="10dip"
|
||||
app:drawableStartCompat="@drawable/ic_pwd"
|
||||
android:background="@drawable/border_gray"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@ -9,6 +9,12 @@
|
||||
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"
|
||||
|
||||
@ -20,6 +20,12 @@
|
||||
<string name="fabtn_stop">停止定位</string>
|
||||
<string name="label_longitude">经度</string>
|
||||
<string name="label_latitude">纬度</string>
|
||||
<string name="label_faq">FAQ</string>
|
||||
<!-- 主菜单 -->
|
||||
<string name="main_menu_action_latlng">经纬度定位</string>
|
||||
<string name="main_menu_action_history">历史记录</string>
|
||||
<string name="main_menu_action_setting">设置</string>
|
||||
|
||||
<!-- 历史记录页面 -->
|
||||
<string name="history_idle">暂无历史记录</string>
|
||||
<!-- 导航页 -->
|
||||
@ -36,10 +42,6 @@
|
||||
<string name="nav_menu_feedback">问题反馈</string>
|
||||
<string name="nav_menu_contact">联系作者</string>
|
||||
|
||||
<!-- 主菜单 -->
|
||||
<string name="main_menu_action_latlng">经纬度定位</string>
|
||||
<string name="main_menu_action_history">历史记录</string>
|
||||
<string name="main_menu_action_setting">设置</string>
|
||||
|
||||
<!-- 设置界面 -->
|
||||
<string name="title_activity_settings">设置</string>
|
||||
@ -55,7 +57,6 @@
|
||||
<string name="setting_group_about">关于</string>
|
||||
<string name="setting_version">版本号</string>
|
||||
<string name="setting_author">开发者</string>
|
||||
<string name="setting_device_id">设备唯一标识</string>
|
||||
<string name="setting_group_sys">系统</string>
|
||||
|
||||
<!-- 百度地图 -->
|
||||
|
||||
@ -55,11 +55,6 @@
|
||||
app:defaultValue="@string/author"
|
||||
app:iconSpaceReserved="false"/>
|
||||
|
||||
<Preference
|
||||
app:key="setting_device_id"
|
||||
app:title="@string/setting_device_id"
|
||||
app:iconSpaceReserved="false"/>
|
||||
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user