Skip to content

Commit 1bdf23c

Browse files
author
Eric Leong
committed
Add linting.
1 parent 30c4982 commit 1bdf23c

File tree

15 files changed

+126
-127
lines changed

15 files changed

+126
-127
lines changed

backboard-example/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ android {
1010
versionCode 1
1111
versionName "1.0"
1212
}
13+
14+
lintOptions {
15+
disable 'AllowBackup', 'GoogleAppIndexingWarning'
16+
}
17+
1318
buildTypes {
1419
release {
1520
minifyEnabled false

backboard-example/src/main/java/com/tumblr/backboard/example/BloomFragment.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
3939
float diameter = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, DIAMETER,
4040
getResources().getDisplayMetrics());
4141

42-
TypedArray circles = getResources().obtainTypedArray(R.array.circles);
42+
final TypedArray circles = getResources().obtainTypedArray(R.array.circles);
4343

4444
// layout params
4545
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((int) diameter,
@@ -64,6 +64,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
6464
mRootView.addView(mCircles[i]);
6565
}
6666

67+
circles.recycle();
68+
6769
/* Animations! */
6870

6971
final SpringSystem springSystem = SpringSystem.create();

backboard-example/src/main/java/com/tumblr/backboard/example/ConstrainedFragment.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.tumblr.backboard.example;
22

33
import android.app.Fragment;
4+
import android.os.Build;
45
import android.os.Bundle;
56
import android.view.LayoutInflater;
67
import android.view.View;
@@ -53,7 +54,11 @@ public void onGlobalLayout() {
5354
-constraintView.getMeasuredHeight() / 2 + circle.getMeasuredWidth() / 2);
5455
motionImitatorY.setMaxValue(
5556
constraintView.getMeasuredHeight() / 2 - circle.getMeasuredWidth() / 2);
56-
rootView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
57+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
58+
rootView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
59+
} else {
60+
rootView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
61+
}
5762
}
5863
});
5964

backboard-example/src/main/java/com/tumblr/backboard/example/ExplosionFragment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.tumblr.backboard.example;
22

3+
import android.annotation.SuppressLint;
34
import android.app.Fragment;
45
import android.content.Context;
56
import android.content.res.TypedArray;
@@ -191,6 +192,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
191192

