Skip to content

Commit cd33f36

Browse files
committed
Fixing lint checks
1 parent f3516c8 commit cd33f36

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

Diff for: FlowLayout/src/main/java/com/wefika/flowlayout/FlowLayout.java

+17-13
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public class FlowLayout extends ViewGroup {
3535

3636
private int mGravity = Gravity.START | Gravity.TOP;
3737

38+
List<List<View>> mLines = new ArrayList<List<View>>();
39+
List<Integer> mLineHeights = new ArrayList<Integer>();
40+
List<Integer> mLineMargins = new ArrayList<Integer>();
41+
3842
public FlowLayout(Context context) {
3943
super(context);
4044
}
@@ -60,9 +64,9 @@ public FlowLayout(Context context, AttributeSet attrs, int defStyle) {
6064
@Override
6165
protected void onLayout(boolean changed, int l, int t, int r, int b) {
6266

63-
List<List<View>> lines = new ArrayList<List<View>>();
64-
List<Integer> lineHeights = new ArrayList<Integer>();
65-
List<Integer> lineMargins = new ArrayList<Integer>();
67+
mLines.clear();
68+
mLineHeights.clear();
69+
mLineMargins.clear();
6670

6771
int width = getWidth();
6872
int height = getHeight();
@@ -100,9 +104,9 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
100104
int childHeight = child.getMeasuredHeight() + lp.bottomMargin + lp.topMargin;
101105

102106
if(lineWidth + childWidth > width) {
103-
lineHeights.add(lineHeight);
104-
lines.add(lineViews);
105-
lineMargins.add((int) ((width - lineWidth) * horizontalGravityFactor));
107+
mLineHeights.add(lineHeight);
108+
mLines.add(lineViews);
109+
mLineMargins.add((int) ((width - lineWidth) * horizontalGravityFactor));
106110

107111
linesSum += lineHeight;
108112

@@ -116,9 +120,9 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
116120
lineViews.add(child);
117121
}
118122

119-
lineHeights.add(lineHeight);
120-
lines.add(lineViews);
121-
lineMargins.add((int) ((width - lineWidth) * horizontalGravityFactor));
123+
mLineHeights.add(lineHeight);
124+
mLines.add(lineViews);
125+
mLineMargins.add((int) ((width - lineWidth) * horizontalGravityFactor));
122126

123127
linesSum += lineHeight;
124128

@@ -135,16 +139,16 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
135139
break;
136140
}
137141

138-
int numLines = lineHeights.size();
142+
int numLines = mLines.size();
139143

140144
int left;
141145
int top = 0;
142146

143147
for(int i = 0; i < numLines; i++) {
144148

145-
lineHeight = lineHeights.get(i);
146-
lineViews = lines.get(i);
147-
left = lineMargins.get(i);
149+
lineHeight = mLineHeights.get(i);
150+
lineViews = mLines.get(i);
151+
left = mLineMargins.get(i);
148152

149153
int children = lineViews.size();
150154

Diff for: FlowLayoutExample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ android {
3434
}
3535

3636
dependencies {
37-
compile "com.wefika:flowlayout:0.3.0-SNAPSHOT"
37+
compile "com.wefika:flowlayout:0.3.1-SNAPSHOT"
3838
}

Diff for: gradlew

100644100755
File mode changed.

0 commit comments

Comments
 (0)