Fix regions and add edit device color
This commit is contained in:
parent
a14efc7e20
commit
fa778d890c
9 changed files with 192 additions and 21 deletions
|
@ -71,6 +71,9 @@ public class OsmandRegions {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDownloadNameIndexLowercase(String downloadName) {
|
public String getDownloadNameIndexLowercase(String downloadName) {
|
||||||
|
if(downloadName == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
final String lc = downloadName.toLowerCase();
|
final String lc = downloadName.toLowerCase();
|
||||||
if(downloadNamesToLowercaseIndex.containsKey(lc)) {
|
if(downloadNamesToLowercaseIndex.containsKey(lc)) {
|
||||||
return downloadNamesToLowercaseIndex.get(lc);
|
return downloadNamesToLowercaseIndex.get(lc);
|
||||||
|
@ -245,6 +248,9 @@ public class OsmandRegions {
|
||||||
initTypes(object);
|
initTypes(object);
|
||||||
String downloadName = object.getNameByType(downloadNameType).toLowerCase();
|
String downloadName = object.getNameByType(downloadNameType).toLowerCase();
|
||||||
String prefix = object.getNameByType(prefixType);
|
String prefix = object.getNameByType(prefixType);
|
||||||
|
if(prefix == null) {
|
||||||
|
prefix = "";
|
||||||
|
}
|
||||||
String locName = getLocaleName(object);
|
String locName = getLocaleName(object);
|
||||||
if(locName != null && locName.length() > 0){
|
if(locName != null && locName.length() > 0){
|
||||||
downloadNamesToLocaleNames.put(downloadName, locName);
|
downloadNamesToLocaleNames.put(downloadName, locName);
|
||||||
|
|
|
@ -367,7 +367,7 @@ public class TileSourceManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TileSourceTemplate getMapnikSource(){
|
public static TileSourceTemplate getMapnikSource(){
|
||||||
return new TileSourceTemplate("Mapnik", "http://mapnik.osmand.net/{0}/{1}/{2}.png", ".png", 18, 1, 256, 8, 18000); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
return new TileSourceTemplate("Mapnik", "http://mapnik.osmand.net/{0}/{1}/{2}.png", ".png", 19, 1, 256, 8, 18000); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TileSourceTemplate getCycleMapSource(){
|
public static TileSourceTemplate getCycleMapSource(){
|
||||||
|
|
52
OsmAnd/res/layout/osmo_edit_device.xml
Normal file
52
OsmAnd/res/layout/osmo_edit_device.xml
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
|
||||||
|
<TableLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:stretchColumns="1" >
|
||||||
|
|
||||||
|
<TableRow>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/osmo_connect_to_device_name" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/Name"
|
||||||
|
android:layout_width="180dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:text="" >
|
||||||
|
|
||||||
|
<requestFocus />
|
||||||
|
</EditText>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/osmo_edit_color" >
|
||||||
|
</TextView>
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/ColorSpinner"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp" >
|
||||||
|
</Spinner>
|
||||||
|
</TableRow>
|
||||||
|
</TableLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
|
@ -9,6 +9,17 @@
|
||||||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||||
-->
|
-->
|
||||||
|
<string name="color_red">red</string>
|
||||||
|
<string name="color_pink">pink</string>
|
||||||
|
<string name="color_orange">orange</string>
|
||||||
|
<string name="color_brown">brown</string>
|
||||||
|
<string name="color_yellow">yellow</string>
|
||||||
|
<string name="color_lightblue">light blue</string>
|
||||||
|
<string name="color_blue">blue</string>
|
||||||
|
<string name="color_magenta">magenta</string>
|
||||||
|
|
||||||
|
<string name="osmo_edit_device">Change user properties</string>
|
||||||
|
<string name="osmo_edit_color">Display color</string>
|
||||||
<string name="osmo_group_info">Info</string>
|
<string name="osmo_group_info">Info</string>
|
||||||
<string name="osmo_group">OsMo group</string>
|
<string name="osmo_group">OsMo group</string>
|
||||||
<string name="osmo_group_share">In order to Connect to the group %2$s, specify group id (%1$s)</string>
|
<string name="osmo_group_share">In order to Connect to the group %2$s, specify group id (%1$s)</string>
|
||||||
|
@ -26,7 +37,7 @@
|
||||||
<string name="osmo_group_description">Description</string>
|
<string name="osmo_group_description">Description</string>
|
||||||
<string name="osmo_group_policy">Policy</string>
|
<string name="osmo_group_policy">Policy</string>
|
||||||
<string name="osmo_connect_to_device_tracker_id">Tracker id</string>
|
<string name="osmo_connect_to_device_tracker_id">Tracker id</string>
|
||||||
<string name="osmo_connect_to_device_name">Device name</string>
|
<string name="osmo_connect_to_device_name">User name</string>
|
||||||
<string name="osmo_connect_to_group_id">Group id</string>
|
<string name="osmo_connect_to_group_id">Group id</string>
|
||||||
<string name="osmo_group_name">Group name</string>
|
<string name="osmo_group_name">Group name</string>
|
||||||
<string name="osmo_connect_to_device">Link with device</string>
|
<string name="osmo_connect_to_device">Link with device</string>
|
||||||
|
|
|
@ -569,6 +569,7 @@ public class OsmandApplication extends Application {
|
||||||
bak.renameTo(save);
|
bak.renameTo(save);
|
||||||
}
|
}
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
|
e.printStackTrace();
|
||||||
warnings.add(e.getMessage());
|
warnings.add(e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
synchronized (OsmandApplication.this) {
|
synchronized (OsmandApplication.this) {
|
||||||
|
|
|
@ -346,6 +346,10 @@ public class OsMoGroups implements OsMoReactor, OsmoTrackerListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setDeviceProperties(OsMoDevice model, String name, int color) {
|
||||||
|
model.userName = name;
|
||||||
|
model.userColor = color;
|
||||||
|
storage.save();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
*/
|
*/
|
||||||
package net.osmand.plus.osmo;
|
package net.osmand.plus.osmo;
|
||||||
|
|
||||||
|
import gnu.trove.list.array.TIntArrayList;
|
||||||
|
|
||||||
import java.text.Collator;
|
import java.text.Collator;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -11,6 +13,7 @@ import java.util.Date;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import net.osmand.AndroidUtils;
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
|
@ -90,6 +93,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
protected static final int SHOW_ON_MAP_ID = 6;
|
protected static final int SHOW_ON_MAP_ID = 6;
|
||||||
public static final int SHARE_SESSION = 7;
|
public static final int SHARE_SESSION = 7;
|
||||||
public static final int GROUP_INFO = 8;
|
public static final int GROUP_INFO = 8;
|
||||||
|
protected static final int SETTINGS_ID = 9;
|
||||||
private static final int LIST_REFRESH_MSG_ID = OsmAndConstants.UI_HANDLER_SEARCH + 30;
|
private static final int LIST_REFRESH_MSG_ID = OsmAndConstants.UI_HANDLER_SEARCH + 30;
|
||||||
private static final long RECENT_THRESHOLD = 60000;
|
private static final long RECENT_THRESHOLD = 60000;
|
||||||
|
|
||||||
|
@ -106,6 +110,28 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
private ActionMode actionMode;
|
private ActionMode actionMode;
|
||||||
private Object selectedObject = null;
|
private Object selectedObject = null;
|
||||||
private String operation;
|
private String operation;
|
||||||
|
|
||||||
|
private int[] paletteColors = new int[] {
|
||||||
|
R.string.color_red,
|
||||||
|
R.string.color_pink,
|
||||||
|
R.string.color_orange,
|
||||||
|
R.string.color_brown,
|
||||||
|
R.string.color_yellow,
|
||||||
|
R.string.color_lightblue,
|
||||||
|
R.string.color_blue,
|
||||||
|
R.string.color_magenta
|
||||||
|
};
|
||||||
|
|
||||||
|
private int[] pallette = new int[] {
|
||||||
|
0xffd00d0d,
|
||||||
|
0xffe044bb,
|
||||||
|
0xffee5020,
|
||||||
|
0xff602010,
|
||||||
|
0xffeeee10,
|
||||||
|
0xff10c0f0,
|
||||||
|
0xff1010a0,
|
||||||
|
0xff88e030
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle icicle) {
|
public void onCreate(Bundle icicle) {
|
||||||
|
@ -291,8 +317,8 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
selectedObject = o;
|
selectedObject = o;
|
||||||
device = (OsMoDevice) (o instanceof OsMoDevice ?o : null);
|
device = (OsMoDevice) (o instanceof OsMoDevice ?o : null);
|
||||||
group = (OsMoGroup) (o instanceof OsMoGroup ?o : null);
|
group = (OsMoGroup) (o instanceof OsMoGroup ?o : null);
|
||||||
createMenuItem(menu, DELETE_ACTION_ID, R.string.default_buttons_delete, R.drawable.ic_action_delete_light, R.drawable.ic_action_delete_dark,
|
MenuItem mi = createMenuItem(menu, ON_OFF_ACTION_ID, R.string.default_buttons_ok, 0, 0,
|
||||||
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||||
if(device != null && device.getLastLocation() != null) {
|
if(device != null && device.getLastLocation() != null) {
|
||||||
createMenuItem(menu, SHOW_ON_MAP_ID, R.string.show_poi_on_map, R.drawable.ic_action_marker_light, R.drawable.ic_action_marker_dark,
|
createMenuItem(menu, SHOW_ON_MAP_ID, R.string.show_poi_on_map, R.drawable.ic_action_marker_light, R.drawable.ic_action_marker_dark,
|
||||||
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
@ -302,12 +328,19 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
}
|
}
|
||||||
createMenuItem(menu, SHARE_ID, R.string.share_fav, R.drawable.ic_action_gshare_light, R.drawable.ic_action_gshare_dark,
|
createMenuItem(menu, SHARE_ID, R.string.share_fav, R.drawable.ic_action_gshare_light, R.drawable.ic_action_gshare_dark,
|
||||||
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
///
|
||||||
|
if(device != null) {
|
||||||
|
createMenuItem(menu, SETTINGS_ID, R.string.settings, R.drawable.ic_action_settings_light, R.drawable.ic_action_sail_boat_dark,
|
||||||
|
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
}
|
||||||
if(group != null) {
|
if(group != null) {
|
||||||
createMenuItem(menu, GROUP_INFO, R.string.osmo_group_info, R.drawable.ic_action_info_light, R.drawable.ic_action_info_dark,
|
createMenuItem(menu, GROUP_INFO, R.string.osmo_group_info, R.drawable.ic_action_info_light, R.drawable.ic_action_info_dark,
|
||||||
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
}
|
}
|
||||||
MenuItem mi = createMenuItem(menu, ON_OFF_ACTION_ID, R.string.default_buttons_ok, 0, 0,
|
createMenuItem(menu, DELETE_ACTION_ID, R.string.default_buttons_delete, R.drawable.ic_action_delete_light, R.drawable.ic_action_delete_dark,
|
||||||
MenuItem.SHOW_AS_ACTION_ALWAYS);
|
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final LayoutInflater inflater = LayoutInflater.from(OsMoGroupsActivity.this);
|
final LayoutInflater inflater = LayoutInflater.from(OsMoGroupsActivity.this);
|
||||||
View view = inflater.inflate(R.layout.check_item_rel, null);
|
View view = inflater.inflate(R.layout.check_item_rel, null);
|
||||||
|
@ -336,7 +369,9 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
||||||
if(item.getItemId() == DELETE_ACTION_ID ) {
|
if(item.getItemId() == SETTINGS_ID) {
|
||||||
|
showSettingsDialog(device);
|
||||||
|
} else if(item.getItemId() == DELETE_ACTION_ID ) {
|
||||||
Builder bld = new AlertDialog.Builder(OsMoGroupsActivity.this);
|
Builder bld = new AlertDialog.Builder(OsMoGroupsActivity.this);
|
||||||
String name = (selectedObject instanceof OsMoDevice)? ((OsMoDevice) selectedObject).getVisibleName() :
|
String name = (selectedObject instanceof OsMoDevice)? ((OsMoDevice) selectedObject).getVisibleName() :
|
||||||
((OsMoGroup) selectedObject).getVisibleName(OsMoGroupsActivity.this);
|
((OsMoGroup) selectedObject).getVisibleName(OsMoGroupsActivity.this);
|
||||||
|
@ -593,7 +628,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
final String nameUser = name.getText().toString();
|
final String nameUser = name.getText().toString();
|
||||||
final String id = tracker.getText().toString();
|
final String id = tracker.getText().toString();
|
||||||
if(device.isChecked()) {
|
if(device.isChecked()) {
|
||||||
OsMoDevice dev = osMoPlugin.getGroups().addConnectedDevice(id, nameUser, 0);
|
OsMoDevice dev = osMoPlugin.getGroups().addConnectedDevice(id, nameUser, getRandomColor());
|
||||||
adapter.update(dev.group);
|
adapter.update(dev.group);
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
} else {
|
} else {
|
||||||
|
@ -830,7 +865,19 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
net.osmand.Location.distanceBetween(location.getLatitude(), location.getLongitude(),
|
net.osmand.Location.distanceBetween(location.getLatitude(), location.getLongitude(),
|
||||||
mapLocation.getLatitude(), mapLocation.getLongitude(), mes);
|
mapLocation.getLatitude(), mapLocation.getLongitude(), mes);
|
||||||
draw.setAngle(mes[1] - lastCompass + 180);
|
draw.setAngle(mes[1] - lastCompass + 180);
|
||||||
draw.setRecent(Math.abs(location.getTime() - System.currentTimeMillis()) < RECENT_THRESHOLD);
|
final boolean recent = Math.abs(location.getTime() - System.currentTimeMillis()) < RECENT_THRESHOLD;
|
||||||
|
|
||||||
|
int color;
|
||||||
|
if(recent){
|
||||||
|
color = model.getColor();
|
||||||
|
if(color == 0) {
|
||||||
|
color = getRandomColor();
|
||||||
|
osMoPlugin.getGroups().setDeviceProperties(model, model.getVisibleName(), color);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
color = getResources().getColor(R.color.color_unknown);
|
||||||
|
}
|
||||||
|
draw.setColor(color);
|
||||||
icon.setImageDrawable(draw);
|
icon.setImageDrawable(draw);
|
||||||
int dist = (int) mes[0];
|
int dist = (int) mes[0];
|
||||||
long seconds = Math.max(0, (System.currentTimeMillis() - location.getTime()) / 1000);
|
long seconds = Math.max(0, (System.currentTimeMillis() - location.getTime()) / 1000);
|
||||||
|
@ -860,6 +907,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,6 +919,10 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
adapter.notifyDataSetInvalidated();
|
adapter.notifyDataSetInvalidated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getRandomColor() {
|
||||||
|
return pallette[new Random().nextInt(pallette.length)];
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateCompassValue(float value) {
|
public void updateCompassValue(float value) {
|
||||||
|
@ -896,6 +948,54 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
public void locationChange(String trackerId, Location loc) {
|
public void locationChange(String trackerId, Location loc) {
|
||||||
refreshList();
|
refreshList();
|
||||||
}
|
}
|
||||||
|
public static String colorToString(int color) {
|
||||||
|
if ((0xFF000000 & color) == 0xFF000000) {
|
||||||
|
return "#" + Integer.toHexString(color & 0x00FFFFFF); //$NON-NLS-1$
|
||||||
|
} else {
|
||||||
|
return "#" + Integer.toHexString(color); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showSettingsDialog(final OsMoDevice device) {
|
||||||
|
Builder bld = new AlertDialog.Builder(OsMoGroupsActivity.this);
|
||||||
|
bld.setTitle(R.string.osmo_edit_device);
|
||||||
|
final LayoutInflater inflater = LayoutInflater.from(this);
|
||||||
|
View view = inflater.inflate(R.layout.osmo_edit_device, null);
|
||||||
|
final EditText name = (EditText) view.findViewById(R.id.Name);
|
||||||
|
final Spinner colorSpinner = (Spinner) view.findViewById(R.id.ColorSpinner);
|
||||||
|
bld.setView(view);
|
||||||
|
name.setText(device.getVisibleName());
|
||||||
|
final TIntArrayList list = new TIntArrayList(pallette);
|
||||||
|
List<String> colorNames= new ArrayList<String>();
|
||||||
|
int selection = -1;
|
||||||
|
int devColor = device.getColor();
|
||||||
|
for(int i = 0; i < pallette.length; i++) {
|
||||||
|
colorNames.add(getString(paletteColors[i]));
|
||||||
|
list.add(pallette[i]);
|
||||||
|
if(devColor == pallette[i]) {
|
||||||
|
selection = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selection == -1) {
|
||||||
|
list.insert(0, devColor);
|
||||||
|
colorNames.add(0, colorToString(devColor));
|
||||||
|
selection = 0;
|
||||||
|
}
|
||||||
|
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, colorNames);
|
||||||
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
colorSpinner.setAdapter(adapter);
|
||||||
|
colorSpinner.setSelection(selection);
|
||||||
|
|
||||||
|
bld.setPositiveButton(R.string .default_buttons_yes, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
osMoPlugin.getGroups().setDeviceProperties(device,
|
||||||
|
name.getText().toString(), list.get(colorSpinner.getSelectedItemPosition()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
bld.setNegativeButton(R.string.default_buttons_no, null);
|
||||||
|
}
|
||||||
|
|
||||||
class DirectionDrawable extends Drawable {
|
class DirectionDrawable extends Drawable {
|
||||||
Paint paintRouteDirection;
|
Paint paintRouteDirection;
|
||||||
|
@ -909,12 +1009,8 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
paintRouteDirection.setAntiAlias(true);
|
paintRouteDirection.setAntiAlias(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRecent(boolean recent) {
|
public void setColor(int color) {
|
||||||
if (recent) {
|
paintRouteDirection.setColor(color);
|
||||||
paintRouteDirection.setColor(getResources().getColor(R.color.color_ok));
|
|
||||||
} else {
|
|
||||||
paintRouteDirection.setColor(getResources().getColor(R.color.color_unknown));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAngle(float angle) {
|
public void setAngle(float angle) {
|
||||||
|
|
|
@ -350,14 +350,15 @@ public class OsMoGroupsStorage {
|
||||||
return trackerId;
|
return trackerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getColor(int defAssignUserColor) {
|
|
||||||
|
|
||||||
|
public int getColor() {
|
||||||
if(userColor != 0) {
|
if(userColor != 0) {
|
||||||
return userColor;
|
return userColor;
|
||||||
}
|
}
|
||||||
if(serverColor != 0) {
|
if(serverColor != 0) {
|
||||||
return serverColor ;
|
return serverColor ;
|
||||||
}
|
}
|
||||||
userColor = defAssignUserColor;
|
|
||||||
return userColor;
|
return userColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import net.osmand.plus.OsmandPlugin;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.activities.MapActivity;
|
import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.activities.SettingsActivity;
|
import net.osmand.plus.activities.SettingsActivity;
|
||||||
|
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
|
||||||
import net.osmand.plus.views.MapInfoLayer;
|
import net.osmand.plus.views.MapInfoLayer;
|
||||||
import net.osmand.plus.views.MonitoringInfoControl;
|
import net.osmand.plus.views.MonitoringInfoControl;
|
||||||
import net.osmand.plus.views.MonitoringInfoControl.MonitoringInfoControlServices;
|
import net.osmand.plus.views.MonitoringInfoControl.MonitoringInfoControlServices;
|
||||||
|
@ -59,9 +60,7 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateLocation(Location location) {
|
public void updateLocation(Location location) {
|
||||||
if (service.isConnected()) {
|
tracker.sendCoordinate(location);
|
||||||
tracker.sendCoordinate(location);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -219,4 +218,5 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer
|
||||||
public OsMoService getService() {
|
public OsMoService getService() {
|
||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue