diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-10-10 10:36:46 +0200 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-10-12 18:40:29 +0200 |
commit | 617742710852a5a958a13f2b659f8c307973e49d (patch) | |
tree | 5dbda0cc3bc6c0eb22eac350fcd954ab7606ea21 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java | |
parent | a436fd233f325ddca571e3c61641588e8166a6b4 (diff) | |
download | qtlocation-mapboxgl-617742710852a5a958a13f2b659f8c307973e49d.tar.gz |
[android] - infer nullity
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java index c58cc310a8..b5bcf188ae 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java @@ -5,6 +5,7 @@ import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.RectF; +import android.support.annotation.NonNull; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.widget.LinearLayout; @@ -17,6 +18,7 @@ import com.mapbox.mapboxsdk.R; public class BubbleLayout extends LinearLayout { public static final float DEFAULT_STROKE_WIDTH = -1; + @NonNull private ArrowDirection arrowDirection; private float arrowWidth; private float arrowHeight; @@ -32,7 +34,7 @@ public class BubbleLayout extends LinearLayout { * * @param context The context used to inflate this bubble layout */ - public BubbleLayout(Context context) { + public BubbleLayout(@NonNull Context context) { this(context, null, 0); } @@ -42,7 +44,7 @@ public class BubbleLayout extends LinearLayout { * @param context The context used to inflate this bubble layout * @param attrs The attribute set to initialise this bubble layout from */ - public BubbleLayout(Context context, AttributeSet attrs) { + public BubbleLayout(@NonNull Context context, AttributeSet attrs) { this(context, attrs, 0); } @@ -53,7 +55,7 @@ public class BubbleLayout extends LinearLayout { * @param attrs The attribute set to initialise this bubble layout from * @param defStyleAttr The default style to apply this bubble layout with */ - public BubbleLayout(Context context, AttributeSet attrs, int defStyleAttr) { + public BubbleLayout(@NonNull Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.mapbox_BubbleLayout); @@ -84,7 +86,7 @@ public class BubbleLayout extends LinearLayout { } @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { if (bubble != null) { bubble.draw(canvas); } @@ -111,7 +113,8 @@ public class BubbleLayout extends LinearLayout { * @param arrowDirection The direction of the arrow * @return this */ - public BubbleLayout setArrowDirection(ArrowDirection arrowDirection) { + @NonNull + public BubbleLayout setArrowDirection(@NonNull ArrowDirection arrowDirection) { resetPadding(); this.arrowDirection = arrowDirection; initPadding(); @@ -133,6 +136,7 @@ public class BubbleLayout extends LinearLayout { * @param arrowWidth The width of the arrow * @return this */ + @NonNull public BubbleLayout setArrowWidth(float arrowWidth) { resetPadding(); this.arrowWidth = arrowWidth; @@ -155,6 +159,7 @@ public class BubbleLayout extends LinearLayout { * @param arrowHeight The height of the arrow * @return this */ + @NonNull public BubbleLayout setArrowHeight(float arrowHeight) { resetPadding(); this.arrowHeight = arrowHeight; @@ -177,6 +182,7 @@ public class BubbleLayout extends LinearLayout { * @param arrowPosition The arrow position * @return this */ + @NonNull public BubbleLayout setArrowPosition(float arrowPosition) { resetPadding(); this.arrowPosition = arrowPosition; @@ -199,6 +205,7 @@ public class BubbleLayout extends LinearLayout { * @param cornersRadius The corner radius * @return this */ + @NonNull public BubbleLayout setCornersRadius(float cornersRadius) { this.cornersRadius = cornersRadius; requestLayout(); @@ -220,6 +227,7 @@ public class BubbleLayout extends LinearLayout { * @param bubbleColor The buble color * @return this */ + @NonNull public BubbleLayout setBubbleColor(int bubbleColor) { this.bubbleColor = bubbleColor; requestLayout(); @@ -241,6 +249,7 @@ public class BubbleLayout extends LinearLayout { * @param strokeWidth The stroke width * @return this */ + @NonNull public BubbleLayout setStrokeWidth(float strokeWidth) { resetPadding(); this.strokeWidth = strokeWidth; @@ -263,6 +272,7 @@ public class BubbleLayout extends LinearLayout { * @param strokeColor The stroke color * @return this */ + @NonNull public BubbleLayout setStrokeColor(int strokeColor) { this.strokeColor = strokeColor; requestLayout(); |