From 8e2bd486a670a529eb6ef08df35e27a71747afca Mon Sep 17 00:00:00 2001
From: endian11 <Dana_Lee1016@126.com>
Date: 星期四, 10 九月 2020 18:56:39 +0800
Subject: [PATCH] 分支 初次提交
---
app/src/main/res/drawable/allview_pull_icon_big.png | 0
app/src/main/res/layout/item_wifi_list_auto.xml | 22 +
app/src/main/java/safeluck/drive/evaluation/bean/AYBluetoothDevice.java | 15
app/src/main/java/safeluck/drive/evaluation/fragment/BleScanFragment.java | 158 ++++++++
app/src/main/res/layout/activity_auto_ble_list.xml | 57 +++
app/src/main/res/drawable/allview_pullup_icon_big.png | 0
app/src/main/res/drawable/shape_auto_wifi_text.xml | 15
lib/src/main/cpp/rtk_module/rtk.cpp | 2
app/src/main/java/safeluck/drive/evaluation/customview/PullInterface.java | 18
app/src/main/res/drawable/allview_refresh_failed.png | 0
app/src/main/res/anim/reverse_anim.xml | 11
app/src/main/java/safeluck/drive/evaluation/customview/PullListView.java | 57 +++
app/src/main/res/layout/view_refresh_head.xml | 56 ++
app/src/main/res/drawable/allview_loading.png | 0
lib/src/main/cpp/native-lib.cpp | 2
app/src/main/res/anim/rotating.xml | 11
app/src/main/res/drawable/allview_load_failed.png | 0
app/src/main/res/layout/view_load_more.xml | 56 ++
app/build.gradle | 1
app/src/main/res/drawable/allview_refresh_succeed.png | 0
app/src/main/java/safeluck/drive/evaluation/customview/PullToRefreshLayout.java | 570 ++++++++++++++++++++++++++++++
app/src/main/java/safeluck/drive/evaluation/app.java | 2
app/src/main/res/drawable/allview_load_succeed.png | 0
app/src/main/java/safeluck/drive/evaluation/adapter/AdapterBleList.java | 69 +++
app/src/main/res/drawable/allview_refreshing.png | 0
25 files changed, 1,119 insertions(+), 3 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index dd43306..774d346 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -81,6 +81,7 @@
// *** ADD ***
implementation 'com.esri.arcgisruntime:arcgis-android:100.8.0'
+
}
repositories {
mavenCentral()
diff --git a/app/src/main/java/safeluck/drive/evaluation/adapter/AdapterBleList.java b/app/src/main/java/safeluck/drive/evaluation/adapter/AdapterBleList.java
new file mode 100644
index 0000000..53bc486
--- /dev/null
+++ b/app/src/main/java/safeluck/drive/evaluation/adapter/AdapterBleList.java
@@ -0,0 +1,69 @@
+package safeluck.drive.evaluation.adapter;
+
+import android.net.wifi.ScanResult;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+
+
+import java.util.List;
+import java.util.zip.Inflater;
+
+import safeluck.drive.evaluation.R;
+import safeluck.drive.evaluation.app;
+import safeluck.drive.evaluation.bean.AYBluetoothDevice;
+
+/**
+ * Created by hanguojing on 2016/12/25 12:17
+ * 鐢ㄤ簬鏄剧ずwifi鍒楄〃
+ */
+
+public class AdapterBleList extends BaseAdapter {
+ private List<AYBluetoothDevice> mList;
+ public AdapterBleList(List<AYBluetoothDevice> list){
+ mList = list;
+ }
+ public void setList(List<AYBluetoothDevice> list){
+ mList = list;
+ notifyDataSetChanged();
+ }
+ @Override
+ public int getCount() {
+ return mList == null ? 0 : mList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ if(mList != null && mList.size() > position){
+ return mList.get(position);
+ }else{
+ return null;}
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return mList != null && mList.size() > position ? position : 0;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ViewHolder holder = null;
+ if(convertView == null){
+ convertView = LayoutInflater.from(app.getAppContext()).inflate(R.layout.item_wifi_list_auto,parent,false);
+
+ holder = new ViewHolder();
+ holder.mTvShow = (TextView) convertView.findViewById(R.id.tv_auto_wifi);
+ convertView.setTag(holder);
+ }else{
+ holder = (ViewHolder) convertView.getTag();
+ }
+ holder.mTvShow.setText(mList.get(position).SSID);
+ return convertView;
+ }
+ class ViewHolder{
+ public TextView mTvShow;
+ }
+}
diff --git a/app/src/main/java/safeluck/drive/evaluation/app.java b/app/src/main/java/safeluck/drive/evaluation/app.java
index 7e649af..a17b22f 100644
--- a/app/src/main/java/safeluck/drive/evaluation/app.java
+++ b/app/src/main/java/safeluck/drive/evaluation/app.java
@@ -150,7 +150,7 @@
}else{
- MyLog.d(TAG,strConent );
+// MyLog.d(TAG,strConent );
lastStr = strConent;
}
switch (cmd) {
diff --git a/app/src/main/java/safeluck/drive/evaluation/bean/AYBluetoothDevice.java b/app/src/main/java/safeluck/drive/evaluation/bean/AYBluetoothDevice.java
new file mode 100644
index 0000000..75acfa0
--- /dev/null
+++ b/app/src/main/java/safeluck/drive/evaluation/bean/AYBluetoothDevice.java
@@ -0,0 +1,15 @@
+package safeluck.drive.evaluation.bean;
+
+/**
+ * DriveJudge
+ * Created by lzw on 2020/9/1. 13:44:50
+ * 閭锛�632393724@qq.com
+ * All Rights Saved! Chongqing AnYun Tech co. LTD
+ */
+public class AYBluetoothDevice {
+ public String SSID;
+
+ public AYBluetoothDevice(String s) {
+ this.SSID= s;
+ }
+}
diff --git a/app/src/main/java/safeluck/drive/evaluation/customview/PullInterface.java b/app/src/main/java/safeluck/drive/evaluation/customview/PullInterface.java
new file mode 100644
index 0000000..635d8cd
--- /dev/null
+++ b/app/src/main/java/safeluck/drive/evaluation/customview/PullInterface.java
@@ -0,0 +1,18 @@
+package safeluck.drive.evaluation.customview;
+
+public interface PullInterface
+{
+ /**
+ * 鍒ゆ柇鏄惁鍙互涓嬫媺锛屽鏋滀笉闇�瑕佷笅鎷夊姛鑳藉彲浠ョ洿鎺eturn false
+ *
+ * @return true濡傛灉鍙互涓嬫媺鍚﹀垯杩斿洖false
+ */
+ boolean canPullDown();
+
+ /**
+ * 鍒ゆ柇鏄惁鍙互涓婃媺锛屽鏋滀笉闇�瑕佷笂鎷夊姛鑳藉彲浠ョ洿鎺eturn false
+ *
+ * @return true濡傛灉鍙互涓婃媺鍚﹀垯杩斿洖false
+ */
+ boolean canPullUp();
+}
diff --git a/app/src/main/java/safeluck/drive/evaluation/customview/PullListView.java b/app/src/main/java/safeluck/drive/evaluation/customview/PullListView.java
new file mode 100644
index 0000000..8b3a205
--- /dev/null
+++ b/app/src/main/java/safeluck/drive/evaluation/customview/PullListView.java
@@ -0,0 +1,57 @@
+package safeluck.drive.evaluation.customview;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.ListView;
+
+public class PullListView extends ListView implements PullInterface
+{
+
+ public PullListView(Context context)
+ {
+ super(context);
+ }
+
+ public PullListView(Context context, AttributeSet attrs)
+ {
+ super(context, attrs);
+ }
+
+ public PullListView(Context context, AttributeSet attrs, int defStyle)
+ {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ public boolean canPullDown()
+ {
+ if (getCount() == 0)
+ {
+ // 娌℃湁item鐨勬椂鍊欎篃鍙互涓嬫媺鍒锋柊
+ return true;
+ } else if (getFirstVisiblePosition() == 0 && getChildAt(0)!=null && getChildAt(0).getTop() >= 0)
+ {
+ // 婊戝埌ListView鐨勯《閮ㄤ簡
+ return true;
+ } else
+ return false;
+ }
+ @Override
+ public boolean canPullUp()
+ {
+ if (getCount() == 0)
+ {
+ // 娌℃湁item鐨勬椂鍊欎篃鍙互涓婃媺鍔犺浇
+ return true;
+ } else if (getLastVisiblePosition() == (getCount() - 1))
+ {
+ // 婊戝埌搴曢儴浜�
+ if (getChildAt(getLastVisiblePosition() - getFirstVisiblePosition()) != null
+ && getChildAt(
+ getLastVisiblePosition()
+ - getFirstVisiblePosition()).getBottom() <= getMeasuredHeight())
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/app/src/main/java/safeluck/drive/evaluation/customview/PullToRefreshLayout.java b/app/src/main/java/safeluck/drive/evaluation/customview/PullToRefreshLayout.java
new file mode 100644
index 0000000..1a07cd2
--- /dev/null
+++ b/app/src/main/java/safeluck/drive/evaluation/customview/PullToRefreshLayout.java
@@ -0,0 +1,570 @@
+package safeluck.drive.evaluation.customview;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.AnimationUtils;
+import android.view.animation.LinearInterpolator;
+import android.view.animation.RotateAnimation;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import safeluck.drive.evaluation.R;
+
+
+/**
+ * 鑷畾涔夌殑甯冨眬锛岀敤鏉ョ鐞嗕笁涓瓙鎺т欢锛屽叾涓竴涓槸涓嬫媺澶达紝涓�涓槸鍖呭惈鍐呭鐨刾ullableView锛堝彲浠ユ槸瀹炵幇Pullable鎺ュ彛鐨勭殑浠讳綍View锛夛紝
+ * 杩樻湁涓�涓笂鎷夊ご锛屾洿澶氳瑙h鍗氬http://blog.csdn.net/zhongkejingwang/article/details/38868463
+ *
+ * @author 闄堥潠
+ */
+public class PullToRefreshLayout extends RelativeLayout {
+ public static final String TAG = "PullToRefreshLayout";
+ /**
+ * last y
+ */
+ private int mLastMotionY;
+ /**
+ * last x
+ */
+ private int mLastMotionX;
+ // 鍒濆鐘舵��
+ public static final int INIT = 0;
+ // 閲婃斁鍒锋柊
+ public static final int RELEASE_TO_REFRESH = 1;
+ // 姝e湪鍒锋柊
+ public static final int REFRESHING = 2;
+ // 閲婃斁鍔犺浇
+ public static final int RELEASE_TO_LOAD = 3;
+ // 姝e湪鍔犺浇
+ public static final int LOADING = 4;
+ // 鎿嶄綔瀹屾瘯
+ public static final int DONE = 5;
+ // 褰撳墠鐘舵��
+ private int state = INIT;
+ // 鍒锋柊鍥炶皟鎺ュ彛
+ private OnRefreshListener mListener;
+ // 鍒锋柊鎴愬姛
+ public static final int SUCCEED = 0;
+ // 鍒锋柊澶辫触
+ public static final int FAIL = 1;
+ // 鎸変笅Y鍧愭爣锛屼笂涓�涓簨浠剁偣Y鍧愭爣
+ private float downY, lastY;
+
+ // 涓嬫媺鐨勮窛绂汇�傛敞鎰忥細pullDownY鍜宲ullUpY涓嶅彲鑳藉悓鏃朵笉涓�0
+ public float pullDownY = 0;
+ // 涓婃媺鐨勮窛绂�
+ private float pullUpY = 0;
+
+ // 閲婃斁鍒锋柊鐨勮窛绂�
+ private float refreshDist = 200;
+ // 閲婃斁鍔犺浇鐨勮窛绂�
+ private float loadmoreDist = 200;
+
+ private MyTimer timer;
+ // 鍥炴粴閫熷害
+ public float MOVE_SPEED = 8;
+ // 绗竴娆℃墽琛屽竷灞�
+ private boolean isLayout = false;
+ // 鍦ㄥ埛鏂拌繃绋嬩腑婊戝姩鎿嶄綔
+ private boolean isTouch = false;
+ // 鎵嬫寚婊戝姩璺濈涓庝笅鎷夊ご鐨勬粦鍔ㄨ窛绂绘瘮锛屼腑闂翠細闅忔鍒囧嚱鏁板彉鍖�
+ private float radio = 2;
+
+ // 涓嬫媺绠ご鐨勮浆180掳鍔ㄧ敾
+ private RotateAnimation rotateAnimation;
+ // 鍧囧寑鏃嬭浆鍔ㄧ敾
+ private RotateAnimation refreshingAnimation;
+
+ // 涓嬫媺澶�
+ private View refreshView;
+ // 涓嬫媺鐨勭澶�
+ private View pullView;
+ // 姝e湪鍒锋柊鐨勫浘鏍�
+ private View refreshingView;
+ // 鍒锋柊缁撴灉鍥炬爣
+ private View refreshStateImageView;
+ // 鍒锋柊缁撴灉锛氭垚鍔熸垨澶辫触
+ private TextView refreshStateTextView;
+
+ // 涓婃媺澶�
+ private View loadmoreView;
+ // 涓婃媺鐨勭澶�
+ private View pullUpView;
+ // 姝e湪鍔犺浇鐨勫浘鏍�
+ private View loadingView;
+ // 鍔犺浇缁撴灉鍥炬爣
+ private View loadStateImageView;
+ // 鍔犺浇缁撴灉锛氭垚鍔熸垨澶辫触
+ private TextView loadStateTextView;
+
+ // 瀹炵幇浜哖ullable鎺ュ彛鐨刅iew
+ private View pullableView;
+ // 杩囨护澶氱偣瑙︾
+ private int mEvents;
+ // 杩欎袱涓彉閲忕敤鏉ユ帶鍒秔ull鐨勬柟鍚戯紝濡傛灉涓嶅姞鎺у埗锛屽綋鎯呭喌婊¤冻鍙笂鎷夊張鍙笅鎷夋椂娌℃硶涓嬫媺
+ private boolean canPullDown = true;
+ private boolean canPullUp = true;
+
+ /**
+ * 鎵ц鑷姩鍥炴粴鐨刪andler
+ */
+ Handler updateHandler = new Handler() {
+
+ @Override
+ public void handleMessage(Message msg) {
+ // 鍥炲脊閫熷害闅忎笅鎷夎窛绂籱oveDeltaY澧炲ぇ鑰屽澶�
+ MOVE_SPEED = (float) (8 + 5 * Math.tan(Math.PI / 2
+ / getMeasuredHeight() * (pullDownY + Math.abs(pullUpY))));
+ if (!isTouch) {
+ // 姝e湪鍒锋柊锛屼笖娌℃湁寰�涓婃帹鐨勮瘽鍒欐偓鍋滐紝鏄剧ず"姝e湪鍒锋柊..."
+ if (state == REFRESHING && pullDownY <= refreshDist) {
+ pullDownY = refreshDist;
+ timer.cancel();
+ } else if (state == LOADING && -pullUpY <= loadmoreDist) {
+ pullUpY = -loadmoreDist;
+ timer.cancel();
+ }
+
+ }
+ if (pullDownY > 0)
+ pullDownY -= MOVE_SPEED;
+ else if (pullUpY < 0)
+ pullUpY += MOVE_SPEED;
+ if (pullDownY < 0) {
+ // 宸插畬鎴愬洖寮�
+ pullDownY = 0;
+ pullView.clearAnimation();
+ // 闅愯棌涓嬫媺澶存椂鏈夊彲鑳借繕鍦ㄥ埛鏂帮紝鍙湁褰撳墠鐘舵�佷笉鏄鍦ㄥ埛鏂版椂鎵嶆敼鍙樼姸鎬�
+ if (state != REFRESHING && state != LOADING)
+ changeState(INIT);
+ timer.cancel();
+ }
+ if (pullUpY > 0) {
+ // 宸插畬鎴愬洖寮�
+ pullUpY = 0;
+ pullUpView.clearAnimation();
+ // 闅愯棌涓嬫媺澶存椂鏈夊彲鑳借繕鍦ㄥ埛鏂帮紝鍙湁褰撳墠鐘舵�佷笉鏄鍦ㄥ埛鏂版椂鎵嶆敼鍙樼姸鎬�
+ if (state != REFRESHING && state != LOADING)
+ changeState(INIT);
+ timer.cancel();
+ }
+ // 鍒锋柊甯冨眬,浼氳嚜鍔ㄨ皟鐢╫nLayout
+ requestLayout();
+ }
+
+ };
+
+ public void setOnRefreshListener(OnRefreshListener listener) {
+ mListener = listener;
+ }
+
+ public PullToRefreshLayout(Context context) {
+ super(context);
+ initView(context);
+ }
+
+ public PullToRefreshLayout(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ initView(context);
+ }
+
+ public PullToRefreshLayout(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ initView(context);
+ }
+
+ private void initView(Context context) {
+ timer = new MyTimer(updateHandler);
+ rotateAnimation = (RotateAnimation) AnimationUtils.loadAnimation(
+ context, R.anim.reverse_anim);
+ refreshingAnimation = (RotateAnimation) AnimationUtils.loadAnimation(
+ context, R.anim.rotating);
+ // 娣诲姞鍖�閫熻浆鍔ㄥ姩鐢�
+ LinearInterpolator lir = new LinearInterpolator();
+ rotateAnimation.setInterpolator(lir);
+ refreshingAnimation.setInterpolator(lir);
+ }
+
+ private void hide() {
+ timer.schedule(5);
+ }
+
+ /**
+ * 瀹屾垚鍒锋柊鎿嶄綔锛屾樉绀哄埛鏂扮粨鏋溿�傛敞鎰忥細鍒锋柊瀹屾垚鍚庝竴瀹氳璋冪敤杩欎釜鏂规硶
+ */
+ /**
+ * @param refreshResult
+ * PullToRefreshLayout.SUCCEED浠h〃鎴愬姛锛孭ullToRefreshLayout.FAIL浠h〃澶辫触
+ */
+ public void refreshFinish(int refreshResult) {
+ refreshingView.clearAnimation();
+ refreshingView.setVisibility(View.GONE);
+ switch (refreshResult) {
+ case SUCCEED:
+ // 鍒锋柊鎴愬姛
+ SimpleDateFormat format = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+ refreshStateImageView.setVisibility(View.VISIBLE);
+ refreshStateTextView.setText("鍒锋柊鎴愬姛 "+format
+ .format(new Date()));
+ // refreshStateTextView.setText(R.string.refresh_succeed+format
+ // .format(new Date()));
+ refreshStateImageView
+ .setBackgroundResource(R.drawable.allview_refresh_succeed);
+ break;
+ case FAIL:
+ default:
+ // 鍒锋柊澶辫触
+ refreshStateImageView.setVisibility(View.VISIBLE);
+ refreshStateTextView.setText(R.string.refresh_fail);
+ refreshStateImageView
+ .setBackgroundResource(R.drawable.allview_refresh_failed);
+ break;
+ }
+ // 鍒锋柊缁撴灉鍋滅暀1绉�
+ new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ changeState(DONE);
+ hide();
+ }
+ }.sendEmptyMessageDelayed(0, 1000);
+ }
+
+ /**
+ * 鍔犺浇瀹屾瘯锛屾樉绀哄姞杞界粨鏋溿�傛敞鎰忥細鍔犺浇瀹屾垚鍚庝竴瀹氳璋冪敤杩欎釜鏂规硶
+ *
+ * @param refreshResult
+ * PullToRefreshLayout.SUCCEED浠h〃鎴愬姛锛孭ullToRefreshLayout.FAIL浠h〃澶辫触
+ */
+ public void loadmoreFinish(int refreshResult) {
+ loadingView.clearAnimation();
+ loadingView.setVisibility(View.GONE);
+ switch (refreshResult) {
+ case SUCCEED:
+ // 鍔犺浇鎴愬姛
+ loadStateImageView.setVisibility(View.VISIBLE);
+ loadStateTextView.setText(R.string.load_succeed);
+ loadStateImageView
+ .setBackgroundResource(R.drawable.allview_load_succeed);
+ break;
+ case FAIL:
+ default:
+ // 鍔犺浇澶辫触
+ loadStateImageView.setVisibility(View.VISIBLE);
+ loadStateTextView.setText(R.string.load_fail);
+ loadStateImageView
+ .setBackgroundResource(R.drawable.allview_load_failed);
+ break;
+ }
+ // 鍒锋柊缁撴灉鍋滅暀1绉�
+ new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ changeState(DONE);
+ hide();
+ }
+ }.sendEmptyMessageDelayed(0, 1000);
+ }
+
+ private void changeState(int to) {
+ state = to;
+ switch (state) {
+ case INIT:
+ // 涓嬫媺甯冨眬鍒濆鐘舵��
+ refreshStateImageView.setVisibility(View.GONE);
+ refreshStateTextView.setText(R.string.pull_to_refresh);
+ pullView.clearAnimation();
+ pullView.setVisibility(View.VISIBLE);
+ // 涓婃媺甯冨眬鍒濆鐘舵��
+ loadStateImageView.setVisibility(View.GONE);
+ loadStateTextView.setText(R.string.pullup_to_load);
+ pullUpView.clearAnimation();
+ pullUpView.setVisibility(View.VISIBLE);
+ break;
+ case RELEASE_TO_REFRESH:
+ // 閲婃斁鍒锋柊鐘舵��
+ refreshStateTextView.setText(R.string.release_to_refresh);
+ pullView.startAnimation(rotateAnimation);
+ break;
+ case REFRESHING:
+ // 姝e湪鍒锋柊鐘舵��
+ pullView.clearAnimation();
+ refreshingView.setVisibility(View.VISIBLE);
+ pullView.setVisibility(View.INVISIBLE);
+ refreshingView.startAnimation(refreshingAnimation);
+ refreshStateTextView.setText(R.string.refreshing);
+ break;
+ case RELEASE_TO_LOAD:
+ // 閲婃斁鍔犺浇鐘舵��
+ loadStateTextView.setText(R.string.release_to_load);
+ pullUpView.startAnimation(rotateAnimation);
+ break;
+ case LOADING:
+ // 姝e湪鍔犺浇鐘舵��
+ pullUpView.clearAnimation();
+ loadingView.setVisibility(View.VISIBLE);
+ pullUpView.setVisibility(View.INVISIBLE);
+ loadingView.startAnimation(refreshingAnimation);
+ loadStateTextView.setText(R.string.loading);
+ break;
+ case DONE:
+ // 鍒锋柊鎴栧姞杞藉畬姣曪紝鍟ラ兘涓嶅仛
+ break;
+ }
+ }
+
+ /**
+ * 涓嶉檺鍒朵笂鎷夋垨涓嬫媺
+ */
+ private void releasePull() {
+ canPullDown = true;
+ canPullUp = true;
+ }
+
+ @Override
+ public boolean onInterceptTouchEvent(MotionEvent e) {
+ int y = (int) e.getRawY();
+ int x = (int) e.getRawX();
+ switch (e.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ // 棣栧厛鎷︽埅down浜嬩欢,璁板綍y鍧愭爣
+ mLastMotionY = y;
+ mLastMotionX = x;
+ break;
+ case MotionEvent.ACTION_MOVE:
+ // deltaY > 0 鏄悜涓嬭繍鍔�< 0鏄悜涓婅繍鍔�
+ int deltaY = y - mLastMotionY;
+ int deltaX = x - mLastMotionX;
+ if (Math.abs(deltaX * 3) > Math.abs(deltaY)) {
+ return false;
+ }
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_CANCEL:
+ break;
+ }
+ return false;
+ }
+
+ /*
+ * 锛堥潪 Javadoc锛夌敱鐖舵帶浠跺喅瀹氭槸鍚﹀垎鍙戜簨浠讹紝闃叉浜嬩欢鍐茬獊
+ *
+ * @see android.view.ViewGroup#dispatchTouchEvent(android.view.MotionEvent)
+ */
+ @Override
+ public boolean dispatchTouchEvent(MotionEvent ev) {
+ switch (ev.getActionMasked()) {
+ case MotionEvent.ACTION_DOWN:
+ downY = ev.getY();
+ lastY = downY;
+ timer.cancel();
+ mEvents = 0;
+ releasePull();
+ break;
+ case MotionEvent.ACTION_POINTER_DOWN:
+ case MotionEvent.ACTION_POINTER_UP:
+ // 杩囨护澶氱偣瑙︾
+ mEvents = -1;
+ break;
+ case MotionEvent.ACTION_MOVE:
+
+ if (mEvents == 0) {
+ if (((PullInterface) pullableView).canPullDown() && canPullDown
+ && state != LOADING) {
+ // 鍙互涓嬫媺锛屾鍦ㄥ姞杞芥椂涓嶈兘涓嬫媺
+ // 瀵瑰疄闄呮粦鍔ㄨ窛绂诲仛缂╁皬锛岄�犳垚鐢ㄥ姏鎷夌殑鎰熻
+ pullDownY = pullDownY + (ev.getY() - lastY) / radio;
+ if (pullDownY < 0) {
+ pullDownY = 0;
+ canPullDown = false;
+ canPullUp = true;
+ }
+ if (pullDownY > getMeasuredHeight())
+ pullDownY = getMeasuredHeight();
+ if (state == REFRESHING) {
+ // 姝e湪鍒锋柊鐨勬椂鍊欒Е鎽哥Щ鍔�
+ isTouch = true;
+ }
+ } else if (((PullInterface) pullableView).canPullUp() && canPullUp
+ && state != REFRESHING) {
+ // 鍙互涓婃媺锛屾鍦ㄥ埛鏂版椂涓嶈兘涓婃媺
+ pullUpY = pullUpY + (ev.getY() - lastY) / radio;
+ if (pullUpY > 0) {
+ pullUpY = 0;
+ canPullDown = true;
+ canPullUp = false;
+ }
+ if (pullUpY < -getMeasuredHeight())
+ pullUpY = -getMeasuredHeight();
+ if (state == LOADING) {
+ // 姝e湪鍔犺浇鐨勬椂鍊欒Е鎽哥Щ鍔�
+ isTouch = true;
+ }
+ } else
+ releasePull();
+ } else
+ mEvents = 0;
+ lastY = ev.getY();
+ // 鏍规嵁涓嬫媺璺濈鏀瑰彉姣斾緥
+ radio = (float) (2 + 2 * Math.tan(Math.PI / 2 / getMeasuredHeight()
+ * (pullDownY + Math.abs(pullUpY))));
+ requestLayout();
+ if (pullDownY <= refreshDist && state == RELEASE_TO_REFRESH) {
+ // 濡傛灉涓嬫媺璺濈娌¤揪鍒板埛鏂扮殑璺濈涓斿綋鍓嶇姸鎬佹槸閲婃斁鍒锋柊锛屾敼鍙樼姸鎬佷负涓嬫媺鍒锋柊
+ changeState(INIT);
+ }
+ if (pullDownY >= refreshDist && state == INIT) {
+ // 濡傛灉涓嬫媺璺濈杈惧埌鍒锋柊鐨勮窛绂讳笖褰撳墠鐘舵�佹槸鍒濆鐘舵�佸埛鏂帮紝鏀瑰彉鐘舵�佷负閲婃斁鍒锋柊
+ changeState(RELEASE_TO_REFRESH);
+ }
+ // 涓嬮潰鏄垽鏂笂鎷夊姞杞界殑锛屽悓涓婏紝娉ㄦ剰pullUpY鏄礋鍊�
+ if (-pullUpY <= loadmoreDist && state == RELEASE_TO_LOAD) {
+ changeState(INIT);
+ }
+ if (-pullUpY >= loadmoreDist && state == INIT) {
+ changeState(RELEASE_TO_LOAD);
+ }
+ // 鍥犱负鍒锋柊鍜屽姞杞芥搷浣滀笉鑳藉悓鏃惰繘琛岋紝鎵�浠ullDownY鍜宲ullUpY涓嶄細鍚屾椂涓嶄负0锛屽洜姝よ繖閲岀敤(pullDownY +
+ // Math.abs(pullUpY))灏卞彲浠ヤ笉瀵瑰綋鍓嶇姸鎬佷綔鍖哄垎浜�
+ if ((pullDownY + Math.abs(pullUpY)) > 8) {
+ // 闃叉涓嬫媺杩囩▼涓瑙﹀彂闀挎寜浜嬩欢鍜岀偣鍑讳簨浠�
+ ev.setAction(MotionEvent.ACTION_CANCEL);
+ }
+ break;
+ case MotionEvent.ACTION_UP:
+ if (pullDownY > refreshDist || -pullUpY > loadmoreDist)
+ // 姝e湪鍒锋柊鏃跺線涓嬫媺锛堟鍦ㄥ姞杞芥椂寰�涓婃媺锛夛紝閲婃斁鍚庝笅鎷夊ご锛堜笂鎷夊ご锛変笉闅愯棌
+ isTouch = false;
+ if (state == RELEASE_TO_REFRESH) {
+ changeState(REFRESHING);
+ // 鍒锋柊鎿嶄綔
+ if (mListener != null)
+ mListener.onRefresh(this);
+ } else if (state == RELEASE_TO_LOAD) {
+ changeState(LOADING);
+ // 鍔犺浇鎿嶄綔
+ if (mListener != null)
+ mListener.onLoadMore(this);
+ }
+ hide();
+ default:
+ break;
+ }
+ // 浜嬩欢鍒嗗彂浜ょ粰鐖剁被
+ super.dispatchTouchEvent(ev);
+ return true;
+ }
+
+ private void initView() {
+ // 鍒濆鍖栦笅鎷夊竷灞�
+ pullView = refreshView.findViewById(R.id.pull_icon);
+ refreshStateTextView = (TextView) refreshView
+ .findViewById(R.id.state_tv);
+ refreshingView = refreshView.findViewById(R.id.refreshing_icon);
+ refreshStateImageView = refreshView.findViewById(R.id.state_iv);
+ // 鍒濆鍖栦笂鎷夊竷灞�
+ pullUpView = loadmoreView.findViewById(R.id.pullup_icon);
+ loadStateTextView = (TextView) loadmoreView
+ .findViewById(R.id.loadstate_tv);
+ loadingView = loadmoreView.findViewById(R.id.loading_icon);
+ loadStateImageView = loadmoreView.findViewById(R.id.loadstate_iv);
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ if (!isLayout) {
+ // 杩欓噷鏄涓�娆¤繘鏉ョ殑鏃跺�欏仛涓�浜涘垵濮嬪寲
+ refreshView = getChildAt(0);
+ pullableView = getChildAt(1);
+ loadmoreView = getChildAt(2);
+ isLayout = true;
+ initView();
+ refreshDist = ((ViewGroup) refreshView).getChildAt(0)
+ .getMeasuredHeight();
+ loadmoreDist = ((ViewGroup) loadmoreView).getChildAt(0)
+ .getMeasuredHeight();
+ }
+ // 鏀瑰彉瀛愭帶浠剁殑甯冨眬锛岃繖閲岀洿鎺ョ敤(pullDownY + pullUpY)浣滀负鍋忕Щ閲忥紝杩欐牱灏卞彲浠ヤ笉瀵瑰綋鍓嶇姸鎬佷綔鍖哄垎
+ refreshView.layout(0,
+ (int) (pullDownY + pullUpY) - refreshView.getMeasuredHeight(),
+ refreshView.getMeasuredWidth(), (int) (pullDownY + pullUpY));
+ pullableView.layout(0, (int) (pullDownY + pullUpY),
+ pullableView.getMeasuredWidth(), (int) (pullDownY + pullUpY)
+ + pullableView.getMeasuredHeight());
+ loadmoreView.layout(0,
+ (int) (pullDownY + pullUpY) + pullableView.getMeasuredHeight(),
+ loadmoreView.getMeasuredWidth(),
+ (int) (pullDownY + pullUpY) + pullableView.getMeasuredHeight()
+ + loadmoreView.getMeasuredHeight());
+ }
+
+ class MyTimer {
+ private Handler handler;
+ private Timer timer;
+ private MyTask mTask;
+
+ public MyTimer(Handler handler) {
+ this.handler = handler;
+ timer = new Timer();
+ }
+
+ public void schedule(long period) {
+ if (mTask != null) {
+ mTask.cancel();
+ mTask = null;
+ }
+ mTask = new MyTask(handler);
+ timer.schedule(mTask, 0, period);
+ }
+
+ public void cancel() {
+ if (mTask != null) {
+ mTask.cancel();
+ mTask = null;
+ }
+ }
+
+ class MyTask extends TimerTask {
+ private Handler handler;
+
+ public MyTask(Handler handler) {
+ this.handler = handler;
+ }
+
+ @Override
+ public void run() {
+ handler.obtainMessage().sendToTarget();
+ }
+
+ }
+ }
+
+ /**
+ * 鍒锋柊鍔犺浇鍥炶皟鎺ュ彛
+ *
+ * @author chenjing
+ *
+ */
+ public interface OnRefreshListener {
+ /**
+ * 鍒锋柊鎿嶄綔
+ */
+ void onRefresh(PullToRefreshLayout pullToRefreshLayout);
+
+ /**
+ * 鍔犺浇鎿嶄綔
+ */
+ void onLoadMore(PullToRefreshLayout pullToRefreshLayout);
+ }
+
+}
diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/BleScanFragment.java b/app/src/main/java/safeluck/drive/evaluation/fragment/BleScanFragment.java
new file mode 100644
index 0000000..223fc8b
--- /dev/null
+++ b/app/src/main/java/safeluck/drive/evaluation/fragment/BleScanFragment.java
@@ -0,0 +1,158 @@
+package safeluck.drive.evaluation.fragment;
+
+import android.bluetooth.BluetoothDevice;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.Html;
+import android.text.Spanned;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import me.yokeyword.fragmentation.SupportFragment;
+import safeluck.drive.evaluation.R;
+import safeluck.drive.evaluation.adapter.AdapterBleList;
+import safeluck.drive.evaluation.bean.AYBluetoothDevice;
+import safeluck.drive.evaluation.customview.PullListView;
+import safeluck.drive.evaluation.customview.PullToRefreshLayout;
+
+/**
+ * DriveJudge
+ * Created by lzw on 2020/9/1. 11:40:50
+ * 閭锛�632393724@qq.com
+ * All Rights Saved! Chongqing AnYun Tech co. LTD
+ */
+public class BleScanFragment extends SupportFragment implements AdapterView.OnItemClickListener, PullToRefreshLayout.OnRefreshListener, View.OnClickListener {
+
+ public static int UPGRADE_17_FRONT = 1;
+ public static int UPGRADE_17_AFTER = 0;
+
+
+ private List<AYBluetoothDevice> mWifiList = new ArrayList<>();
+ private PullListView mLvWifiList;
+ private TextView mTvNoPro;
+ private final static String TAG = BleScanFragment.class.getSimpleName();
+
+ private PullToRefreshLayout mPullRefreshLayout;
+ private String mSelectSsid;
+ private TextView mTvNotify;
+ private AdapterBleList mAdapterWifiList;
+ public static BleScanFragment newInstantce(){
+ return new BleScanFragment();
+ }
+
+ private void initListView() {
+ // listView 鏄剧ず
+ if (mWifiList != null) {
+ if (mAdapterWifiList == null) {
+ mAdapterWifiList = new AdapterBleList(mWifiList);
+ mLvWifiList.setAdapter(mAdapterWifiList);
+ } else {
+ mAdapterWifiList.setList(mWifiList);
+ }
+
+ if (mWifiList.isEmpty()) {
+ mTvNotify.setClickable(true);
+ Spanned spanned = Html.fromHtml(getString(R.string.auto_act_to_refresh) + "<font color=\'#00ADEF\'>浣跨敤甯姪</font>");
+ mTvNotify.setText(spanned);
+ mTvNoPro.setVisibility(View.VISIBLE);
+
+ } else {
+ mTvNotify.setClickable(false);
+ mTvNoPro.setVisibility(View.GONE);
+ mTvNotify.setText(getString(R.string.auto_act_to_select));
+ }
+ }
+ }
+ /**
+ * 鍒濆鍖栧垪琛�
+ */
+ private void initView(View view) {
+ mLvWifiList = (PullListView) view.findViewById(R.id.lv_wifi_list);
+ mTvNotify = (TextView) view.findViewById(R.id.tv_notify);
+ mTvNoPro = (TextView)view. findViewById(R.id.tv_no_pro);
+
+ mPullRefreshLayout = (PullToRefreshLayout) view.findViewById(R.id.pr_refresh);
+ mLvWifiList.setOnItemClickListener(this);
+ mPullRefreshLayout.setOnRefreshListener(this);
+ mTvNotify.setOnClickListener(this);
+
+
+
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.activity_auto_ble_list,container,false);
+ initView(view);
+ return view;
+ }
+
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+
+ }
+
+ @Override
+ public void onRefresh(PullToRefreshLayout pullToRefreshLayout) {
+ if (mAdapterWifiList != null) {
+ if (mWifiList != null) {
+ mWifiList.clear();
+ mAdapterWifiList.setList(mWifiList);
+ }
+ } else {
+ Log.d(TAG, "mAdapterWifilist == null");
+ }
+ if (mTvNoPro.getVisibility() != View.GONE) {
+ mTvNoPro.setVisibility(View.GONE);
+ }
+ new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ // 鍗冧竾鍒繕浜嗗憡璇夋帶浠跺埛鏂板畬姣曚簡鍝︼紒
+ mPullRefreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED);
+
+ addDatas();
+ if (mWifiList != null) {
+ initListView();
+ } else {
+
+ }
+ Log.e(TAG, "onResume");
+ }
+ }.sendEmptyMessageDelayed(0, 1000);
+ }
+
+ private void addDatas() {
+ for (int i = 0; i < 5; i++) {
+ mWifiList.add(new AYBluetoothDevice("123"+i));
+ }
+
+ }
+
+ @Override
+ public void onLoadMore(PullToRefreshLayout pullToRefreshLayout) {
+ new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ mPullRefreshLayout.loadmoreFinish(PullToRefreshLayout.SUCCEED);
+ }
+ }.sendEmptyMessageDelayed(0, 1000);
+ }
+
+ @Override
+ public void onClick(View v) {
+
+ }
+}
diff --git a/app/src/main/res/anim/reverse_anim.xml b/app/src/main/res/anim/reverse_anim.xml
new file mode 100644
index 0000000..1920915
--- /dev/null
+++ b/app/src/main/res/anim/reverse_anim.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rotate xmlns:android="http://schemas.android.com/apk/res/android"
+ android:duration="100"
+ android:fillAfter="true"
+ android:fromDegrees="0"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:repeatCount="0"
+ android:toDegrees="180" >
+
+</rotate>
\ No newline at end of file
diff --git a/app/src/main/res/anim/rotating.xml b/app/src/main/res/anim/rotating.xml
new file mode 100644
index 0000000..8fffa49
--- /dev/null
+++ b/app/src/main/res/anim/rotating.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rotate xmlns:android="http://schemas.android.com/apk/res/android"
+ android:duration="1500"
+ android:fillAfter="true"
+ android:fromDegrees="0"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:repeatCount="-1"
+ android:toDegrees="360" >
+
+</rotate>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/allview_load_failed.png b/app/src/main/res/drawable/allview_load_failed.png
new file mode 100644
index 0000000..23ba502
--- /dev/null
+++ b/app/src/main/res/drawable/allview_load_failed.png
Binary files differ
diff --git a/app/src/main/res/drawable/allview_load_succeed.png b/app/src/main/res/drawable/allview_load_succeed.png
new file mode 100644
index 0000000..0584ace
--- /dev/null
+++ b/app/src/main/res/drawable/allview_load_succeed.png
Binary files differ
diff --git a/app/src/main/res/drawable/allview_loading.png b/app/src/main/res/drawable/allview_loading.png
new file mode 100644
index 0000000..25fb10e
--- /dev/null
+++ b/app/src/main/res/drawable/allview_loading.png
Binary files differ
diff --git a/app/src/main/res/drawable/allview_pull_icon_big.png b/app/src/main/res/drawable/allview_pull_icon_big.png
new file mode 100644
index 0000000..4d9385e
--- /dev/null
+++ b/app/src/main/res/drawable/allview_pull_icon_big.png
Binary files differ
diff --git a/app/src/main/res/drawable/allview_pullup_icon_big.png b/app/src/main/res/drawable/allview_pullup_icon_big.png
new file mode 100644
index 0000000..eb8fbaf
--- /dev/null
+++ b/app/src/main/res/drawable/allview_pullup_icon_big.png
Binary files differ
diff --git a/app/src/main/res/drawable/allview_refresh_failed.png b/app/src/main/res/drawable/allview_refresh_failed.png
new file mode 100644
index 0000000..23ba502
--- /dev/null
+++ b/app/src/main/res/drawable/allview_refresh_failed.png
Binary files differ
diff --git a/app/src/main/res/drawable/allview_refresh_succeed.png b/app/src/main/res/drawable/allview_refresh_succeed.png
new file mode 100644
index 0000000..0584ace
--- /dev/null
+++ b/app/src/main/res/drawable/allview_refresh_succeed.png
Binary files differ
diff --git a/app/src/main/res/drawable/allview_refreshing.png b/app/src/main/res/drawable/allview_refreshing.png
new file mode 100644
index 0000000..25fb10e
--- /dev/null
+++ b/app/src/main/res/drawable/allview_refreshing.png
Binary files differ
diff --git a/app/src/main/res/drawable/shape_auto_wifi_text.xml b/app/src/main/res/drawable/shape_auto_wifi_text.xml
new file mode 100644
index 0000000..dd9c02c
--- /dev/null
+++ b/app/src/main/res/drawable/shape_auto_wifi_text.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="rectangle">
+ <solid android:color="@color/color_e5e5e5" />
+ </shape>
+ </item>
+ <item
+ android:bottom="1dp"
+ android:top="1dp">
+ <shape android:shape="rectangle">
+ <solid android:color="@color/color_ffffff" />
+ </shape>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_auto_ble_list.xml b/app/src/main/res/layout/activity_auto_ble_list.xml
new file mode 100644
index 0000000..a27708c
--- /dev/null
+++ b/app/src/main/res/layout/activity_auto_ble_list.xml
@@ -0,0 +1,57 @@
+<?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="match_parent"
+ android:background="@color/color_f6f8f8"
+ android:orientation="vertical">
+
+
+
+
+
+ <TextView
+ android:id="@+id/tv_notify"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="20dp"
+ android:layout_marginStart="15dp"
+ android:text="@string/auto_act_to_select"
+ android:textColor="@color/color_939393"
+ android:textSize="15sp" />
+
+ <TextView
+ android:id="@+id/tv_no_pro"
+ android:layout_width="match_parent"
+ android:layout_height="44dp"
+ android:background="@drawable/shape_auto_wifi_text"
+ android:gravity="center_vertical"
+ android:paddingEnd="15dp"
+ android:paddingStart="15dp"
+ android:text="鏈娴嬪埌鍙屼韩鍙稰ro璁惧"
+ android:textColor="@color/color_f76260"
+ android:textSize="16sp"
+ android:visibility="gone" />
+
+ <safeluck.drive.evaluation.customview.PullToRefreshLayout
+ android:id="@+id/pr_refresh"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1">
+
+ <include layout="@layout/view_refresh_head" />
+
+ <safeluck.drive.evaluation.customview.PullListView
+ android:id="@+id/lv_wifi_list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentTop="true"
+ android:cacheColorHint="#00000000"
+ android:descendantFocusability="afterDescendants"
+ android:divider="@null"
+ android:listSelector="#00000000" />
+
+ <include layout="@layout/view_load_more" />
+ </safeluck.drive.evaluation.customview.PullToRefreshLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_wifi_list_auto.xml b/app/src/main/res/layout/item_wifi_list_auto.xml
new file mode 100644
index 0000000..9da8cf5
--- /dev/null
+++ b/app/src/main/res/layout/item_wifi_list_auto.xml
@@ -0,0 +1,22 @@
+<?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="match_parent"
+ android:background="@color/color_f6f8f8"
+ android:orientation="vertical">
+ <TextView
+ android:background="@color/color_ffffff"
+ android:layout_width="match_parent"
+ android:layout_height="44dp"
+ android:paddingStart="15dp"
+ android:paddingEnd="15dp"
+ android:text="LIFE-2E78"
+ android:textSize="16sp"
+ android:gravity="center_vertical"
+ android:id="@+id/tv_auto_wifi"
+ android:textColor="@color/color_000000"/>
+ <View
+ android:layout_width="wrap_content"
+ android:background="@color/color_e5e5e5"
+ android:layout_height="0.5dp"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/view_load_more.xml b/app/src/main/res/layout/view_load_more.xml
new file mode 100644
index 0000000..c38aea6
--- /dev/null
+++ b/app/src/main/res/layout/view_load_more.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/color_afafaf" >
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:paddingBottom="20dp"
+ android:paddingTop="20dp" >
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true" >
+
+ <ImageView
+ android:id="@+id/pullup_icon"
+ android:layout_width="13dp"
+ android:layout_height="31dp"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="60dp"
+ android:background="@drawable/allview_pullup_icon_big" />
+
+ <ImageView
+ android:id="@+id/loading_icon"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="60dp"
+ android:background="@drawable/allview_loading"
+ android:visibility="gone" />
+
+ <TextView
+ android:id="@+id/loadstate_tv"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true"
+ android:text="@string/pullup_to_load"
+ android:textColor="@color/color_000000"
+ android:textSize="16sp" />
+
+ <ImageView
+ android:id="@+id/loadstate_iv"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:layout_centerVertical="true"
+ android:layout_marginRight="8dp"
+ android:layout_toLeftOf="@id/loadstate_tv"
+ android:visibility="gone" />
+ </RelativeLayout>
+ </RelativeLayout>
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/view_refresh_head.xml b/app/src/main/res/layout/view_refresh_head.xml
new file mode 100644
index 0000000..d6c0f12
--- /dev/null
+++ b/app/src/main/res/layout/view_refresh_head.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/color_f0eff5" >
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:paddingBottom="20dp"
+ android:paddingTop="20dp" >
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true" >
+
+ <ImageView
+ android:id="@+id/pull_icon"
+ android:layout_width="13dp"
+ android:layout_height="31dp"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="60dp"
+ android:background="@drawable/allview_pull_icon_big" />
+
+ <ImageView
+ android:id="@+id/refreshing_icon"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="60dp"
+ android:background="@drawable/allview_refreshing"
+ android:visibility="gone" />
+
+ <TextView
+ android:id="@+id/state_tv"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true"
+ android:text="@string/pull_to_refresh"
+ android:textColor="@color/color_000000"
+ android:textSize="16sp" />
+
+ <ImageView
+ android:id="@+id/state_iv"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:layout_centerVertical="true"
+ android:layout_marginRight="8dp"
+ android:layout_toLeftOf="@id/state_tv"
+ android:visibility="gone" />
+ </RelativeLayout>
+ </RelativeLayout>
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/lib/src/main/cpp/native-lib.cpp b/lib/src/main/cpp/native-lib.cpp
index 4738ab8..07c4ada 100644
--- a/lib/src/main/cpp/native-lib.cpp
+++ b/lib/src/main/cpp/native-lib.cpp
@@ -27,7 +27,7 @@
const int RTK_PLATFORM_PORT = 12125;
const uint8_t phone[] = {0x20,0x19,0x10,0x15,0x00,0x00,0x00,0x01};
-const char *VIRTUAL_RTK_IP = "192.168.1.7";
+const char *VIRTUAL_RTK_IP = "192.168.16.105";
const int VIRTUAL_RTK_PORT = 9001;
static pthread_mutex_t tts_mutex = PTHREAD_MUTEX_INITIALIZER;
diff --git a/lib/src/main/cpp/rtk_module/rtk.cpp b/lib/src/main/cpp/rtk_module/rtk.cpp
index a5c75d3..b7afde4 100644
--- a/lib/src/main/cpp/rtk_module/rtk.cpp
+++ b/lib/src/main/cpp/rtk_module/rtk.cpp
@@ -214,7 +214,7 @@
}*/
if (RxBufLen > 0) {
-#if 1
+#if 0
const uint8_t *ptr = parseGPS(RxBuf, RxBuf + RxBufLen);
if(ptr != RxBuf) {
memcpy(RxBuf, ptr, RxBufLen - (ptr - RxBuf));
--
Gitblit v1.8.0