Skip to content

Commit 546aea3

Browse files
author
hongyangAndroid
committed
修复负数为属性值无效问题,fixed #64
1 parent 13b7c84 commit 546aea3

4 files changed

Lines changed: 28 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dependencies {
5959

6060
```
6161
dependencies {
62-
compile 'com.zhy:autolayout:1.3.6'
62+
compile 'com.zhy:autolayout:1.3.7'
6363
}
6464
```
6565

autolayout/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'com.github.dcendents.android-maven'
33
apply plugin: 'com.jfrog.bintray'
44

5-
version = "1.3.6"
5+
version = "1.3.7"
66

77
android {
88
compileSdkVersion 23
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import android.content.Context;
2+
import android.support.v7.internal.widget.ContentFrameLayout;
3+
import android.util.AttributeSet;
4+
5+
/**
6+
* Created by zhy on 16/2/25.
7+
*/
8+
public class AutoContentFrameLayout extends ContentFrameLayout
9+
{
10+
public AutoContentFrameLayout(Context context)
11+
{
12+
super(context);
13+
}
14+
15+
public AutoContentFrameLayout(Context context, AttributeSet attrs)
16+
{
17+
super(context, attrs);
18+
}
19+
20+
public AutoContentFrameLayout(Context context, AttributeSet attrs, int defStyleAttr)
21+
{
22+
super(context, attrs, defStyleAttr);
23+
}
24+
}

autolayout/src/main/java/com/zhy/autolayout/attr/AutoAttr.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public void apply(View view)
7272
}
7373
}
7474

75-
val = Math.max(val, 1);//for very thin divider
75+
if (val > 0)
76+
val = Math.max(val, 1);//for very thin divider
7677
execute(view, val);
7778
}
7879

0 commit comments

Comments
 (0)