Add new app mode
BIN
OsmAnd/res/drawable-hdpi/ic_action_aircraft_dark.png
Normal file
After Width: | Height: | Size: 898 B |
BIN
OsmAnd/res/drawable-hdpi/ic_action_aircraft_light.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-hdpi/ic_action_sail_boat_dark.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
OsmAnd/res/drawable-hdpi/ic_action_sail_boat_light.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
OsmAnd/res/drawable-hdpi/ic_aircraft.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
OsmAnd/res/drawable-hdpi/ic_sail_boat.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
OsmAnd/res/drawable-large/ic_action_aircraft_dark.png
Normal file
After Width: | Height: | Size: 898 B |
BIN
OsmAnd/res/drawable-large/ic_action_aircraft_light.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-large/ic_action_sail_boat_dark.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
OsmAnd/res/drawable-large/ic_action_sail_boat_light.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_action_aircraft_dark.png
Normal file
After Width: | Height: | Size: 553 B |
BIN
OsmAnd/res/drawable-mdpi/ic_action_aircraft_light.png
Normal file
After Width: | Height: | Size: 658 B |
BIN
OsmAnd/res/drawable-mdpi/ic_action_sail_boat_dark.png
Normal file
After Width: | Height: | Size: 797 B |
BIN
OsmAnd/res/drawable-mdpi/ic_action_sail_boat_light.png
Normal file
After Width: | Height: | Size: 958 B |
BIN
OsmAnd/res/drawable-mdpi/ic_aircraft.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_sail_boat.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_action_aircraft_dark.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_action_aircraft_light.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_action_sail_boat_dark.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_action_sail_boat_light.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_aircraft.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_sail_boat.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
|
@ -18,8 +18,8 @@ public class ApplicationMode {
|
|||
public static final ApplicationMode CAR = reg(R.string.app_mode_car, R.drawable.ic_car, "car", null);
|
||||
public static final ApplicationMode BICYCLE = reg(R.string.app_mode_bicycle, R.drawable.ic_bicycle, "bicycle", null);
|
||||
public static final ApplicationMode PEDESTRIAN = reg(R.string.app_mode_pedestrian, R.drawable.ic_pedestrian, "pedestrian", null);
|
||||
public static final ApplicationMode AIRCRAFT = reg(R.string.app_mode_aircraft, R.drawable.ic_browse_map, "aircraft", null);
|
||||
public static final ApplicationMode BOAT = reg(R.string.app_mode_boat, R.drawable.ic_browse_map, "boat", null);
|
||||
public static final ApplicationMode AIRCRAFT = reg(R.string.app_mode_aircraft, R.drawable.ic_aircraft, "aircraft", null);
|
||||
public static final ApplicationMode BOAT = reg(R.string.app_mode_boat, R.drawable.ic_sail_boat, "boat", null);
|
||||
|
||||
|
||||
private static ApplicationMode reg(int key, int iconId, String stringKey, ApplicationMode parent) {
|
||||
|
@ -74,6 +74,10 @@ public class ApplicationMode {
|
|||
return nightMode? R.drawable.ic_action_bicycle_dark : R.drawable.ic_action_bicycle_light;
|
||||
} else if(this == ApplicationMode.PEDESTRIAN){
|
||||
return nightMode? R.drawable.ic_action_pedestrian_dark : R.drawable.ic_action_pedestrian_light;
|
||||
} else if(this == ApplicationMode.BOAT){
|
||||
return nightMode? R.drawable.ic_action_sail_boat_dark : R.drawable.ic_action_sail_boat_light;
|
||||
} else if(this == ApplicationMode.AIRCRAFT){
|
||||
return nightMode? R.drawable.ic_action_aircraft_dark : R.drawable.ic_action_aircraft_light;
|
||||
} else {
|
||||
return nightMode? R.drawable.app_mode_globus_dark : R.drawable.app_mode_globus_light;
|
||||
}
|
||||
|
|
|
@ -31,8 +31,9 @@ import android.view.ViewGroup;
|
|||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.HorizontalScrollView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.LinearLayout.LayoutParams;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -281,6 +282,9 @@ public class NavigateAction {
|
|||
|
||||
private static ToggleButton[] createToggles(final List<ApplicationMode> values, LinearLayout topLayout, Context ctx) {
|
||||
final ToggleButton[] buttons = new ToggleButton[values.size()];
|
||||
HorizontalScrollView scroll = new HorizontalScrollView(ctx);
|
||||
|
||||
topLayout.addView(scroll);
|
||||
|
||||
int k = 0;
|
||||
int left = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, ctx.getResources().getDisplayMetrics());
|
||||
|
@ -292,9 +296,9 @@ public class NavigateAction {
|
|||
tb.setTextOff("");
|
||||
tb.setContentDescription(ma.toHumanString(ctx));
|
||||
tb.setButtonDrawable(ma.getIconId());
|
||||
LayoutParams lp = new LinearLayout.LayoutParams(metrics, metrics);
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(metrics, metrics);
|
||||
lp.setMargins(left, 0, 0, 0);
|
||||
topLayout.addView(tb, lp);
|
||||
scroll.addView(tb, lp);
|
||||
|
||||
}
|
||||
return buttons;
|
||||
|
|