forked from organicmaps/organicmaps
[android] Fix crash on pre lollipop devices.
This commit is contained in:
parent
15c4bc0d52
commit
804739dc52
4 changed files with 44 additions and 12 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -41,17 +41,26 @@ public class PlaceholderView extends FrameLayout
|
|||
|
||||
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);
|
||||
|
||||
Resources res = getResources();
|
||||
mImageSizeFull = res.getDimension(R.dimen.placeholder_size);
|
||||
mImageSizeSmall = res.getDimension(R.dimen.placeholder_size_small);
|
||||
mPaddingImage = res.getDimension(R.dimen.placeholder_margin_top);
|
||||
mPaddingNoImage = res.getDimension(R.dimen.placeholder_margin_top_no_image);
|
||||
mScreenHeight = res.getDisplayMetrics().heightPixels;
|
||||
mScreenWidth = res.getDisplayMetrics().widthPixels;
|
||||
init(context);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
|
@ -67,6 +76,11 @@ public class PlaceholderView extends FrameLayout
|
|||
mPaddingNoImage = res.getDimension(R.dimen.placeholder_margin_top_no_image);
|
||||
mScreenHeight = res.getDisplayMetrics().heightPixels;
|
||||
mScreenWidth = res.getDisplayMetrics().widthPixels;
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init(Context context)
|
||||
{
|
||||
LayoutInflater.from(context).inflate(R.layout.placeholder, this, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue