diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-12-11 12:39:43 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-12-16 14:52:29 -0800 |
commit | 13d5b18ebaeb330f05c4abfc04e0247222e038ba (patch) | |
tree | 90e24f1fb745581767b6979d1c562e60859cbcf6 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindowView.java | |
parent | 0db9f229f2bb14e2c6ccd3a8c0d0a30eb25ea5c5 (diff) | |
download | qtlocation-mapboxgl-13d5b18ebaeb330f05c4abfc04e0247222e038ba.tar.gz |
[android] Move into platform subdirectory
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindowView.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindowView.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindowView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindowView.java new file mode 100644 index 0000000000..80dc5931a7 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindowView.java @@ -0,0 +1,38 @@ +package com.mapbox.mapboxsdk.annotations; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.widget.RelativeLayout; + +import com.mapbox.mapboxsdk.R; + +class InfoWindowView extends RelativeLayout { + + private InfoWindowTipView mTipView; + + public InfoWindowView(Context context) { + this(context, null); + } + + public InfoWindowView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public InfoWindowView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + initialize(context); + } + + private void initialize(Context context) { + LayoutInflater.from(context).inflate(R.layout.infowindow_content, this); + mTipView = (InfoWindowTipView) findViewById(R.id.infowindow_tipview); + } + + void setTipViewMarginLeft(int marginLeft) { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mTipView.getLayoutParams(); + layoutParams.leftMargin = marginLeft; + // This is a bit of a hack but prevents an occasional gap between the InfoWindow + layoutParams.topMargin = (int) getResources().getDimension(R.dimen.infowindow_offset); + } +} |