Update icons

This commit is contained in:
Victor Shcherb 2015-03-19 00:15:00 +01:00
parent 9745e4d037
commit 1334757f95
29 changed files with 194 additions and 83 deletions

View file

@ -7,9 +7,16 @@
android:src="@drawable/bt_round_1_shadow" />
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/map_widget_blue" />
</shape>
<inset
android:insetBottom="@dimen/map_button_inset_shadow"
android:insetLeft="@dimen/map_button_inset_shadow"
android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" >
<solid android:color="@color/map_widget_blue" />
</shape>
</inset>
</item>
</layer-list>

View file

@ -7,8 +7,15 @@
android:src="@drawable/bt_round_1_shadow" />
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/map_widget_blue_pressed" />
</shape>
<inset
android:insetBottom="@dimen/map_button_inset_shadow"
android:insetLeft="@dimen/map_button_inset_shadow"
android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" >
<solid android:color="@color/map_widget_blue_pressed" />
</shape>
</inset>
</item>
</layer-list>

View file

@ -7,9 +7,16 @@
android:src="@drawable/bt_round_1_shadow" />
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/map_widget_light" />
</shape>
<inset
android:insetBottom="@dimen/map_button_inset_shadow"
android:insetLeft="@dimen/map_button_inset_shadow"
android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" >
<solid android:color="@color/map_widget_light_pressed" />
</shape>
</inset>
</item>
</layer-list>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/btn_circle_p" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_circle_night_p" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_circle_night_n"></item>
</selector>

View file

@ -7,9 +7,15 @@
android:src="@drawable/bt_round_1_shadow" />
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/map_widget_night" />
</shape>
<inset
android:insetBottom="@dimen/map_button_inset_shadow"
android:insetLeft="@dimen/map_button_inset_shadow"
android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" >
<solid android:color="@color/map_widget_dark" />
</shape>
</inset>
</item>
</layer-list>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<bitmap
android:gravity="center"
android:src="@drawable/bt_round_1_shadow" />
</item>
<item>
<inset
android:insetBottom="@dimen/map_button_inset_shadow"
android:insetLeft="@dimen/map_button_inset_shadow"
android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" >
<solid android:color="@color/map_widget_dark_pressed" />
</shape>
</inset>
</item>
</layer-list>

View file

@ -7,8 +7,15 @@
android:src="@drawable/bt_round_1_shadow" />
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/map_widget_light_pressed" />
</shape>
<inset
android:insetBottom="@dimen/map_button_inset_shadow"
android:insetLeft="@dimen/map_button_inset_shadow"
android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" >
<solid android:color="@color/map_widget_light_pressed" />
</shape>
</inset>
</item>
</layer-list>

View file

@ -7,9 +7,16 @@
android:src="@drawable/bt_round_1_shadow" />
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/map_widget_light_trans" />
</shape>
<inset
android:insetBottom="@dimen/map_button_inset_shadow"
android:insetLeft="@dimen/map_button_inset_shadow"
android:insetRight="@dimen/map_button_inset_shadow"
android:insetTop="@dimen/map_button_inset_shadow" >
<shape android:shape="oval" >
<solid android:color="@color/map_widget_light_trans" />
</shape>
</inset>
</item>
</layer-list>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/btn_inset_circle_p" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_inset_circle_night_p" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_inset_circle_night_n"></item>
</selector>

View file

@ -1,10 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<bitmap
android:gravity="center"
android:src="@drawable/bt_round_2_shadow" />
<bitmap android:src="@drawable/bt_round_2_shadow" android:gravity="center" />
</item>
<item>
<inset
@ -13,7 +10,7 @@
android:insetRight="@dimen/map_button_inset"
android:insetTop="@dimen/map_button_inset" >
<shape android:shape="oval" >
<solid android:color="@color/map_widget_light_trans" />
<solid android:color="@color/map_widget_dark_pressed" />
</shape>
</inset>
</item>

View file

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/btn_inset_circle_p" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_inset_circle_trans_n"></item>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/bt_round_2_shadow" />
</item>
</selector>

View file

