@@ -23,7 +23,7 @@ android { |
||
23 | 23 |
targetSdkVersion 24 |
24 | 24 |
versionCode 1 |
25 | 25 |
versionName "1.0" |
26 |
- buildConfigField "boolean", "isTestMode", "true" |
|
26 |
+ buildConfigField "boolean", "isTestMode", "false" |
|
27 | 27 |
} |
28 | 28 |
signingConfigs { |
29 | 29 |
releaseConfig { |
@@ -2,7 +2,7 @@ package ai.pai.lensman.box; |
||
2 | 2 |
|
3 | 3 |
public final class BoxUrlContainer { |
4 | 4 |
|
5 |
- private static final String BASE_URL = "http://192.168.1.190:8002/"; |
|
5 |
+ private static final String BASE_URL = "http://192.168.1.191:8002/"; |
|
6 | 6 |
|
7 | 7 |
public static final String SESSION_START_URL = BASE_URL+"session_start"; |
8 | 8 |
|
@@ -70,7 +70,7 @@ public class PhotoRecyclerAdapter extends RecyclerView.Adapter<PhotoRecyclerAdap |
||
70 | 70 |
lp.width = width; |
71 | 71 |
lp.height = height; |
72 | 72 |
holder.photo.setLayoutParams(lp); |
73 |
- if(item.uploadStatus!= PhotoBean.UploadStatus.STATUS_ERROR){ |
|
73 |
+ if(item.uploadStatus== PhotoBean.UploadStatus.STATUS_ERROR){ |
|
74 | 74 |
holder.errorLayout.setVisibility(View.VISIBLE); |
75 | 75 |
}else{ |
76 | 76 |
holder.errorLayout.setVisibility(View.GONE); |
@@ -75,17 +75,13 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie |
||
75 | 75 |
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(mCallback); |
76 | 76 |
itemTouchHelper.attachToRecyclerView(photosRecyclerView); |
77 | 77 |
|
78 |
- } |
|
79 |
- |
|
80 |
- @Override |
|
81 |
- protected void onResume() { |
|
82 |
- super.onResume(); |
|
83 | 78 |
presenter.start(); |
84 | 79 |
} |
85 | 80 |
|
81 |
+ |
|
86 | 82 |
@Override |
87 |
- protected void onStop() { |
|
88 |
- super.onStop(); |
|
83 |
+ protected void onDestroy() { |
|
84 |
+ super.onDestroy(); |
|
89 | 85 |
presenter.stop(); |
90 | 86 |
} |
91 | 87 |
|
@@ -33,6 +33,7 @@ public class SessionInteractor { |
||
33 | 33 |
private SessionListener listener; |
34 | 34 |
private HttpPostTask sessionStartTask; |
35 | 35 |
private HttpPostTask sessionEndTask; |
36 |
+ private String randomSessionId; |
|
36 | 37 |
|
37 | 38 |
private static final String TAG = "SessionInteractor"; |
38 | 39 |
|
@@ -58,7 +59,8 @@ public class SessionInteractor { |
||
58 | 59 |
cancelTask(sessionStartTask); |
59 | 60 |
HashMap<String,String> params = new HashMap<>(); |
60 | 61 |
params.put("lensman",sessionBean.lensmanId); |
61 |
- params.put("session",sessionBean.sessionId+"_"+new Random().nextInt(123456)); |
|
62 |
+ randomSessionId = sessionBean.sessionId+"_"+new Random().nextInt(123456); |
|
63 |
+ params.put("session",randomSessionId); |
|
62 | 64 |
sessionStartTask = new HttpPostTask(params){ |
63 | 65 |
@Override |
64 | 66 |
protected boolean parseResponse(String response) { |
@@ -134,7 +136,7 @@ public class SessionInteractor { |
||
134 | 136 |
} |
135 | 137 |
HashMap<String,String> params = new HashMap<>(); |
136 | 138 |
params.put("lensman",sessionBean.lensmanId); |
137 |
- params.put("session",sessionBean.sessionId); |
|
139 |
+ params.put("session",randomSessionId); |
|
138 | 140 |
HttpPostTask fetchThumbnailTask = new HttpPostTask(params){ |
139 | 141 |
ArrayList<PhotoBean> photoList = new ArrayList<>(); |
140 | 142 |
@Override |
@@ -258,7 +260,7 @@ public class SessionInteractor { |
||
258 | 260 |
cancelTask(sessionEndTask); |
259 | 261 |
HashMap<String,String> params = new HashMap<>(); |
260 | 262 |
params.put("lensman",sessionBean.lensmanId); |
261 |
- params.put("session",sessionBean.sessionId); |
|
263 |
+ params.put("session",randomSessionId); |
|
262 | 264 |
sessionEndTask = new HttpPostTask(params); |
263 | 265 |
sessionEndTask.executeOnExecutor(ThreadExecutor.getInstance().getExecutor(), BoxUrlContainer.SESSION_END_URL); |
264 | 266 |
if(timer!=null){ |