This commit is contained in:
Victor Shcherb 2014-07-31 00:17:38 +02:00
parent 96b06fbf81
commit a70ea6c83c
2 changed files with 14 additions and 1 deletions

View file

@ -9,6 +9,8 @@
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="osmo_leave_confirmation_msg">Leave group %1$s?</string>
<string name="osmo_specify_tracker_id">Please specify tracker id</string>
<string name="continue_navigation">Continue Navigation</string> <string name="continue_navigation">Continue Navigation</string>
<string name="pause_navigation">Pause Navigation</string> <string name="pause_navigation">Pause Navigation</string>
<string name="keep_navigation_service">Keep</string> <string name="keep_navigation_service">Keep</string>

View file

@ -431,7 +431,9 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
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);
bld.setTitle(getString(R.string.delete_confirmation_msg, name)); bld.setTitle(getString(
selectedObject instanceof OsMoDevice? R.string.delete_confirmation_msg :
R.string.osmo_leave_confirmation_msg, name));
bld.setPositiveButton(R.string .default_buttons_yes, new DialogInterface.OnClickListener() { bld.setPositiveButton(R.string .default_buttons_yes, new DialogInterface.OnClickListener() {
@Override @Override
@ -814,11 +816,15 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
if(isChecked) { if(isChecked) {
labelTracker.setText(R.string.osmo_connect_to_device_tracker_id); labelTracker.setText(R.string.osmo_connect_to_device_tracker_id);
labelName.setText(R.string.osmo_connect_to_device_name); labelName.setText(R.string.osmo_connect_to_device_name);
name.setVisibility(View.VISIBLE);
labelName.setVisibility(View.VISIBLE);
mgv.setVisibility(View.GONE); mgv.setVisibility(View.GONE);
} else { } else {
labelTracker.setText(R.string.osmo_connect_to_group_id); labelTracker.setText(R.string.osmo_connect_to_group_id);
labelName.setText(R.string.osmo_group_name); labelName.setText(R.string.osmo_group_name);
name.setHint(R.string.osmo_use_server_name); name.setHint(R.string.osmo_use_server_name);
name.setVisibility(View.GONE);
labelName.setVisibility(View.GONE);
mgv.setVisibility(View.VISIBLE); mgv.setVisibility(View.VISIBLE);
} }
} }
@ -833,6 +839,11 @@ 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();
final String nick = nickname.getText().toString(); final String nick = nickname.getText().toString();
if(id.length() == 0) {
app.showToastMessage(R.string.osmo_specify_tracker_id);
connectToDevice();
return;
}
if(device.isChecked()) { if(device.isChecked()) {
OsMoDevice dev = osMoPlugin.getGroups().addConnectedDevice(id, nameUser, OsMoDevice dev = osMoPlugin.getGroups().addConnectedDevice(id, nameUser,
ColorDialogs.getRandomColor()); ColorDialogs.getRandomColor());