summaryrefslogtreecommitdiff
path: root/library/main/src/com/android/setupwizardlib/util
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2016-11-23 11:37:38 -0800
committerMaurice Lam <yukl@google.com>2016-12-12 19:15:44 +0000
commit63cdc5ccb7f1f61d0e752e38d7e57c690658a0ac (patch)
tree34230542c2c90044ed27a92d804db8699b00b49e /library/main/src/com/android/setupwizardlib/util
parente57bdc10c8e4a348c1410234e45346cf31215a34 (diff)
downloadsetupwizard-63cdc5ccb7f1f61d0e752e38d7e57c690658a0ac.tar.gz
[SuwLib] Turn on fatal lint
Fix (or suppress) lint warnings and make it fatal again in the build process. Additionally, warnings are treated as errors now. If there are warnings that are not applicable, add @SuppressLint or tools:ignore to suppress the warning, so code reviewers can be aware of the lint issue too. Test: ./gradlew lint Change-Id: I63c83ff1b95a0817dc2ac777adce0fa9f9ebd45a
Diffstat (limited to 'library/main/src/com/android/setupwizardlib/util')
-rw-r--r--library/main/src/com/android/setupwizardlib/util/DrawableLayoutDirectionHelper.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/main/src/com/android/setupwizardlib/util/DrawableLayoutDirectionHelper.java b/library/main/src/com/android/setupwizardlib/util/DrawableLayoutDirectionHelper.java
index bf4c0c2..b0afaba 100644
--- a/library/main/src/com/android/setupwizardlib/util/DrawableLayoutDirectionHelper.java
+++ b/library/main/src/com/android/setupwizardlib/util/DrawableLayoutDirectionHelper.java
@@ -16,6 +16,7 @@
package com.android.setupwizardlib.util;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
@@ -31,6 +32,7 @@ public class DrawableLayoutDirectionHelper {
* Creates an {@link android.graphics.drawable.InsetDrawable} according to the layout direction
* of {@code view}.
*/
+ @SuppressLint("InlinedApi") // Use of View.LAYOUT_DIRECTION_RTL is guarded by version check
public static InsetDrawable createRelativeInsetDrawable(Drawable drawable,
int insetStart, int insetTop, int insetEnd, int insetBottom, View view) {
boolean isRtl = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1
@@ -43,6 +45,7 @@ public class DrawableLayoutDirectionHelper {
* Creates an {@link android.graphics.drawable.InsetDrawable} according to the layout direction
* of {@code context}.
*/
+ @SuppressLint("InlinedApi") // Use of View.LAYOUT_DIRECTION_RTL is guarded by version check
public static InsetDrawable createRelativeInsetDrawable(Drawable drawable,
int insetStart, int insetTop, int insetEnd, int insetBottom, Context context) {
boolean isRtl = false;
@@ -59,9 +62,10 @@ public class DrawableLayoutDirectionHelper {
* Creates an {@link android.graphics.drawable.InsetDrawable} according to
* {@code layoutDirection}.
*/
+ @SuppressLint("InlinedApi") // Given layoutDirection will not be View.LAYOUT_DIRECTION_RTL if
+ // SDK version doesn't support it.
public static InsetDrawable createRelativeInsetDrawable(Drawable drawable,
int insetStart, int insetTop, int insetEnd, int insetBottom, int layoutDirection) {
- //noinspection AndroidLintInlinedApi
return createRelativeInsetDrawable(drawable, insetStart, insetTop, insetEnd, insetBottom,
layoutDirection == View.LAYOUT_DIRECTION_RTL);
}