Skip to content

Commit 3284f68

Browse files
author
huahongyang
committed
🐛 upgrade to v1.1.2
1 parent 776327d commit 3284f68

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/captures
99
.externalNativeBuild
1010
.idea
11+
/sample/build

library/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ android {
55
defaultConfig {
66
minSdkVersion 15
77
targetSdkVersion 26
8-
versionCode 9
9-
versionName "1.1.1"
8+
versionCode 10
9+
versionName "1.1.2"
1010
}
1111
buildTypes {
1212
release {
@@ -27,7 +27,7 @@ publish {
2727
userOrg = 'ethanhua'
2828
groupId = 'com.ethanhua'
2929
artifactId = 'skeleton'
30-
publishVersion = '1.1.1'
30+
publishVersion = '1.1.2'
3131
bintrayUser = 'ethanhua'
3232
bintrayKey = ''
3333
desc = 'a library provider a easy way to show skeleton loading view'

library/src/main/java/com/ethanhua/skeleton/ShimmerViewHolder.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.support.v7.widget.RecyclerView;
44
import android.view.LayoutInflater;
5+
import android.view.View;
56
import android.view.ViewGroup;
67

78
/**
@@ -13,6 +14,11 @@ public class ShimmerViewHolder extends RecyclerView.ViewHolder {
1314
public ShimmerViewHolder(LayoutInflater inflater, ViewGroup parent, int innerViewResId) {
1415
super(inflater.inflate(R.layout.layout_shimmer, parent, false));
1516
ViewGroup layout = (ViewGroup) itemView;
16-
inflater.inflate(innerViewResId, layout, true);
17+
View view = inflater.inflate(innerViewResId, layout, false);
18+
ViewGroup.LayoutParams lp = view.getLayoutParams();
19+
if (lp != null) {
20+
layout.setLayoutParams(lp);
21+
}
22+
layout.addView(view);
1723
}
1824
}

library/src/main/java/com/ethanhua/skeleton/ViewSkeletonScreen.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ private ShimmerLayout generateShimmerContainerLayout(ViewGroup parentView) {
4242
shimmerLayout.setShimmerAngle(mShimmerAngle);
4343
shimmerLayout.setShimmerAnimationDuration(mShimmerDuration);
4444
View innerView = LayoutInflater.from(mActualView.getContext()).inflate(mSkeletonResID, shimmerLayout, false);
45+
ViewGroup.LayoutParams lp = innerView.getLayoutParams();
46+
if (lp != null) {
47+
shimmerLayout.setLayoutParams(lp);
48+
}
4549
shimmerLayout.addView(innerView);
4650
shimmerLayout.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
4751
@Override

sample/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies {
2424
exclude group: 'com.android.support', module: 'support-annotations'
2525
})
2626
//implementation project(':library')
27-
implementation 'com.ethanhua:skeleton:1.1.1'
27+
implementation 'com.ethanhua:skeleton:1.1.2'
2828
implementation 'io.supercharge:shimmerlayout:2.1.0'
2929
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
3030
implementation 'com.android.support:recyclerview-v7:26.1.0'

0 commit comments

Comments
 (0)