192193
mRootView.setOnTouchListener(new View.OnTouchListener() {
193194
@Override
195+
@SuppressLint("ClickableViewAccessibility")
194196
public boolean onTouch(View v, MotionEvent event) {
195197
switch (event.getAction()) {
196198
case MotionEvent.ACTION_DOWN:

backboard-example/src/main/java/com/tumblr/backboard/example/ScaleFragment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.tumblr.backboard.example;
22

3+
import android.annotation.SuppressLint;
34
import android.app.Fragment;
45
import android.os.Bundle;
56
import android.view.LayoutInflater;
@@ -38,6 +39,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
3839

3940
rootView.setOnTouchListener(new View.OnTouchListener() {
4041
@Override
42+
@SuppressLint("ClickableViewAccessibility")
4143
public boolean onTouch(View v, MotionEvent event) {
4244
switch (event.getAction()) {
4345
case MotionEvent.ACTION_DOWN:

backboard-example/src/main/java/com/tumblr/backboard/example/ZoomFragment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.tumblr.backboard.example;
22

3+
import android.annotation.SuppressLint;
34
import android.app.Fragment;
45
import android.os.Bundle;
56
import android.view.*;
@@ -52,6 +53,7 @@ public void onScaleEnd(ScaleGestureDetector detector) {
5253

5354
rootView.setOnTouchListener(new View.OnTouchListener() {
5455
@Override
56+
@SuppressLint("ClickableViewAccessibility")
5557
public boolean onTouch(View v, MotionEvent event) {
5658
return scaleGestureDetector.onTouchEvent(event);
5759
}
Lines changed: 97 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,105 @@
1-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
3-
android:clipChildren="false"
4-
android:clipToPadding="false"
5-
android:layout_width="match_parent"
6-
android:layout_height="match_parent">
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="wrap_content"
5+
android:clipChildren="false"
6+
android:clipToPadding="false"
7+
android:orientation="vertical"
8+
android:layout_gravity="center">
79

810
<LinearLayout
11+
android:clipChildren="false"
12+
android:clipToPadding="false"
13+
android:orientation="horizontal"
914
android:layout_width="match_parent"
10-
android:layout_height="wrap_content"
15+
android:layout_height="wrap_content">
16+
17+
<Space
18+
android:layout_weight="1"
19+
android:layout_width="wrap_content"
20+
android:layout_height="match_parent"/>
21+
22+
<View
23+
android:id="@+id/circle0"
24+
android:background="@drawable/circle_green"
25+
android:layout_width="100dp"
26+
android:layout_height="100dp" />
27+
28+
<Space
29+
android:layout_weight="1"
30+
android:layout_width="wrap_content"
31+
android:layout_height="match_parent"/>
32+
33+
<View
34+
android:id="@+id/circle1"
35+
android:background="@drawable/circle_blue"
36+
android:layout_width="100dp"
37+
android:layout_height="100dp" />
38+
39+
<Space
40+
android:layout_weight="1"
41+
android:layout_width="wrap_content"
42+
android:layout_height="match_parent"/>
43+
44+
<View
45+
android:id="@+id/circle2"
46+
android:background="@drawable/circle_red"
47+
android:layout_width="100dp"
48+
android:layout_height="100dp" />
49+
50+
<Space
51+
android:layout_weight="1"
52+
android:layout_width="wrap_content"
53+
android:layout_height="match_parent"/>
54+
55+
</LinearLayout>
56+
57+
<LinearLayout
58+
android:orientation="horizontal"
1159
android:clipChildren="false"
1260
android:clipToPadding="false"
13-
android:orientation="vertical"
14-
android:layout_centerInParent="true">
15-
16-
<LinearLayout
17-
android:clipChildren="false"
18-
android:clipToPadding="false"
19-
android:orientation="horizontal"
20-
android:layout_width="match_parent"
21-
android:layout_height="wrap_content">
22-
23-
<Space
24-
android:layout_weight="1"
25-
android:layout_width="wrap_content"
26-
android:layout_height="match_parent"/>
27-
28-
<View
29-
android:id="@+id/circle0"
30-
android:background="@drawable/circle_green"
31-
android:layout_width="100dp"
32-
android:layout_height="100dp" />
33-
34-
<Space
35-
android:layout_weight="1"
36-
android:layout_width="wrap_content"
37-
android:layout_height="match_parent"/>
38-
39-
<View
40-
android:id="@+id/circle1"
41-
android:background="@drawable/circle_blue"
42-
android:layout_width="100dp"
43-
android:layout_height="100dp" />
44-
45-
<Space
46-
android:layout_weight="1"
47-
android:layout_width="wrap_content"
48-
android:layout_height="match_parent"/>
49-
50-
<View
51-
android:id="@+id/circle2"
52-
android:background="@drawable/circle_red"
53-
android:layout_width="100dp"
54-
android:layout_height="100dp" />
55-
56-
<Space
57-
android:layout_weight="1"
58-
android:layout_width="wrap_content"
59-
android:layout_height="match_parent"/>
60-
61-
</LinearLayout>
62-
63-
<LinearLayout
64-
android:orientation="horizontal"
65-
android:clipChildren="false"
66-
android:clipToPadding="false"
67-
android:layout_marginTop="25dp"
68-
android:layout_width="match_parent"
69-
android:layout_height="wrap_content">
70-
71-
<Space
72-
android:layout_weight="1"
73-
android:layout_width="wrap_content"
74-
android:layout_height="match_parent"/>
75-
76-
<View
77-
android:id="@+id/circle3"
78-
android:background="@drawable/circle_orange"
79-
android:layout_width="100dp"
80-
android:layout_height="100dp" />
81-
82-
<Space
83-
android:layout_weight="1"
84-
android:layout_width="wrap_content"
85-
android:layout_height="match_parent"/>
86-
87-
<View
88-
android:id="@+id/circle4"
89-
android:background="@drawable/circle_purple"
90-
android:layout_width="100dp"
91-
android:layout_height="100dp" />
92-
93-
<Space
94-
android:layout_weight="1"
95-
android:layout_width="wrap_content"
96-
android:layout_height="match_parent"/>
97-
98-
<View
99-
android:id="@+id/circle5"
100-
android:background="@drawable/circle_gray"
101-
android:layout_width="100dp"
102-
android:layout_height="100dp" />
103-
104-
<Space
105-
android:layout_weight="1"
106-
android:layout_width="wrap_content"
107-
android:layout_height="match_parent"/>
108-
109-
</LinearLayout>
61+
android:layout_marginTop="25dp"
62+
android:layout_width="match_parent"
63+
android:layout_height="wrap_content">
64+
65+
<Space
66+
android:layout_weight="1"
67+
android:layout_width="wrap_content"
68+
android:layout_height="match_parent"/>
69+
70+
<View
71+
android:id="@+id/circle3"
72+
android:background="@drawable/circle_orange"
73+
android:layout_width="100dp"
74+
android:layout_height="100dp" />
75+
76+
<Space
77+
android:layout_weight="1"
78+
android:layout_width="wrap_content"
79+
android:layout_height="match_parent"/>
80+
81+
<View
82+
android:id="@+id/circle4"
83+
android:background="@drawable/circle_purple"
84+
android:layout_width="100dp"
85+
android:layout_height="100dp" />
86+
87+
<Space
88+
android:layout_weight="1"
89+
android:layout_width="wrap_content"
90+
android:layout_height="match_parent"/>
91+
92+
<View
93+
android:id="@+id/circle5"
94+
android:background="@drawable/circle_gray"
95+
android:layout_width="100dp"
96+
android:layout_height="100dp" />
97+
98+
<Space
99+
android:layout_weight="1"
100+
android:layout_width="wrap_content"
101+
android:layout_height="match_parent"/>
110102

111103
</LinearLayout>
112104

113-
</RelativeLayout>
105+
</LinearLayout>

backboard-example/src/main/res/layout/fragment_constrain.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:tools="http://schemas.android.com/tools"
33
android:background="@color/debug_red"
4+
tools:ignore="Overdraw"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent">
67

backboard-example/src/main/res/layout/fragment_snap.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
android:background="@drawable/circle_green"
99
android:layout_alignParentBottom="true"
1010
android:layout_alignParentLeft="true"
11+
android:layout_alignParentStart="true"
1112
android:layout_width="100dp"
1213
android:layout_height="100dp" />
1314

backboard-example/src/main/res/values-w820dp/dimens.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)