Intermediate commit
BIN
OsmAnd/res/drawable-hdpi/box_expand_trans_normal.png
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
OsmAnd/res/drawable-hdpi/box_expand_trans_pressed.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
OsmAnd/res/drawable-hdpi/box_top_l_normal.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-hdpi/box_top_l_pressed.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 925 B |
BIN
OsmAnd/res/drawable-hdpi/box_top_r_normal.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-hdpi/box_top_r_pressed.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 945 B |
BIN
OsmAnd/res/drawable-hdpi/box_top_stack_normal.9.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
OsmAnd/res/drawable-hdpi/box_top_stack_pressed.9.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
OsmAnd/res/drawable-large/box_expand_trans_normal.png
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
OsmAnd/res/drawable-large/box_expand_trans_pressed.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
6
OsmAnd/res/drawable/box_expand_t.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_expand_trans_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_expand_trans_pressed" />
|
||||
<item android:drawable="@drawable/box_expand_trans_normal" />
|
||||
</selector>
|
BIN
OsmAnd/res/drawable/box_expand_trans_normal.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
OsmAnd/res/drawable/box_expand_trans_pressed.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_pressed" />
|
||||
<item android:drawable="@drawable/box_top_simple" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_l_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_l_pressed" />
|
||||
<item android:drawable="@drawable/box_top_l_normal" />
|
||||
</selector>
|
||||
|
|
BIN
OsmAnd/res/drawable/box_top_l_normal.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable/box_top_l_pressed.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_pressed" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_l_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_l_pressed" />
|
||||
<item android:drawable="@drawable/box_top_trans_l" />
|
||||
</selector>
|
||||
|
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 925 B |
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_pressed" />
|
||||
<item android:drawable="@drawable/box_top_simple" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_r_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_r_pressed" />
|
||||
<item android:drawable="@drawable/box_top_r_normal" />
|
||||
</selector>
|
||||
|
|
BIN
OsmAnd/res/drawable/box_top_r_normal.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable/box_top_r_pressed.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_pressed" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_r_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_r_pressed" />
|
||||
<item android:drawable="@drawable/box_top_trans_r" />
|
||||
</selector>
|
||||
|
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 945 B |
6
OsmAnd/res/drawable/box_top_stack.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_stack_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_stack_pressed" />
|
||||
<item android:drawable="@drawable/box_top_stack_normal" />
|
||||
</selector>
|
BIN
OsmAnd/res/drawable/box_top_stack_normal.9.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
OsmAnd/res/drawable/box_top_stack_pressed.9.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
6
OsmAnd/res/drawable/box_top_t_stack.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/box_top_stack_pressed" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/box_top_stack_pressed" />
|
||||
<item android:drawable="@drawable/box_top_trans" />
|
||||
</selector>
|
|
@ -1062,6 +1062,9 @@ public class OsmandSettings {
|
|||
|
||||
public final CommonPreference<Boolean> SHOW_ALTITUDE_INFO =
|
||||
new BooleanPreference("show_altitude_info", false, false, true);
|
||||
{
|
||||
SHOW_ALTITUDE_INFO.setModeDefaultValue(ApplicationMode.CAR, false);
|
||||
}
|
||||
|
||||
public final CommonPreference<Boolean> SHOW_ZOOM_LEVEL =
|
||||
new BooleanPreference("show_zoom_level", false, false, true);
|
||||
|
|
|
@ -134,7 +134,7 @@ public class MainMenuActivity extends Activity {
|
|||
SharedPreferences prefs = activity.getApplicationContext().getSharedPreferences("net.osmand.settings", MODE_WORLD_READABLE);
|
||||
|
||||
// only one commit should be with contribution version flag
|
||||
// prefs.edit().putBoolean(CONTRIBUTION_VERSION_FLAG, true).commit();
|
||||
// prefs.edit().putBoolean(CONTRIBUTION_VERSION_FLAG, true).commit();
|
||||
if (prefs.contains(CONTRIBUTION_VERSION_FLAG)) {
|
||||
SpannableString content = new SpannableString(textVersion);
|
||||
content.setSpan(new ClickableSpan() {
|
||||
|
|
|
@ -100,27 +100,24 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
}
|
||||
|
||||
public void applyTheme() {
|
||||
int boxTop = R.drawable.box_top;
|
||||
int boxTop = R.drawable.box_top_stack;
|
||||
int boxTopR = R.drawable.box_top_r;
|
||||
int boxTopL = R.drawable.box_top_l;
|
||||
int expand = R.drawable.box_expand;
|
||||
if(view.getSettings().TRANSPARENT_MAP_THEME.get()){
|
||||
boxTop = R.drawable.box_top_t;
|
||||
boxTop = R.drawable.box_top_t_stack;
|
||||
boxTopR = R.drawable.box_top_rt;
|
||||
boxTopL = R.drawable.box_top_lt;
|
||||
expand = R.drawable.box_expand_t;
|
||||
}
|
||||
int i = 0;
|
||||
for(MapInfoControl m : rightStack.getAllViews()){
|
||||
m.setBackgroundDrawable(view.getResources().getDrawable(i == 0 ? boxTopR : boxTop));
|
||||
i++;
|
||||
}
|
||||
rightStack.setExpandImageDrawable(view.getResources().getDrawable(expand));
|
||||
i = 0;
|
||||
for(MapInfoControl m : leftStack.getAllViews()){
|
||||
m.setBackgroundDrawable(view.getResources().getDrawable(i < 2 ? boxTopL : boxTop));
|
||||
i++;
|
||||
}
|
||||
rightStack.setTopDrawable(view.getResources().getDrawable(boxTopR));
|
||||
rightStack.setStackDrawable(view.getResources().getDrawable(boxTop));
|
||||
|
||||
leftStack.setTopDrawable(view.getResources().getDrawable(boxTopL));
|
||||
leftStack.setStackDrawable(view.getResources().getDrawable(boxTop));
|
||||
|
||||
leftStack.setExpandImageDrawable(view.getResources().getDrawable(expand));
|
||||
rightStack.setExpandImageDrawable(view.getResources().getDrawable(expand));
|
||||
statusBar.setBackgroundDrawable(view.getResources().getDrawable(boxTop));
|
||||
showAltitude = view.getSettings().SHOW_ALTITUDE_INFO.get();
|
||||
}
|
||||
|
@ -219,14 +216,15 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
|
||||
private TextInfoControl createSpeedControl(){
|
||||
final TextInfoControl speedControl = new TextInfoControl(map, 3, paintText, paintSubText) {
|
||||
private float cachedSpeed = 0;
|
||||
// TODO
|
||||
private float cachedSpeed = 5;
|
||||
|
||||
@Override
|
||||
public boolean updateInfo() {
|
||||
// draw speed
|
||||
if (map.getLastKnownLocation() != null && map.getLastKnownLocation().hasSpeed()) {
|
||||
if (Math.abs(map.getLastKnownLocation().getSpeed() - cachedSpeed) > .3f) {
|
||||
cachedSpeed = map.getLastKnownLocation().getSpeed();
|
||||
// if (map.getLastKnownLocation() != null && map.getLastKnownLocation().hasSpeed()) {
|
||||
// if (Math.abs(map.getLastKnownLocation().getSpeed() - cachedSpeed) > .3f) {
|
||||
// cachedSpeed = map.getLastKnownLocation().getSpeed();
|
||||
String ds = OsmAndFormatter.getFormattedSpeed(cachedSpeed, map);
|
||||
int ls = ds.lastIndexOf(' ');
|
||||
if (ls == -1) {
|
||||
|
@ -235,13 +233,13 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
setText(ds.substring(0, ls), ds.substring(ls + 1));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else if (cachedSpeed != 0) {
|
||||
cachedSpeed = 0;
|
||||
setText(null, null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
// }
|
||||
// } else if (cachedSpeed != 0) {
|
||||
// cachedSpeed = 0;
|
||||
// setText(null, null);
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
}
|
||||
};
|
||||
speedControl.setText(null, null);
|
||||
|
@ -290,12 +288,13 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
|
||||
@Override
|
||||
public boolean updateInfo() {
|
||||
int time = 0;
|
||||
if (routeLayer != null && routeLayer.getHelper().isRouterEnabled()) {
|
||||
boolean followingMode = routeLayer.getHelper().isFollowingMode();
|
||||
time = routeLayer.getHelper().getLeftTime();
|
||||
int time = 1500;
|
||||
// TODO
|
||||
// if (routeLayer != null && routeLayer.getHelper().isRouterEnabled()) {
|
||||
// boolean followingMode = routeLayer.getHelper().isFollowingMode();
|
||||
// time = routeLayer.getHelper().getLeftTime();
|
||||
if (time != 0) {
|
||||
if (followingMode && showArrivalTime) {
|
||||
if (/*followingMode && */showArrivalTime) {
|
||||
long toFindTime = time * 1000 + System.currentTimeMillis();
|
||||
if (Math.abs(toFindTime - cachedLeftTime) > 30000) {
|
||||
cachedLeftTime = toFindTime;
|
||||
|
@ -316,7 +315,7 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
if (time == 0 && cachedLeftTime != 0) {
|
||||
cachedLeftTime = 0;
|
||||
setText(null, null);
|
||||
|
@ -346,6 +345,7 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
private float[] calculations = new float[1];
|
||||
private int cachedMeters = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean updateInfo() {
|
||||
if (map.getPointToNavigate() != null) {
|
||||
|
|
|
@ -21,6 +21,9 @@ public class MapStackControl extends ViewGroup {
|
|||
// by default opened
|
||||
private boolean isCollapsed = false;
|
||||
private boolean isCollapsible = true;
|
||||
|
||||
private Drawable topDrawable;
|
||||
private Drawable stackDrawable;
|
||||
|
||||
public MapStackControl(Context context) {
|
||||
super(context);
|
||||
|
@ -33,12 +36,12 @@ public class MapStackControl extends ViewGroup {
|
|||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
int cx = (getLeft() + getRight()) / 2 - getLeft();
|
||||
int t = (int) (getBottom() - getTop() - 12 * MapInfoLayer.scaleCoefficient);
|
||||
int t = (int) (10 * MapInfoLayer.scaleCoefficient);
|
||||
|
||||
if (!isCollapsed) {
|
||||
canvas.drawBitmap(arrowUp, cx - arrowUp.getWidth() / 2, t - arrowUp.getHeight(), paintImg);
|
||||
canvas.drawBitmap(arrowUp, cx - arrowUp.getWidth() / 2, t , paintImg);
|
||||
} else {
|
||||
canvas.drawBitmap(arrowDown, cx - arrowDown.getWidth() / 2, t - arrowUp.getHeight(), paintImg);
|
||||
canvas.drawBitmap(arrowDown, cx - arrowDown.getWidth() / 2, t , paintImg);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -57,6 +60,14 @@ public class MapStackControl extends ViewGroup {
|
|||
public void setExpandImageDrawable(Drawable d) {
|
||||
expandView.setImageDrawable(d);
|
||||
}
|
||||
|
||||
public void setTopDrawable(Drawable topDrawable) {
|
||||
this.topDrawable = topDrawable;
|
||||
}
|
||||
|
||||
public void setStackDrawable(Drawable stackDrawable) {
|
||||
this.stackDrawable = stackDrawable;
|
||||
}
|
||||
|
||||
public void updateInfo() {
|
||||
for (MapInfoControl v : stackViews) {
|
||||
|
@ -107,9 +118,12 @@ public class MapStackControl extends ViewGroup {
|
|||
int w = 0;
|
||||
int h = 0;
|
||||
int prevBot = 0;
|
||||
boolean first = true;
|
||||
if (stackViews != null) {
|
||||
for (MapInfoControl c : stackViews) {
|
||||
if (c.getVisibility() != View.GONE) {
|
||||
c.setBackgroundDrawable(first ? topDrawable.mutate() : stackDrawable.mutate());
|
||||
first = false;
|
||||
c.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
|
||||
w = Math.max(w, c.getMeasuredWidth());
|
||||
if (h > 0) {
|
||||
|
@ -125,6 +139,8 @@ public class MapStackControl extends ViewGroup {
|
|||
if (c.getVisibility() != View.GONE) {
|
||||
isCollapsible = true;
|
||||
if (!isCollapsed) {
|
||||
c.setBackgroundDrawable(first ? topDrawable.mutate() : stackDrawable.mutate());
|
||||
first = false;
|
||||
c.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
|
||||
w = Math.max(w, c.getMeasuredWidth());
|
||||
h -= c.getPaddingBottom();
|
||||
|
@ -145,7 +161,7 @@ public class MapStackControl extends ViewGroup {
|
|||
}
|
||||
}
|
||||
if (isCollapsible) {
|
||||
h -= prevBot;
|
||||
// h -= prevBot;
|
||||
h += expandView.getDrawable().getMinimumHeight();
|
||||
w = Math.max(w, expandView.getDrawable().getMinimumWidth());
|
||||
}
|
||||
|
|