forked from hongyangAndroid/AndroidAutoLayout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hongyangAndroid
committed
Dec 24, 2015
1 parent
276fa91
commit 7cf68a0
Showing
11 changed files
with
214 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
autolayout/src/main/java/com/zhy/autolayout/attr/AutoAttrEnum.java
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
autolayout/src/main/java/com/zhy/autolayout/attr/MaxHeightAttr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.zhy.autolayout.attr; | ||
|
||
import android.view.View; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
/** | ||
* Created by zhy on 15/12/24. | ||
*/ | ||
public class MaxHeightAttr extends AutoAttr | ||
{ | ||
public MaxHeightAttr(int pxVal, int baseWidth, int baseHeight) | ||
{ | ||
super(pxVal, baseWidth, baseHeight); | ||
} | ||
|
||
@Override | ||
protected int attrVal() | ||
{ | ||
return Attrs.MAX_HEIGHT; | ||
} | ||
|
||
@Override | ||
protected boolean defaultBaseWidth() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
protected void execute(View view, int val) | ||
{ | ||
try | ||
{ | ||
Method setMaxWidthMethod = view.getClass().getMethod("setMaxHeight", int.class); | ||
setMaxWidthMethod.invoke(view, val); | ||
} catch (Exception ignore) | ||
{ | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
autolayout/src/main/java/com/zhy/autolayout/attr/MaxWidthAttr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.zhy.autolayout.attr; | ||
|
||
import android.view.View; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
/** | ||
* Created by zhy on 15/12/24. | ||
*/ | ||
public class MaxWidthAttr extends AutoAttr | ||
{ | ||
public MaxWidthAttr(int pxVal, int baseWidth, int baseHeight) | ||
{ | ||
super(pxVal, baseWidth, baseHeight); | ||
} | ||
|
||
@Override | ||
protected int attrVal() | ||
{ | ||
return Attrs.MAX_WIDTH; | ||
} | ||
|
||
@Override | ||
protected boolean defaultBaseWidth() | ||
{ | ||
return true; | ||
} | ||
|
||
@Override | ||
protected void execute(View view, int val) | ||
{ | ||
try | ||
{ | ||
Method setMaxWidthMethod = view.getClass().getMethod("setMaxWidth", int.class); | ||
setMaxWidthMethod.invoke(view, val); | ||
} catch (Exception ignore) | ||
{ | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
autolayout/src/main/java/com/zhy/autolayout/attr/MinHeightAttr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.zhy.autolayout.attr; | ||
|
||
import android.view.View; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
/** | ||
* Created by zhy on 15/12/24. | ||
*/ | ||
public class MinHeightAttr extends AutoAttr | ||
{ | ||
public MinHeightAttr(int pxVal, int baseWidth, int baseHeight) | ||
{ | ||
super(pxVal, baseWidth, baseHeight); | ||
} | ||
|
||
@Override | ||
protected int attrVal() | ||
{ | ||
return Attrs.MIN_HEIGHT; | ||
} | ||
|
||
@Override | ||
protected boolean defaultBaseWidth() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
protected void execute(View view, int val) | ||
{ | ||
try | ||
{ | ||
Method setMaxWidthMethod = view.getClass().getMethod("setMinHeight", int.class); | ||
setMaxWidthMethod.invoke(view, val); | ||
} catch (Exception ignore) | ||
{ | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
autolayout/src/main/java/com/zhy/autolayout/attr/MinWidthAttr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.zhy.autolayout.attr; | ||
|
||
import android.view.View; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
/** | ||
* Created by zhy on 15/12/24. | ||
*/ | ||
public class MinWidthAttr extends AutoAttr | ||
{ | ||
public MinWidthAttr(int pxVal, int baseWidth, int baseHeight) | ||
{ | ||
super(pxVal, baseWidth, baseHeight); | ||
} | ||
|
||
@Override | ||
protected int attrVal() | ||
{ | ||
return Attrs.MIN_WIDTH; | ||
} | ||
|
||
@Override | ||
protected boolean defaultBaseWidth() | ||
{ | ||
return true; | ||
} | ||
|
||
@Override | ||
protected void execute(View view, int val) | ||
{ | ||
try | ||
{ | ||
Method setMaxWidthMethod = view.getClass().getMethod("setMinWidth", int.class); | ||
setMaxWidthMethod.invoke(view, val); | ||
} catch (Exception ignore) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters