Commit f3ffdb284468c7ce24328f04a212455fe9ec76c6

Authored by 杨帅
1 parent 3917558f

1.屏蔽边缘返回手势

moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/CollRunMainFragment.java
@@ -99,4 +99,15 @@ public class CollRunMainFragment extends QMUIFragment<RunMainFragmentView, RunMa @@ -99,4 +99,15 @@ public class CollRunMainFragment extends QMUIFragment<RunMainFragmentView, RunMa
99 } 99 }
100 } 100 }
101 } 101 }
  102 + /**
  103 + * 屏蔽边缘返回
  104 + * 杨帅
  105 + *
  106 + * @return
  107 + */
  108 + @Override
  109 + protected int dragBackEdge() {
  110 + return 0;
  111 +
  112 + }
102 } 113 }
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/CollRunRaceDetailFragment.java
@@ -113,6 +113,17 @@ public class CollRunRaceDetailFragment extends QMUIFragment<CollRunRaceDetailFra @@ -113,6 +113,17 @@ public class CollRunRaceDetailFragment extends QMUIFragment<CollRunRaceDetailFra
113 } 113 }
114 114
115 } 115 }
  116 + /**
  117 + * 屏蔽边缘返回
  118 + * 杨帅
  119 + *
  120 + * @return
  121 + */
  122 + @Override
  123 + protected int dragBackEdge() {
  124 + return 0;
  125 +
  126 + }
116 // private void test() { 127 // private void test() {
117 // BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(getActivity()); 128 // BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(getActivity());
118 // View view = getLayoutInflater().inflate(R.layout.bottom_sheet_dialog_run_race_detail, null); 129 // View view = getLayoutInflater().inflate(R.layout.bottom_sheet_dialog_run_race_detail, null);
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/CollRunningFinishFragment.java
@@ -52,4 +52,15 @@ public class CollRunningFinishFragment extends QMUIFragment<RunningFinishFragmen @@ -52,4 +52,15 @@ public class CollRunningFinishFragment extends QMUIFragment<RunningFinishFragmen
52 } 52 }
53 } 53 }
54 } 54 }
  55 + /**
  56 + * 屏蔽边缘返回
  57 + * 杨帅
  58 + *
  59 + * @return
  60 + */
  61 + @Override
  62 + protected int dragBackEdge() {
  63 + return 0;
  64 +
  65 + }
55 } 66 }
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/CollRunningMapFragment.java
@@ -217,5 +217,15 @@ public class CollRunningMapFragment extends QMUIFragment<RunningMapFragmentView, @@ -217,5 +217,15 @@ public class CollRunningMapFragment extends QMUIFragment<RunningMapFragmentView,
217 } 217 }
218 } 218 }
219 219
  220 + /**
  221 + * 屏蔽边缘返回
  222 + * 杨帅
  223 + *
  224 + * @return
  225 + */
  226 + @Override
  227 + protected int dragBackEdge() {
  228 + return 0;
220 229
  230 + }
221 } 231 }
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/ui/fragment/StartTraceFragment.java
@@ -69,4 +69,16 @@ public class StartTraceFragment extends QMUIFragment<StartTraceFragmentView, Sta @@ -69,4 +69,16 @@ public class StartTraceFragment extends QMUIFragment<StartTraceFragmentView, Sta
69 getMvpView().onDestroy(); 69 getMvpView().onDestroy();
70 } 70 }
71 } 71 }
  72 +
  73 + /**
  74 + * 屏蔽边缘返回
  75 + * 杨帅
  76 + *
  77 + * @return
  78 + */
  79 + @Override
  80 + protected int dragBackEdge() {
  81 + return 0;
  82 +
  83 + }
72 } 84 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunMainFragment.java
@@ -103,4 +103,15 @@ public class RunMainFragment extends QMUIFragment<RunMainFragmentView, RunMainFr @@ -103,4 +103,15 @@ public class RunMainFragment extends QMUIFragment<RunMainFragmentView, RunMainFr
103 } 103 }
104 } 104 }
105 } 105 }
  106 + /**
  107 + * 屏蔽边缘返回
  108 + * 杨帅
  109 + *
  110 + * @return
  111 + */
  112 + @Override
  113 + protected int dragBackEdge() {
  114 + return 0;
  115 +
  116 + }
106 } 117 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunRaceDetailFragment.java
@@ -63,11 +63,12 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie @@ -63,11 +63,12 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie
63 63
64 mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE);//获取传感器管理服务 64 mSensorManager = (SensorManager) getActivity().getSystemService(SENSOR_SERVICE);//获取传感器管理服务
65 if (getMvpView() != null) { 65 if (getMvpView() != null) {
66 - getMvpView().initMap();; 66 + getMvpView().initMap();
  67 + ;
67 } 68 }
68 - if (getPresenter()!=null){ 69 + if (getPresenter() != null) {
69 if (!TextUtils.isEmpty(CommonInfo.getStreetId(getActivity()))) 70 if (!TextUtils.isEmpty(CommonInfo.getStreetId(getActivity())))
70 - getPresenter().getRunRaceDetailInfo(getActivity(),CommonInfo.getStreetId(getActivity()),"10513196","0"); 71 + getPresenter().getRunRaceDetailInfo(getActivity(), CommonInfo.getStreetId(getActivity()), "10513196", "0");
71 } 72 }
72 73
73 } 74 }
@@ -110,6 +111,18 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie @@ -110,6 +111,18 @@ public class RunRaceDetailFragment extends QMUIFragment<RunRaceDetailFragmentVie
110 } 111 }
111 112
112 } 113 }
  114 +
  115 + /**
  116 + * 屏蔽边缘返回
  117 + * 杨帅
  118 + *
  119 + * @return
  120 + */
  121 + @Override
  122 + protected int dragBackEdge() {
  123 + return 0;
  124 +
  125 + }
113 // private void test() { 126 // private void test() {
114 // BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(getActivity()); 127 // BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(getActivity());
115 // View view = getLayoutInflater().inflate(R.layout.bottom_sheet_dialog_run_race_detail, null); 128 // View view = getLayoutInflater().inflate(R.layout.bottom_sheet_dialog_run_race_detail, null);
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningFinishFragment.java
@@ -55,4 +55,15 @@ public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentVie @@ -55,4 +55,15 @@ public class RunningFinishFragment extends QMUIFragment<RunningFinishFragmentVie
55 } 55 }
56 } 56 }
57 } 57 }
  58 + /**
  59 + * 屏蔽边缘返回
  60 + * 杨帅
  61 + *
  62 + * @return
  63 + */
  64 + @Override
  65 + protected int dragBackEdge() {
  66 + return 0;
  67 +
  68 + }
58 } 69 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunningMapFragment.java
@@ -221,6 +221,16 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run @@ -221,6 +221,16 @@ public class RunningMapFragment extends QMUIFragment<RunningMapFragmentView, Run
221 tipDialog.setCanceledOnTouchOutside(false); 221 tipDialog.setCanceledOnTouchOutside(false);
222 } 222 }
223 } 223 }
  224 + /**
  225 + * 屏蔽边缘返回
  226 + * 杨帅
  227 + *
  228 + * @return
  229 + */
  230 + @Override
  231 + protected int dragBackEdge() {
  232 + return 0;
224 233
  234 + }
225 235
226 } 236 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/QMUITipDialogUtil.java
1 package com.cnlive.moudle.pedometer.utils; 1 package com.cnlive.moudle.pedometer.utils;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 -import android.os.Build;  
5 import android.os.Handler; 4 import android.os.Handler;
6 5
7 import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; 6 import com.qmuiteam.qmui.widget.dialog.QMUITipDialog;
@@ -20,26 +19,27 @@ public class QMUITipDialogUtil { @@ -20,26 +19,27 @@ public class QMUITipDialogUtil {
20 19
21 20
22 /** 21 /**
23 - * 初始化  
24 - */  
25 - public static void QMUITipDialogUtil(Context context) {  
26 - QMUITipDialog.Builder builder = new QMUITipDialog.Builder(context);  
27 - }  
28 -  
29 - /**  
30 * Loading 类型提示框 22 * Loading 类型提示框
31 * 23 *
32 * @param context 24 * @param context
33 * @param tipStr 25 * @param tipStr
34 */ 26 */
35 public static void loadingDialog(Context context, String tipStr, boolean isCancel) { 27 public static void loadingDialog(Context context, String tipStr, boolean isCancel) {
  28 + if (context == null) {
  29 + return;
  30 + }
  31 + if (tipDialog!=null&&tipDialog.isShowing()){
  32 + tipDialog.dismiss();
  33 + }
36 tipDialog = new QMUITipDialog.Builder(context) 34 tipDialog = new QMUITipDialog.Builder(context)
37 .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) 35 .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING)
38 .setTipWord(tipStr) 36 .setTipWord(tipStr)
39 .create(); 37 .create();
40 tipDialog.setCanceledOnTouchOutside(isCancel);//屏蔽返回键 38 tipDialog.setCanceledOnTouchOutside(isCancel);//屏蔽返回键
41 tipDialog.setCancelable(isCancel); 39 tipDialog.setCancelable(isCancel);
42 - tipDialog.show(); 40 + if (!tipDialog.isShowing()) {
  41 + tipDialog.show();
  42 + }
43 } 43 }
44 44
45 /** 45 /**
@@ -48,22 +48,34 @@ public class QMUITipDialogUtil { @@ -48,22 +48,34 @@ public class QMUITipDialogUtil {
48 * @param context 48 * @param context
49 */ 49 */
50 public static void successDialog(Context context, String tipStr, int second) { 50 public static void successDialog(Context context, String tipStr, int second) {
  51 + if (context == null) {
  52 + return;
  53 + }
  54 + if (tipDialog!=null&&tipDialog.isShowing()){
  55 + tipDialog.dismiss();
  56 + }
51 tipDialog = new QMUITipDialog.Builder(context) 57 tipDialog = new QMUITipDialog.Builder(context)
52 .setIconType(QMUITipDialog.Builder.ICON_TYPE_SUCCESS) 58 .setIconType(QMUITipDialog.Builder.ICON_TYPE_SUCCESS)
53 .setTipWord(tipStr) 59 .setTipWord(tipStr)
54 .create(); 60 .create();
55 tipDialog.setCanceledOnTouchOutside(false);//屏蔽返回键 61 tipDialog.setCanceledOnTouchOutside(false);//屏蔽返回键
56 - tipDialog.show();  
57 - new Handler().postDelayed(new Runnable() {  
58 - @Override  
59 - public void run() {  
60 -  
61 - /**  
62 - * 延时执行的代码  
63 - */  
64 - tipDialog.dismiss();  
65 - }  
66 - }, second * 1000); // 延时2秒 62 + if (!tipDialog.isShowing()) {
  63 + tipDialog.show();
  64 + new Handler().postDelayed(new Runnable() {
  65 + @Override
  66 + public void run() {
  67 + if (context == null) {
  68 + return;
  69 + }
  70 + /**
  71 + * 延时执行的代码
  72 + */
  73 + if (tipDialog != null && tipDialog.isShowing()) {
  74 + tipDialog.dismiss();
  75 + }
  76 + }
  77 + }, second * 1000); // 延时2秒
  78 + }
67 } 79 }
68 80
69 /** 81 /**
@@ -72,22 +84,34 @@ public class QMUITipDialogUtil { @@ -72,22 +84,34 @@ public class QMUITipDialogUtil {
72 * @param context 84 * @param context
73 */ 85 */
74 public static void failedDialog(Context context, String tipStr, int second) { 86 public static void failedDialog(Context context, String tipStr, int second) {
  87 + if (context == null) {
  88 + return;
  89 + }
  90 + if (tipDialog!=null&&tipDialog.isShowing()){
  91 + tipDialog.dismiss();
  92 + }
75 tipDialog = new QMUITipDialog.Builder(context) 93 tipDialog = new QMUITipDialog.Builder(context)
76 .setIconType(QMUITipDialog.Builder.ICON_TYPE_FAIL) 94 .setIconType(QMUITipDialog.Builder.ICON_TYPE_FAIL)
77 .setTipWord(tipStr) 95 .setTipWord(tipStr)
78 .create(); 96 .create();
79 tipDialog.setCanceledOnTouchOutside(false);//屏蔽返回键 97 tipDialog.setCanceledOnTouchOutside(false);//屏蔽返回键
80 - tipDialog.show();  
81 - new Handler().postDelayed(new Runnable() {  
82 - @Override  
83 - public void run() {  
84 -  
85 - /**  
86 - * 延时执行的代码  
87 - */  
88 - tipDialog.dismiss();  
89 - }  
90 - }, second * 1000); // 延时2秒 98 + if (!tipDialog.isShowing()) {
  99 + tipDialog.show();
  100 + new Handler().postDelayed(new Runnable() {
  101 + @Override
  102 + public void run() {
  103 + if (context == null) {
  104 + return;
  105 + }
  106 + /**
  107 + * 延时执行的代码
  108 + */
  109 + if (tipDialog != null && tipDialog.isShowing()) {
  110 + tipDialog.dismiss();
  111 + }
  112 + }
  113 + }, second * 1000); // 延时2秒
  114 + }
91 115
92 } 116 }
93 117
@@ -97,22 +121,32 @@ public class QMUITipDialogUtil { @@ -97,22 +121,32 @@ public class QMUITipDialogUtil {
97 * @param context 121 * @param context
98 */ 122 */
99 public static void messageDialog(Context context, String tipStr, int second) { 123 public static void messageDialog(Context context, String tipStr, int second) {
  124 + if (context == null) {
  125 + return;
  126 + }
  127 + if (tipDialog!=null&&tipDialog.isShowing()){
  128 + tipDialog.dismiss();
  129 + }
100 tipDialog = new QMUITipDialog.Builder(context) 130 tipDialog = new QMUITipDialog.Builder(context)
101 .setIconType(QMUITipDialog.Builder.ICON_TYPE_INFO) 131 .setIconType(QMUITipDialog.Builder.ICON_TYPE_INFO)
102 .setTipWord(tipStr) 132 .setTipWord(tipStr)
103 .create(); 133 .create();
104 tipDialog.setCanceledOnTouchOutside(false);//屏蔽返回键 134 tipDialog.setCanceledOnTouchOutside(false);//屏蔽返回键
105 - tipDialog.show();  
106 - new Handler().postDelayed(new Runnable() {  
107 - @Override  
108 - public void run() {  
109 -  
110 - /**  
111 - * 延时执行的代码  
112 - */  
113 - tipDialog.dismiss();  
114 - }  
115 - }, second * 1000); // 延时2秒 135 + if (!tipDialog.isShowing()) {
  136 + tipDialog.show();
  137 + new Handler().postDelayed(new Runnable() {
  138 + @Override
  139 + public void run() {
  140 + if (context == null) {
  141 + return;
  142 + }
  143 + /**
  144 + * 延时执行的代码
  145 + */
  146 + tipDialog.dismiss();
  147 + }
  148 + }, second * 1000); // 延时2秒
  149 + }
116 } 150 }
117 151
118 152
@@ -122,28 +156,36 @@ public class QMUITipDialogUtil { @@ -122,28 +156,36 @@ public class QMUITipDialogUtil {
122 * @param context 156 * @param context
123 */ 157 */
124 public static void textDialog(Context context, String tipStr, int second) { 158 public static void textDialog(Context context, String tipStr, int second) {
  159 + if (context == null) {
  160 + return;
  161 + }
  162 + if (tipDialog!=null&&tipDialog.isShowing()){
  163 + tipDialog.dismiss();
  164 + }
125 tipDialog = new QMUITipDialog.Builder(context) 165 tipDialog = new QMUITipDialog.Builder(context)
126 .setTipWord(tipStr) 166 .setTipWord(tipStr)
127 .create(); 167 .create();
128 tipDialog.setCanceledOnTouchOutside(false);//屏蔽返回键 168 tipDialog.setCanceledOnTouchOutside(false);//屏蔽返回键
129 - tipDialog.show();  
130 - new Handler().postDelayed(new Runnable() {  
131 - @Override  
132 - public void run() {  
133 -  
134 - /**  
135 - * 延时执行的代码  
136 - */  
137 - tipDialog.dismiss();  
138 - }  
139 - }, second * 1000); // 延时2秒 169 + if (!tipDialog.isShowing()) {
  170 + tipDialog.show();
  171 + new Handler().postDelayed(new Runnable() {
  172 + @Override
  173 + public void run() {
  174 + if (context == null) {
  175 + return;
  176 + }
  177 + /**
  178 + * 延时执行的代码
  179 + */
  180 + tipDialog.dismiss();
  181 + }
  182 + }, second * 1000); // 延时2秒
  183 + }
140 } 184 }
141 185
142 public static void dismessDialog() { 186 public static void dismessDialog() {
143 - if (tipDialog != null) {  
144 - if (tipDialog.isShowing()) {  
145 - tipDialog.dismiss();  
146 - } 187 + if (tipDialog != null && tipDialog.isShowing()) {
  188 + tipDialog.dismiss();
147 } 189 }
148 } 190 }
149 } 191 }