diff options
author | mpimenov <mpimenov@users.noreply.github.com> | 2017-01-13 11:38:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-13 11:38:48 +0300 |
commit | 356c030246a00fa5ca3ef1859bf034e786101e86 (patch) | |
tree | 29c076f64462862bac4f8fe7377da2c72da398fb | |
parent | c3b92cec04b4d642cac515269f15db2826660160 (diff) | |
parent | 1bf3ee00141501a4832121b74da818e0d87eaf50 (diff) |
Merge pull request #5174 from goblinr/MAPSME-102-ext-fix-crash-on-old-devicesbeta-569
[android] Fix crash on pre lollipop devices.
4 files changed, 43 insertions, 18 deletions
diff --git a/android/src/com/mapswithme/maps/search/HotelsFilterView.java b/android/src/com/mapswithme/maps/search/HotelsFilterView.java index 4520484ee6..b3e7ae849b 100644 --- a/android/src/com/mapswithme/maps/search/HotelsFilterView.java +++ b/android/src/com/mapswithme/maps/search/HotelsFilterView.java @@ -36,23 +36,29 @@ public class HotelsFilterView extends FrameLayout public HotelsFilterView(Context context) { - this(context, null, 0, 0); + this(context, null, 0); } public HotelsFilterView(Context context, AttributeSet attrs) { - this(context, attrs, 0, 0); + this(context, attrs, 0); } public HotelsFilterView(Context context, AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); + super(context, attrs, defStyleAttr); + init(context); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public HotelsFilterView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); + init(context); + } + + private void init(Context context) + { LayoutInflater.from(context).inflate(R.layout.hotels_filter, this, true); } diff --git a/android/src/com/mapswithme/maps/search/PriceFilterView.java b/android/src/com/mapswithme/maps/search/PriceFilterView.java index 1f903a2264..16a55cceaa 100644 --- a/android/src/com/mapswithme/maps/search/PriceFilterView.java +++ b/android/src/com/mapswithme/maps/search/PriceFilterView.java @@ -84,23 +84,29 @@ public class PriceFilterView extends LinearLayout implements View.OnClickListene public PriceFilterView(Context context) { - this(context, null, 0, 0); + this(context, null, 0); } public PriceFilterView(Context context, AttributeSet attrs) { - this(context, attrs, 0, 0); + this(context, attrs, 0); } public PriceFilterView(Context context, AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); + super(context, attrs, defStyleAttr); + init(context); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public PriceFilterView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); + init(context); + } + + private void init(Context context) + { setOrientation(HORIZONTAL); LayoutInflater.from(context).inflate(R.layout.price_filter, this, true); } diff --git a/android/src/com/mapswithme/maps/search/RatingFilterView.java b/android/src/com/mapswithme/maps/search/RatingFilterView.java index e5d4a671de..c70ec9a802 100644 --- a/android/src/com/mapswithme/maps/search/RatingFilterView.java +++ b/android/src/com/mapswithme/maps/search/RatingFilterView.java @@ -73,23 +73,29 @@ public class RatingFilterView extends LinearLayout implements View.OnClickListen public RatingFilterView(Context context) { - this(context, null, 0, 0); + this(context, null, 0); } public RatingFilterView(Context context, AttributeSet attrs) { - this(context, attrs, 0, 0); + this(context, attrs, 0); } public RatingFilterView(Context context, AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); + super(context, attrs, defStyleAttr); + init(context); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public RatingFilterView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); + init(context); + } + + private void init(Context context) + { setOrientation(HORIZONTAL); LayoutInflater.from(context).inflate(R.layout.rating_filter, this, true); } diff --git a/android/src/com/mapswithme/maps/widget/PlaceholderView.java b/android/src/com/mapswithme/maps/widget/PlaceholderView.java index 7cc9b7c666..d90c220402 100644 --- a/android/src/com/mapswithme/maps/widget/PlaceholderView.java +++ b/android/src/com/mapswithme/maps/widget/PlaceholderView.java @@ -30,28 +30,30 @@ public class PlaceholderView extends FrameLayout @Nullable private TextView mSubtitle; - private final float mImageSizeFull; - private final float mImageSizeSmall; - private final float mPaddingImage; - private final float mPaddingNoImage; - private final float mScreenHeight; - private final float mScreenWidth; + private float mImageSizeFull; + private float mImageSizeSmall; + private float mPaddingImage; + private float mPaddingNoImage; + private float mScreenHeight; + private float mScreenWidth; private int mOrientation; public PlaceholderView(Context context) { - this(context, null, 0, 0); + this(context, null, 0); } public PlaceholderView(Context context, @Nullable AttributeSet attrs) { - this(context, attrs, 0, 0); + this(context, attrs, 0); } public PlaceholderView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); + super(context, attrs, defStyleAttr); + + init(context); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) @@ -60,6 +62,11 @@ public class PlaceholderView extends FrameLayout { super(context, attrs, defStyleAttr, defStyleRes); + init(context); + } + + private void init(Context context) + { Resources res = getResources(); mImageSizeFull = res.getDimension(R.dimen.placeholder_size); mImageSizeSmall = res.getDimension(R.dimen.placeholder_size_small); |