summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java
diff options
context:
space:
mode:
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.java20
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();