You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Take from maven repository (<http://search.maven.org/#search%7Cga%7C1%7Corg.apmem.tools>, <http://mvnrepository.com/search.html?query=org.apmem.tools>) or add FlowLayout and other components to your solution
26
34
35
+
Add it as dependency in Gradle as:
36
+
37
+
compile 'org.apmem.tools:layouts:1.8@aar'
38
+
39
+
Or maven
40
+
41
+
<dependency>
42
+
<groupId>org.apmem.tools</groupId>
43
+
<artifactId>layouts</artifactId>
44
+
<version>1.8</version>
45
+
<scope>provided</scope>
46
+
</dependency>
47
+
27
48
Add the following xml code into your layout/something.xml:
28
49
29
50
<org.apmem.tools.layouts.FlowLayout
@@ -33,20 +54,24 @@ Add the following xml code into your layout/something.xml:
33
54
>
34
55
</org.apmem.tools.layouts.FlowLayout>
35
56
36
-
To change default horizontal and vertical spacing between elements in layout use the following code:
Android gravity now supported (in combination with elements weight):
47
67
48
-
f:layout_horizontalSpacing="32dip"
49
-
f:layout_verticalSpacing="32dip"
68
+
f:weightDefault="1.0"
69
+
android:gravity="fill"
70
+
71
+
To override default spacing between elements use default android margins in the child View element:
72
+
73
+
android:layout_marginTop="32dip"
74
+
android:layout_marginRight="32dip"
50
75
51
76
Also if you need to break line before some object even if there is enough space for it in the previous line - use the following LayoutParameter in the child view element:
52
77
@@ -56,23 +81,31 @@ Also if you need to break line before some object even if there is enough space
56
81
57
82
Layout parameters:
58
83
59
-
* horizontalSpacing - default horizontal spacing between elements
84
+
* android:orientation - line direction. Use one of the following values:
85
+
86
+
* horizontal - line will be in horizontal direction, linebreak will create new line
87
+
88
+
* vertical - line will be in vertical direction, linebreak will create new column
60
89
61
-
* verticalSpacing - default vertical spacing between elements
90
+
* android:gravity - standart android gravity supported
62
91
63
92
* debugDraw - draw debug information
64
93
65
-
* orientation - line direction. Use one of the following values:
94
+
* weightDefault - default weight value for child elements. Used to fill line in case of Gravity.FILL_HORIZONTAL | Gravity.FILL_VERTICAL
66
95
67
-
* horizontal - line will be in horizontal direction, linebreak will create new line
96
+
* layoutDirection - direction of inner child elements:
68
97
69
-
* vertical - line will be in vertical direction, linebreak will create new column
0 commit comments