- sessionBean.sessionDate=20160813;
- sessionBean.sessionSeq = new Random().nextInt(10000);
- sessionBean.sessionId ="chengzhenyu_test"+sessionBean.sessionSeq;
+ private void jumpToSelectedSession(SessionBean sessionBean) {
Intent intent = new Intent(this, SessionActivity.class);
intent.putExtra("session",sessionBean);
startActivity(intent);
@@ -14,8 +14,8 @@ public class UploadContract {
|
||
| 14 | 14 |
interface View extends BaseView {
|
| 15 | 15 |
|
| 16 | 16 |
void addNewSessionView(SessionBean bean); |
| 17 |
- void showBTDisconnectedView(); |
|
| 18 |
- void showBTConnectedView(); |
|
| 17 |
+ void showBoxDisconnectedView(); |
|
| 18 |
+ void showBoxConnectedView(); |
|
| 19 | 19 |
void showEmptyView(); |
| 20 | 20 |
void showSessionViews(); |
| 21 | 21 |
void updateSessionUploadView(SessionBean bean); |
@@ -23,7 +23,7 @@ public class UploadContract {
|
||
| 23 | 23 |
} |
| 24 | 24 |
|
| 25 | 25 |
interface Presenter extends BasePresenter{
|
| 26 |
- |
|
| 26 |
+ SessionBean createNewSession(); |
|
| 27 | 27 |
} |
| 28 | 28 |
|
| 29 | 29 |
} |
@@ -8,10 +8,12 @@ public class UploadPresenter implements UploadContract.Presenter {
|
||
| 8 | 8 |
|
| 9 | 9 |
private UploadContract.View uploadView; |
| 10 | 10 |
private ArrayList<SessionBean> sessionList; |
| 11 |
+ private String lensmanId; |
|
| 12 |
+ private int sessionSeq; |
|
| 11 | 13 |
|
| 12 |
- |
|
| 13 |
- public UploadPresenter( UploadContract.View view){
|
|
| 14 |
+ public UploadPresenter(UploadContract.View view,String lensmanId){
|
|
| 14 | 15 |
this.uploadView = view; |
| 16 |
+ this.lensmanId = lensmanId; |
|
| 15 | 17 |
sessionList = new ArrayList<>(); |
| 16 | 18 |
} |
| 17 | 19 |
|
@@ -24,6 +26,7 @@ public class UploadPresenter implements UploadContract.Presenter {
|
||
| 24 | 26 |
uploadView.showSessionViews(); |
| 25 | 27 |
uploadView.refreshSessionViews(sessionList); |
| 26 | 28 |
} |
| 29 |
+ sessionSeq = sessionList.size(); |
|
| 27 | 30 |
} |
| 28 | 31 |
|
| 29 | 32 |
@Override |
@@ -31,4 +34,14 @@ public class UploadPresenter implements UploadContract.Presenter {
|
||
| 31 | 34 |
|
| 32 | 35 |
} |
| 33 | 36 |
|
| 37 |
+ @Override |
|
| 38 |
+ public SessionBean createNewSession() {
|
|
| 39 |
+ SessionBean sessionBean = new SessionBean(); |
|
| 40 |
+ sessionBean.lensmanId = lensmanId; |
|
| 41 |
+ sessionBean.sessionDate=20160813; |
|
| 42 |
+ sessionBean.sessionSeq = sessionSeq+1; |
|
| 43 |
+ sessionBean.sessionId ="chengzhenyu_test"+sessionBean.sessionSeq; |
|
| 44 |
+ sessionList.add(sessionBean); |
|
| 45 |
+ return sessionBean; |
|
| 46 |
+ } |
|
| 34 | 47 |
} |
@@ -76,17 +76,10 @@ |
||
| 76 | 76 |
android:layout_height="match_parent" |
| 77 | 77 |
android:layout_below="@id/title_bar_with_back_btn"> |
| 78 | 78 |
|
| 79 |
- <android.support.v4.widget.SwipeRefreshLayout |
|
| 80 |
- android:id="@+id/refresh_layout" |
|
| 79 |
+ <android.support.v7.widget.RecyclerView |
|
| 80 |
+ android:id="@+id/recycler_view_photos" |
|
| 81 | 81 |
android:layout_width="match_parent" |
| 82 |
- android:layout_height="match_parent"> |
|
| 83 |
- |
|
| 84 |
- <android.support.v7.widget.RecyclerView |
|
| 85 |
- android:id="@+id/recycler_view_photos" |
|
| 86 |
- android:layout_width="match_parent" |
|
| 87 |
- android:layout_height="match_parent" /> |
|
| 88 |
- |
|
| 89 |
- </android.support.v4.widget.SwipeRefreshLayout> |
|
| 82 |
+ android:layout_height="match_parent" /> |
|
| 90 | 83 |
|
| 91 | 84 |
<ImageButton |
| 92 | 85 |
android:id="@+id/btn_session_complete" |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 |
android:layout_height="32dp" |
| 22 | 22 |
android:layout_gravity="center_vertical" |
| 23 | 23 |
android:layout_marginLeft="6dp" |
| 24 |
- android:src="@drawable/ic_launcher" /> |
|
| 24 |
+ android:src="@drawable/logo" /> |
|
| 25 | 25 |
|
| 26 | 26 |
<TextView |
| 27 | 27 |
android:layout_width="0dp" |
@@ -43,18 +43,12 @@ |
||
| 43 | 43 |
android:layout_centerInParent="true" |
| 44 | 44 |
android:src="@drawable/no_photo_tip" /> |
| 45 | 45 |
|
| 46 |
- <android.support.v4.widget.SwipeRefreshLayout |
|
| 47 |
- android:id="@+id/swipe_refresh_layout_sessions" |
|
| 46 |
+ <android.support.v7.widget.RecyclerView |
|
| 47 |
+ android:id="@+id/recycler_view_sessions" |
|
| 48 | 48 |
android:layout_width="match_parent" |
| 49 | 49 |
android:layout_height="match_parent" |
| 50 |
- android:layout_below="@id/title_layout"> |
|
| 50 |
+ android:layout_below="@id/title_layout"/> |
|
| 51 | 51 |
|
| 52 |
- <android.support.v7.widget.RecyclerView |
|
| 53 |
- android:id="@+id/recycler_view_sessions" |
|
| 54 |
- android:layout_width="match_parent" |
|
| 55 |
- android:layout_height="match_parent" /> |
|
| 56 |
- |
|
| 57 |
- </android.support.v4.widget.SwipeRefreshLayout> |
|
| 58 | 52 |
|
| 59 | 53 |
<RelativeLayout |
| 60 | 54 |
android:layout_width="match_parent" |
@@ -75,7 +69,7 @@ |
||
| 75 | 69 |
android:gravity="center_horizontal"> |
| 76 | 70 |
|
| 77 | 71 |
<ImageView |
| 78 |
- android:id="@+id/iv_bt_status" |
|
| 72 |
+ android:id="@+id/iv_box_status" |
|
| 79 | 73 |
android:layout_width="24dp" |
| 80 | 74 |
android:layout_height="24dp" |
| 81 | 75 |
android:layout_centerHorizontal="true" |
@@ -83,10 +77,10 @@ |
||
| 83 | 77 |
android:src="@drawable/wifi_connect" /> |
| 84 | 78 |
|
| 85 | 79 |
<TextView |
| 86 |
- android:id="@+id/tv_bt_status" |
|
| 80 |
+ android:id="@+id/tv_box_status" |
|
| 87 | 81 |
android:layout_width="wrap_content" |
| 88 | 82 |
android:layout_height="wrap_content" |
| 89 |
- android:layout_below="@id/iv_bt_status" |
|
| 83 |
+ android:layout_below="@id/iv_box_status" |
|
| 90 | 84 |
android:layout_centerHorizontal="true" |
| 91 | 85 |
android:text="@string/bt_connected" |
| 92 | 86 |
android:textColor="@color/grey" |