@ -1,15 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"><shape android:shape="rectangle">
<solid android:color="@color/map_widget_light_pressed" />
<corners android:radius="@dimen/map_button_rect_rad" />
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
</shape></item>
<item><shape android:shape="rectangle">
<solid android:color="@color/map_widget_light" />
<corners android:radius="@dimen/map_button_rect_rad" />
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
</shape></item>
<item android:drawable="@drawable/btn_round_p" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_round_n"/>
</selector>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<nine-patch android:src="@drawable/bg_card_shadow" />
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/map_widget_light" />
<corners android:radius="@dimen/map_button_rect_rad" />
</shape>
</item>
</layer-list>

View file

@ -1,15 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"><shape android:shape="rectangle">
<solid android:color="@color/map_widget_dark_pressed" />
<corners android:radius="@dimen/map_button_rect_rad" />
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
</shape></item>
<item><shape android:shape="rectangle">
<solid android:color="@color/map_widget_dark" />
<corners android:radius="@dimen/map_button_rect_rad" />
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
</shape></item>
<item android:state_pressed="true" android:drawable="@drawable/btn_round_night_p"/>
<item android:drawable="@drawable/btn_round_night_n"/>
</selector>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<nine-patch android:src="@drawable/bg_card_shadow" />
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/map_widget_dark" />
<corners android:radius="@dimen/map_button_rect_rad" />
</shape>
</item>
</layer-list>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<nine-patch android:src="@drawable/bg_card_shadow" />
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/map_widget_dark_pressed" />
<corners android:radius="@dimen/map_button_rect_rad" />
</shape>
</item>
</layer-list>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<nine-patch android:src="@drawable/bg_card_shadow" />
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/map_widget_light_pressed" />
<corners android:radius="@dimen/map_button_rect_rad" />
</shape>
</item>
</layer-list>

View file

@ -1,15 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"><shape android:shape="rectangle">
<solid android:color="@color/map_widget_light_pressed" />
<corners android:radius="@dimen/map_button_rect_rad" />
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
</shape></item>
<item><shape android:shape="rectangle">
<solid android:color="@color/map_widget_light_trans" />
<corners android:radius="@dimen/map_button_rect_rad" />
<stroke android:width="@dimen/map_button_stroke" android:color="@color/map_widget_stroke" />
</shape></item>
<item android:state_pressed="true" android:drawable="@drawable/btn_round_trans_p"/>
<item android:drawable="@drawable/btn_round_trans_n"/>
</selector>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<nine-patch android:src="@drawable/bg_card_shadow" />
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/map_widget_light_trans" />
<corners android:radius="@dimen/map_button_rect_rad" />
</shape>
</item>
</layer-list>

View file

@ -17,6 +17,7 @@
<color name="list_item_background_dark">#333b40</color>
<color name="list_item_background_dark_pressed">#be39464d</color>
<color name="map_widget_icon_color">#ff8f00</color>
<color name="map_widget_stroke">#333333</color>
<color name="map_widget_light">#ffffff</color>
<color name="map_widget_dark">#bb3f3f3f</color>

View file

@ -59,7 +59,7 @@
<dimen name="map_route_buttons_height_land">48dp</dimen>
<dimen name="map_address_height">40dp</dimen>
<dimen name="map_button_size">48dp</dimen>
<dimen name="map_button_size">50dp</dimen>
<dimen name="map_ruler_width">120dp</dimen>
<dimen name="map_ruler_bottom_margin">7dp</dimen>
<dimen name="map_button_shadow_width">52dp</dimen>
@ -72,12 +72,13 @@
<dimen name="map_widget_icon">24dp</dimen>
<dimen name="map_widget_height">32dp</dimen>
<dimen name="map_widget_image">80dp</dimen>
<dimen name="map_button_spacing">15dp</dimen>
<dimen name="map_button_spacing_land">10dp</dimen>
<dimen name="map_button_spacing">13dp</dimen>
<dimen name="map_button_spacing_land">8dp</dimen>
<dimen name="map_button_margin">4dp</dimen>
<dimen name="map_routing_progress_width">100dp</dimen>
<dimen name="map_button_shadow_margin">2dp</dimen>
<dimen name="map_button_inset_shadow">2dp</dimen>
<dimen name="map_button_inset">4dp</dimen>
<dimen name="map_button_rect_rad">3dp</dimen>
<dimen name="map_button_stroke">1px</dimen>

View file

@ -541,11 +541,11 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
private void updateWidgetIcon(final TextInfoWidget recordPlaceControl) {
recordPlaceControl.setImageDrawable(activity.getResources().getDrawable(R.drawable.widget_icon_av_inactive));
if (AV_DEFAULT_ACTION.get() == AV_DEFAULT_ACTION_VIDEO) {
recordPlaceControl.setImageDrawable(activity.getResources().getDrawable(R.drawable.widget_icon_video));
recordPlaceControl.setImageDrawable(R.drawable.widget_icon_video);
} else if (AV_DEFAULT_ACTION.get() == AV_DEFAULT_ACTION_TAKEPICTURE) {
recordPlaceControl.setImageDrawable(activity.getResources().getDrawable(R.drawable.widget_icon_photo));
recordPlaceControl.setImageDrawable(R.drawable.widget_icon_photo);
} else if (AV_DEFAULT_ACTION.get() == AV_DEFAULT_ACTION_AUDIO) {
recordPlaceControl.setImageDrawable(activity.getResources().getDrawable(R.drawable.widget_icon_audio));
recordPlaceControl.setImageDrawable(R.drawable.widget_icon_audio);
}
}

View file

@ -377,7 +377,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
showDialog(activity);
}
});
distanceControl.setImageDrawable(app.getResources().getDrawable(R.drawable.widget_distance));
distanceControl.setImageDrawable(R.drawable.widget_distance);
return distanceControl;
}

View file

@ -506,7 +506,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
}
});
parkingPlaceControl.setText(null, null);
parkingPlaceControl.setImageDrawable(map.getResources().getDrawable(R.drawable.widget_parking));
parkingPlaceControl.setImageDrawable(R.drawable.widget_parking);
return parkingPlaceControl;
}

View file

@ -270,7 +270,7 @@ public class RoutePointsPlugin extends OsmandPlugin {
}
});
routeStepsControl.setText(null, null);
routeStepsControl.setImageDrawable(map.getResources().getDrawable(R.drawable.widget_signpost));
routeStepsControl.setImageDrawable(R.drawable.widget_signpost);
return routeStepsControl;
}

View file

@ -218,12 +218,12 @@ public class MapInfoLayer extends OsmandMapLayer {
if (!transparent && !nightMode) {
ts.textShadowColor = Color.TRANSPARENT;
}
ts.textShadowRadius = ts.textShadowColor == 0 ? 0 : 8;
ts.textShadowRadius = ts.textShadowColor == 0 ? 0 : 15;
if (transparent) {
ts.boxTop = R.drawable.btn_flat_trans;
ts.rightRes = R.drawable.btn_left_round_transparent;
ts.leftRes = R.drawable.btn_right_round_transparent;
ts.expand = R.drawable.btn_inset_circle_trans;
ts.expand = R.drawable.btn_inset_circle_transparent;
ts.boxFree = R.drawable.btn_round_trans;
} else if (nightMode) {
ts.boxTop = R.drawable.btn_flat_night;

View file

@ -77,7 +77,7 @@ public class MapInfoWidgetsFactory {
}
};
altitudeControl.setText(null, null);
altitudeControl.setImageDrawable(map.getResources().getDrawable(R.drawable.widget_altitude));
altitudeControl.setImageDrawable(R.drawable.widget_altitude);
return altitudeControl;
}
@ -100,7 +100,7 @@ public class MapInfoWidgetsFactory {
return false;
}
};
gpsInfoControl.setImageDrawable(app.getResources().getDrawable(R.drawable.widget_gps_info));
gpsInfoControl.setImageDrawable(R.drawable.widget_gps_info);
gpsInfoControl.setText(null, null);
gpsInfoControl.setOnClickListener(new View.OnClickListener() {
@Override

View file

@ -196,8 +196,8 @@ public class RouteInfoWidgetsFactory {
public TextInfoWidget createTimeControl(final MapActivity map){
final RoutingHelper routingHelper = map.getRoutingHelper();
final Drawable time = map.getResources().getDrawable(R.drawable.widget_time);
final Drawable timeToGo = map.getResources().getDrawable(R.drawable.widget_time_to_distance);
final int time = R.drawable.widget_time;
final int timeToGo = R.drawable.widget_time_to_distance;
final OsmandApplication ctx = map.getMyApplication();
final OsmandPreference<Boolean> showArrival = ctx.getSettings().SHOW_ARRIVAL_TIME_OTHERWISE_EXPECTED_TIME;
final TextInfoWidget leftTimeControl = new TextInfoWidget(map) {
@ -260,7 +260,6 @@ public class RouteInfoWidgetsFactory {
public TextInfoWidget createPlainTimeControl(final MapActivity map){
final Drawable timeToGo = map.getResources().getDrawable(R.drawable.widget_time_to_distance);
final OsmandApplication ctx = map.getMyApplication();
final TextInfoWidget plainTimeControl = new TextInfoWidget(map) {
private long cachedLeftTime = 0;
@ -281,7 +280,7 @@ public class RouteInfoWidgetsFactory {
};
};
plainTimeControl.setText(null, null);
plainTimeControl.setImageDrawable(timeToGo);
plainTimeControl.setImageDrawable(R.drawable.widget_time_to_distance);
return plainTimeControl;
}
@ -324,7 +323,7 @@ public class RouteInfoWidgetsFactory {
return false;
}
};
speedControl.setImageDrawable(map.getResources().getDrawable(R.drawable.widget_max_speed));
speedControl.setImageDrawable(R.drawable.widget_max_speed);
speedControl.setText(null, null);
return speedControl;
}
@ -368,7 +367,7 @@ public class RouteInfoWidgetsFactory {
return false;
}
};
speedControl.setImageDrawable(map.getResources().getDrawable(R.drawable.widget_speed));
speedControl.setImageDrawable(R.drawable.widget_speed);
speedControl.setText(null, null);
return speedControl;
}
@ -379,10 +378,10 @@ public class RouteInfoWidgetsFactory {
private float[] calculations = new float[1];
private int cachedMeters;
public DistanceToPointInfoControl(MapActivity ma, Drawable d) {
public DistanceToPointInfoControl(MapActivity ma, int res) {
super(ma);
this.view = ma.getMapView();
setImageDrawable(d);
setImageDrawable(res);
setText(null, null);
setOnClickListener(new View.OnClickListener() {
@ -438,8 +437,7 @@ public class RouteInfoWidgetsFactory {
}
public TextInfoWidget createDistanceControl(final MapActivity map) {
DistanceToPointInfoControl distanceControl = new DistanceToPointInfoControl(map,map.getResources()
.getDrawable(R.drawable.widget_target)) {
DistanceToPointInfoControl distanceControl = new DistanceToPointInfoControl(map,R.drawable.widget_target) {
@Override
public LatLon getPointToNavigate() {
TargetPoint p = map.getPointToNavigate();
@ -459,8 +457,7 @@ public class RouteInfoWidgetsFactory {
public TextInfoWidget createIntermediateDistanceControl(final MapActivity map) {
final TargetPointsHelper targets = map.getMyApplication().getTargetPointsHelper();
DistanceToPointInfoControl distanceControl = new DistanceToPointInfoControl(map, map.getResources()
.getDrawable(R.drawable.widget_intermediate)) {
DistanceToPointInfoControl distanceControl = new DistanceToPointInfoControl(map, R.drawable.widget_intermediate) {
@Override
protected void click(OsmandMapTileView view) {

View file

@ -1,8 +1,10 @@
package net.osmand.plus.views.mapwidgets;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import android.app.Activity;
import android.app.Application;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.view.View;
@ -22,8 +24,11 @@ public class TextInfoWidget {
private boolean explicitlyVisible;
private OsmandApplication app;
public TextInfoWidget(Activity activity) {
app = (OsmandApplication) activity.getApplication();
view = activity.getLayoutInflater().inflate(R.layout.map_hud_widget, null);
topImageView = (ImageView) view.findViewById(R.id.widget_top_icon);
imageView = (ImageView) view.findViewById(R.id.widget_icon);
@ -39,6 +44,10 @@ public class TextInfoWidget {
setImageDrawable(imageDrawable, false);
}
public void setImageDrawable(int res) {
setImageDrawable(app.getIconsCache().getIcon(res, R.color.map_widget_icon_color), false);
}
public void setImageDrawable(Drawable imageDrawable, boolean gone) {
if(imageDrawable != null) {