Created
September 28, 2016 08:27
-
-
Save maydin/c9669de0cd402c7d9c2dce4fe7fb15d8 to your computer and use it in GitHub Desktop.
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
public void More setFactory(ViewFactory factory) { | |
mFactory = factory; | |
obtainView(); | |
obtainView(); | |
} | |
private View obtainView() { | |
View child = mFactory.makeView(); | |
LayoutParams lp = (LayoutParams) child.getLayoutParams(); | |
if (lp == null) { | |
lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); | |
} | |
addView(child, lp); | |
return child; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment