From 875ffe142dbfaffcd6ed16b19e90ace06f94edfd Mon Sep 17 00:00:00 2001 From: janishar Date: Thu, 13 Oct 2016 19:03:18 +0530 Subject: [PATCH] Swipe gravity fix for wrap content case --- placeholderview/build.gradle | 4 ++-- .../com/mindorks/placeholderview/SwipePlaceHolderView.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/placeholderview/build.gradle b/placeholderview/build.gradle index 89148b0..d40cf2c 100644 --- a/placeholderview/build.gradle +++ b/placeholderview/build.gradle @@ -13,7 +13,7 @@ ext { siteUrl = 'https://github.com/janishar/PlaceHolderView' gitUrl = 'https://github.com/janishar/PlaceHolderView.git' - libraryVersion = '0.2.8' + libraryVersion = '0.2.9' developerId = 'janishar.ali@gmail.com' developerName = 'Janishar Ali' @@ -32,7 +32,7 @@ android { minSdkVersion 16 targetSdkVersion 24 versionCode 7 - versionName "0.2.8" + versionName "0.2.9" } buildTypes { release { diff --git a/placeholderview/src/main/java/com/mindorks/placeholderview/SwipePlaceHolderView.java b/placeholderview/src/main/java/com/mindorks/placeholderview/SwipePlaceHolderView.java index 6ae1fdf..d18a443 100644 --- a/placeholderview/src/main/java/com/mindorks/placeholderview/SwipePlaceHolderView.java +++ b/placeholderview/src/main/java/com/mindorks/placeholderview/SwipePlaceHolderView.java @@ -270,7 +270,7 @@ protected FrameLayout.LayoutParams getLayoutParamsWithSwipeDecor(int position, S }else{ FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); - layoutParams.gravity = Gravity.CENTER; + layoutParams.gravity = decor.getViewGravity(); layoutParams.setMargins(decor.getPaddingLeft() * position, decor.getPaddingTop() * position, 0, 0); return layoutParams; }