Skip to content

Commit 3502a18

Browse files
committed
Add Blur On Below Cards
1 parent 0ad9a22 commit 3502a18

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

TinderSwipe/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ dependencies {
3232
compile 'com.android.support:cardview-v7:25.3.1'
3333
compile 'com.github.bumptech.glide:glide:3.7.0'
3434
compile 'com.google.code.gson:gson:2.7'
35-
compile 'com.mindorks:placeholderview:0.7.1'
35+
compile 'com.mindorks:placeholderview:0.7.2'
3636
compile 'jp.wasabeef:glide-transformations:2.0.2'
3737
}

TinderSwipe/app/src/main/assets/profiles.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
"location":"New City"
2525
},
2626
{
27-
"url":"http://www.qqxxzx.com/images/pretty-girls-pictures/pretty-girls-pictures-17.jpg",
27+
"url":"https://i.pinimg.com/736x/fb/6b/26/fb6b26ab5e2b252f11dbf120ccd8cb16--blonde-girl-selfie-happy-smile.jpg",
2828
"name":"Saansa",
2929
"age":20,
3030
"location":"Manhattan"
3131
},
3232
{
33-
"url":"http://www.qqxxzx.com/images/pretty-girls-pictures/pretty-girls-pictures-18.jpg",
33+
"url":"http://awallpapersimages.com/wp-content/uploads/2016/08/Punjabi-Actress-Oshin-Sai-Hot-Wallpape.jpg",
3434
"name":"Khaleesi",
3535
"age":24,
3636
"location":"Future Westros"
@@ -42,13 +42,13 @@
4242
"location":"India"
4343
},
4444
{
45-
"url":"http://oddpad.com/wp-content/uploads/2014/12/pretty_girls_13.jpg",
45+
"url":"https://scontent.cdninstagram.com/t51.2885-15/e15/11296636_859622937440144_40137816_n.jpg",
4646
"name":"Jasmin",
4747
"age":23,
4848
"location":"Taxes"
4949
},
5050
{
51-
"url":"http://www.spyderonlines.com/images/wallpapers/pretty-girls-pictures/pretty-girls-pictures-16.jpg",
51+
"url":"http://informationng.com/wp-content/uploads/2014/08/Selfie-featured.jpg",
5252
"name":"Monica",
5353
"age":23,
5454
"location":"New York"
@@ -96,7 +96,7 @@
9696
"location":"China"
9797
},
9898
{
99-
"url":"http://oddpad.com/wp-content/uploads/2015/03/pretty_girls_31.jpg",
99+
"url":"https://i.pinimg.com/originals/f0/86/85/f086855181d270cd25eacf12e668a93a.jpg",
100100
"name":"SDF",
101101
"age":21,
102102
"location":"America"

TinderSwipe/app/src/main/java/test/mindorks/swipe/tinderswipe/TinderCard.java

+24-3
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@
66
import android.widget.TextView;
77

88
import com.bumptech.glide.Glide;
9+
import com.bumptech.glide.load.MultiTransformation;
910
import com.mindorks.placeholderview.SwipePlaceHolderView;
1011
import com.mindorks.placeholderview.annotations.Click;
1112
import com.mindorks.placeholderview.annotations.Layout;
12-
import com.mindorks.placeholderview.annotations.NonReusable;
1313
import com.mindorks.placeholderview.annotations.Resolve;
1414
import com.mindorks.placeholderview.annotations.View;
1515
import com.mindorks.placeholderview.annotations.swipe.SwipeCancelState;
16+
import com.mindorks.placeholderview.annotations.swipe.SwipeHead;
1617
import com.mindorks.placeholderview.annotations.swipe.SwipeIn;
1718
import com.mindorks.placeholderview.annotations.swipe.SwipeInState;
1819
import com.mindorks.placeholderview.annotations.swipe.SwipeOut;
1920
import com.mindorks.placeholderview.annotations.swipe.SwipeOutState;
21+
import com.mindorks.placeholderview.annotations.swipe.SwipeView;
2022

23+
import jp.wasabeef.glide.transformations.BlurTransformation;
2124
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
2225

2326
/**
@@ -35,6 +38,9 @@ public class TinderCard {
3538
@View(R.id.locationNameTxt)
3639
private TextView locationNameTxt;
3740

41+
@SwipeView
42+
private android.view.View cardView;
43+
3844
private Profile mProfile;
3945
private Context mContext;
4046
private SwipePlaceHolderView mSwipeView;
@@ -47,14 +53,29 @@ public TinderCard(Context context, Profile profile, SwipePlaceHolderView swipeVi
4753

4854
@Resolve
4955
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+
5062
Glide.with(mContext).load(mProfile.getImageUrl())
51-
.bitmapTransform(new RoundedCornersTransformation(mContext, Utils.dpToPx(7), 0,
52-
RoundedCornersTransformation.CornerType.TOP))
63+
.bitmapTransform(multi)
5364
.into(profileImageView);
5465
nameAgeTxt.setText(mProfile.getName() + ", " + mProfile.getAge());
5566
locationNameTxt.setText(mProfile.getLocation());
5667
}
5768

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+
5879
@Click(R.id.profileImageView)
5980
private void onClick(){
6081
Log.d("EVENT", "profileImageView click");

0 commit comments

Comments
 (0)