6
6
import android .widget .TextView ;
7
7
8
8
import com .bumptech .glide .Glide ;
9
+ import com .bumptech .glide .load .MultiTransformation ;
9
10
import com .mindorks .placeholderview .SwipePlaceHolderView ;
10
11
import com .mindorks .placeholderview .annotations .Click ;
11
12
import com .mindorks .placeholderview .annotations .Layout ;
12
- import com .mindorks .placeholderview .annotations .NonReusable ;
13
13
import com .mindorks .placeholderview .annotations .Resolve ;
14
14
import com .mindorks .placeholderview .annotations .View ;
15
15
import com .mindorks .placeholderview .annotations .swipe .SwipeCancelState ;
16
+ import com .mindorks .placeholderview .annotations .swipe .SwipeHead ;
16
17
import com .mindorks .placeholderview .annotations .swipe .SwipeIn ;
17
18
import com .mindorks .placeholderview .annotations .swipe .SwipeInState ;
18
19
import com .mindorks .placeholderview .annotations .swipe .SwipeOut ;
19
20
import com .mindorks .placeholderview .annotations .swipe .SwipeOutState ;
21
+ import com .mindorks .placeholderview .annotations .swipe .SwipeView ;
20
22
23
+ import jp .wasabeef .glide .transformations .BlurTransformation ;
21
24
import jp .wasabeef .glide .transformations .RoundedCornersTransformation ;
22
25
23
26
/**
@@ -35,6 +38,9 @@ public class TinderCard {
35
38
@ View (R .id .locationNameTxt )
36
39
private TextView locationNameTxt ;
37
40
41
+ @ SwipeView
42
+ private android .view .View cardView ;
43
+
38
44
private Profile mProfile ;
39
45
private Context mContext ;
40
46
private SwipePlaceHolderView mSwipeView ;
@@ -47,14 +53,29 @@ public TinderCard(Context context, Profile profile, SwipePlaceHolderView swipeVi
47
53
48
54
@ Resolve
49
55
private void onResolved (){
56
+ MultiTransformation multi = new MultiTransformation (
57
+ new BlurTransformation (mContext , 30 ),
58
+ new RoundedCornersTransformation (
59
+ mContext , Utils .dpToPx (7 ), 0 ,
60
+ RoundedCornersTransformation .CornerType .TOP ));
61
+
50
62
Glide .with (mContext ).load (mProfile .getImageUrl ())
51
- .bitmapTransform (new RoundedCornersTransformation (mContext , Utils .dpToPx (7 ), 0 ,
52
- RoundedCornersTransformation .CornerType .TOP ))
63
+ .bitmapTransform (multi )
53
64
.into (profileImageView );
54
65
nameAgeTxt .setText (mProfile .getName () + ", " + mProfile .getAge ());
55
66
locationNameTxt .setText (mProfile .getLocation ());
56
67
}
57
68
69
+ @ SwipeHead
70
+ private void onSwipeHeadCard () {
71
+ Glide .with (mContext ).load (mProfile .getImageUrl ())
72
+ .bitmapTransform (new RoundedCornersTransformation (
73
+ mContext , Utils .dpToPx (7 ), 0 ,
74
+ RoundedCornersTransformation .CornerType .TOP ))
75
+ .into (profileImageView );
76
+ cardView .invalidate ();
77
+ }
78
+
58
79
@ Click (R .id .profileImageView )
59
80
private void onClick (){
60
81
Log .d ("EVENT" , "profileImageView click" );
0 commit comments