| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,13 +59,13 @@ dependencies { | |||
| 59 | 59 | ||
| 60 | 60 | ``` | |
| 61 | 61 | dependencies { | |
| 62 | - compile 'com.zhy:autolayout:1.4.1' | ||
| 62 | + compile 'com.zhy:autolayout:1.4.3' | ||
| 63 | 63 | } | |
| 64 | 64 | ``` | |
| 65 | 65 | ||
| 66 | 66 | * Eclipse | |
| 67 | 67 | ||
| 68 | - 下载[AutoLayoutDemoForEclipse.zip](AutoLayoutDemoForEclipse.zip),导入到eclipse中即可。 | ||
| 68 | + 建议使用As,方便版本更新。实在不行,只有复制粘贴源码了。 | ||
| 69 | 69 | ||
| 70 | 70 | ## 用法 | |
| 71 | 71 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | |||
| 2 | 2 | apply plugin: 'com.github.dcendents.android-maven' | |
| 3 | 3 | apply plugin: 'com.jfrog.bintray' | |
| 4 | 4 | ||
| 5 | - version = "1.4.1" | ||
| 5 | + version = "1.4.3" | ||
| 6 | 6 | ||
| 7 | 7 | android { | |
| 8 | 8 | compileSdkVersion 23 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,10 @@ | |||
| 15 | 15 | import com.zhy.autolayout.attr.MaxWidthAttr; | |
| 16 | 16 | import com.zhy.autolayout.attr.MinHeightAttr; | |
| 17 | 17 | import com.zhy.autolayout.attr.MinWidthAttr; | |
| 18 | + import com.zhy.autolayout.attr.PaddingBottomAttr; | ||
| 19 | + import com.zhy.autolayout.attr.PaddingLeftAttr; | ||
| 20 | + import com.zhy.autolayout.attr.PaddingRightAttr; | ||
| 21 | + import com.zhy.autolayout.attr.PaddingTopAttr; | ||
| 18 | 22 | import com.zhy.autolayout.attr.TextSizeAttr; | |
| 19 | 23 | import com.zhy.autolayout.attr.WidthAttr; | |
| 20 | 24 | ||
@@ -88,10 +92,10 @@ public static AutoLayoutInfo getAttrFromView(View view, int attrs, int base) | |||
| 88 | 92 | //padding | |
| 89 | 93 | if ((attrs & Attrs.PADDING) != 0) | |
| 90 | 94 | { | |
| 91 | - autoLayoutInfo.addAttr(MarginLeftAttr.generate(view.getPaddingLeft(), base)); | ||
| 92 | - autoLayoutInfo.addAttr(MarginTopAttr.generate(view.getPaddingTop(), base)); | ||
| 93 | - autoLayoutInfo.addAttr(MarginRightAttr.generate(view.getPaddingRight(), base)); | ||
| 94 | - autoLayoutInfo.addAttr(MarginBottomAttr.generate(view.getPaddingBottom(), base)); | ||
| 95 | + autoLayoutInfo.addAttr(PaddingLeftAttr.generate(view.getPaddingLeft(), base)); | ||
| 96 | + autoLayoutInfo.addAttr(PaddingTopAttr.generate(view.getPaddingTop(), base)); | ||
| 97 | + autoLayoutInfo.addAttr(PaddingRightAttr.generate(view.getPaddingRight(), base)); | ||
| 98 | + autoLayoutInfo.addAttr(PaddingBottomAttr.generate(view.getPaddingBottom(), base)); | ||
| 95 | 99 | } | |
| 96 | 100 | if ((attrs & Attrs.PADDING_LEFT) != 0) | |
| 97 | 101 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,6 +34,7 @@ protected void execute(View view, int val) | |||
| 34 | 34 | } | |
| 35 | 35 | ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) view.getLayoutParams(); | |
| 36 | 36 | lp.topMargin = val; | |
| 37 | + | ||
| 37 | 38 | } | |
| 38 | 39 | ||
| 39 | 40 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,8 @@ public static void auto(View view) | |||
| 35 | 35 | public static void auto(View view, int attrs, int base) | |
| 36 | 36 | { | |
| 37 | 37 | AutoLayoutInfo autoLayoutInfo = AutoLayoutInfo.getAttrFromView(view, attrs, base); | |
| 38 | - autoLayoutInfo.fillAttrs(view); | ||
| 38 | + if (autoLayoutInfo != null) | ||
| 39 | + autoLayoutInfo.fillAttrs(view); | ||
| 39 | 40 | } | |
| 40 | 41 | ||
| 41 | 42 | public static void autoTextSize(View view) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,5 +55,4 @@ public int getCount() | |||
| 55 | 55 | mTabLayout.setupWithViewPager(mViewPager); | |
| 56 | 56 | } | |
| 57 | 57 | ||
| 58 | - | ||
| 59 | 58 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments