diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index 2d85c23e6d..8c670ff8dc 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -111,24 +111,24 @@ public class MapInfoLayer extends OsmandMapLayer { } int i = 0; for(MapInfoControl m : rightStack.getAllViews()){ - m.setBackgroundDrawable(view.getResources().getDrawable(i == 0 ? boxTopR : boxTop).mutate()); + m.setBackgroundDrawable(view.getResources().getDrawable(i == 0 ? boxTopR : boxTop)); i++; } - rightStack.setExpandImageDrawable(view.getResources().getDrawable(expand).mutate()); + rightStack.setExpandImageDrawable(view.getResources().getDrawable(expand)); i = 0; for(MapInfoControl m : leftStack.getAllViews()){ - m.setBackgroundDrawable(view.getResources().getDrawable(i < 2 ? boxTopL : boxTop).mutate()); + m.setBackgroundDrawable(view.getResources().getDrawable(i < 2 ? boxTopL : boxTop)); i++; } - leftStack.setExpandImageDrawable(view.getResources().getDrawable(expand).mutate()); - statusBar.setBackgroundDrawable(view.getResources().getDrawable(boxTop).mutate()); + leftStack.setExpandImageDrawable(view.getResources().getDrawable(expand)); + statusBar.setBackgroundDrawable(view.getResources().getDrawable(boxTop)); showAltitude = view.getSettings().SHOW_ALTITUDE_INFO.get(); } public void createTopBarElements() { // 1. Create view groups and controls statusBar = createStatusBar(); - statusBar.setBackgroundDrawable(view.getResources().getDrawable(R.drawable.box_top).mutate()); + statusBar.setBackgroundDrawable(view.getResources().getDrawable(R.drawable.box_top)); rightStack = new MapStackControl(view.getContext()); rightStack.addStackView(createDistanceControl()); @@ -218,7 +218,7 @@ public class MapInfoLayer extends OsmandMapLayer { } private TextInfoControl createSpeedControl(){ - final TextInfoControl speedControl = new TextInfoControl(map, 0, paintText, paintSubText) { + final TextInfoControl speedControl = new TextInfoControl(map, 3, paintText, paintSubText) { private float cachedSpeed = 0; @Override diff --git a/OsmAnd/src/net/osmand/plus/views/MapStackControl.java b/OsmAnd/src/net/osmand/plus/views/MapStackControl.java index 1db5da0e09..667fd034da 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapStackControl.java +++ b/OsmAnd/src/net/osmand/plus/views/MapStackControl.java @@ -28,7 +28,6 @@ public class MapStackControl extends ViewGroup { final Bitmap arrowUp = BitmapFactory.decodeResource(context.getResources(), R.drawable.arrow_up); final Paint paintImg = new Paint(); paintImg.setAntiAlias(true); - setChildrenDrawingOrderEnabled(true); expandView = new ImageView(context) { @Override protected void onDraw(Canvas canvas) { @@ -43,7 +42,7 @@ public class MapStackControl extends ViewGroup { } } }; - expandView.setImageDrawable(context.getResources().getDrawable(R.drawable.box_expand).mutate()); + expandView.setImageDrawable(context.getResources().getDrawable(R.drawable.box_expand)); expandView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -70,23 +69,14 @@ public class MapStackControl extends ViewGroup { } - @Override - protected int getChildDrawingOrder(int childCount, int i) { - // start from expand view - if (i == 0) { - return 0; - } - return childCount - i; - } - public void addStackView(MapInfoControl v) { stackViews.add(v); - MapStackControl.this.addView(v); + MapStackControl.this.addView(v, 1); } public void addCollapsedView(MapInfoControl v) { collapsedViews.add(v); - MapStackControl.this.addView(v); + MapStackControl.this.addView(v, 1); } public List getStackViews() {