@@ -70,6 +70,11 @@ 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){ |
|
74 |
+ holder.errorLayout.setVisibility(View.VISIBLE); |
|
75 |
+ }else{ |
|
76 |
+ holder.errorLayout.setVisibility(View.GONE); |
|
77 |
+ } |
|
73 | 78 |
} |
74 | 79 |
|
75 | 80 |
@Override |
@@ -83,6 +88,7 @@ public class PhotoRecyclerAdapter extends RecyclerView.Adapter<PhotoRecyclerAdap |
||
83 | 88 |
class MyViewHolder extends RecyclerView.ViewHolder{ |
84 | 89 |
|
85 | 90 |
@BindView(R.id.iv_session_photo_item) ImageView photo; |
91 |
+ @BindView(R.id.layout_upload_fail) View errorLayout; |
|
86 | 92 |
|
87 | 93 |
public MyViewHolder(View view){ |
88 | 94 |
super(view); |
@@ -1,11 +1,42 @@ |
||
1 | 1 |
<?xml version="1.0" encoding="utf-8"?> |
2 |
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
2 |
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
3 | 3 |
android:layout_width="wrap_content" |
4 |
- android:layout_height="wrap_content" |
|
5 |
- android:orientation="vertical"> |
|
4 |
+ android:layout_height="wrap_content"> |
|
6 | 5 |
|
7 | 6 |
<ImageView |
8 | 7 |
android:id="@+id/iv_session_photo_item" |
9 | 8 |
android:layout_width="wrap_content" |
10 |
- android:layout_height="wrap_content" /> |
|
11 |
-</LinearLayout> |
|
9 |
+ android:layout_height="wrap_content" |
|
10 |
+ android:scaleType="centerCrop"/> |
|
11 |
+ |
|
12 |
+ <RelativeLayout |
|
13 |
+ android:id="@+id/layout_upload_fail" |
|
14 |
+ android:layout_width="wrap_content" |
|
15 |
+ android:layout_height="wrap_content" |
|
16 |
+ android:layout_alignBottom="@+id/iv_session_photo_item" |
|
17 |
+ android:layout_alignLeft="@+id/iv_session_photo_item" |
|
18 |
+ android:layout_alignTop="@+id/iv_session_photo_item" |
|
19 |
+ android:layout_alignRight="@+id/iv_session_photo_item" |
|
20 |
+ android:background="@color/black" |
|
21 |
+ android:alpha="0.4" |
|
22 |
+ android:visibility="gone"> |
|
23 |
+ |
|
24 |
+ <ImageView |
|
25 |
+ android:id="@+id/iv_upload_retry" |
|
26 |
+ android:layout_width="40dp" |
|
27 |
+ android:layout_height="40dp" |
|
28 |
+ android:layout_centerInParent="true" |
|
29 |
+ android:src="@drawable/retry"/> |
|
30 |
+ <TextView |
|
31 |
+ android:id="@+id/tv_upload_fail" |
|
32 |
+ android:layout_width="wrap_content" |
|
33 |
+ android:layout_height="wrap_content" |
|
34 |
+ android:layout_marginTop="4dp" |
|
35 |
+ android:layout_centerInParent="true" |
|
36 |
+ android:layout_below="@id/iv_upload_retry" |
|
37 |
+ android:text="@string/upload_error" |
|
38 |
+ android:textSize="16sp" |
|
39 |
+ android:textColor="@color/white"/> |
|
40 |
+ |
|
41 |
+ </RelativeLayout> |
|
42 |
+</RelativeLayout> |