Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-11-03 09:45:52 +01:00
commit 9d2da4cf5a
4 changed files with 63 additions and 44 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<tools:LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -11,24 +11,24 @@
android:id="@+id/osm_user_name_label" android:id="@+id/osm_user_name_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_marginLeft="24dp"
android:layout_marginRight="16dp" android:layout_marginRight="24dp"
android:text="@string/user_name"/> android:text="@string/user_name"/>
<EditText <EditText
android:id="@+id/user_name_field" android:id="@+id/user_name_field"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_marginLeft="24dp"
android:layout_marginRight="16dp"/> android:layout_marginRight="24dp"/>
<TextView <TextView
android:id="@+id/osm_user_password_label" android:id="@+id/osm_user_password_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_marginLeft="24dp"
android:layout_marginRight="16dp" android:layout_marginRight="24dp"
android:text="@string/user_password"/> android:text="@string/user_password"/>
<EditText <EditText
@ -36,7 +36,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp" android:layout_marginLeft="24dp"
android:layout_marginRight="16dp" android:layout_marginRight="24dp"
android:inputType="textPassword"/> android:inputType="textPassword"/>
</tools:LinearLayout> </LinearLayout>

View file

@ -4,17 +4,29 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:id="@+id/osm_note_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:text="@string/upload_osm_note_description" android:text="@string/upload_osm_note_description"
android:textSize="@dimen/default_desc_text_size"/> android:textSize="@dimen/default_desc_text_size"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -33,14 +45,17 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginBottom="16dp"
android:background="@color/divider_color"/> android:background="@color/divider_color"/>
</LinearLayout>
<TextView <TextView
android:id="@+id/message_label" android:id="@+id/message_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_marginLeft="24dp"
android:layout_marginRight="16dp" android:layout_marginRight="24dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="@string/osb_comment_dialog_message"/> android:text="@string/osb_comment_dialog_message"/>
@ -48,8 +63,8 @@
android:id="@+id/message_field" android:id="@+id/message_field"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_marginLeft="24dp"
android:layout_marginRight="16dp" android:layout_marginRight="24dp"
android:inputType="textMultiLine" android:inputType="textMultiLine"
android:minLines="1"/> android:minLines="1"/>
@ -57,8 +72,9 @@
android:id="@+id/close_change_set_checkbox" android:id="@+id/close_change_set_checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_marginLeft="24dp"
android:layout_marginRight="16dp" android:layout_marginRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/close_changeset"/> android:text="@string/close_changeset"/>
<include layout="@layout/osm_user_login_details"/> <include layout="@layout/osm_user_login_details"/>

View file

@ -10,6 +10,7 @@
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="upload_poi">Upload POI</string>
<string name="route_calculation">Route calculation</string> <string name="route_calculation">Route calculation</string>
<string name="gpx_no_tracks_title">You do not have tracks yet</string> <string name="gpx_no_tracks_title">You do not have tracks yet</string>
<string name="gpx_no_tracks_title_folder">You may also add tracks to the folder</string> <string name="gpx_no_tracks_title_folder">You may also add tracks to the folder</string>

View file

@ -59,17 +59,19 @@ public class SendPoiDialogFragment extends DialogFragment {
.getSettings(); .getSettings();
userNameEditText.setText(settings.USER_NAME.get()); userNameEditText.setText(settings.USER_NAME.get());
passwordEditText.setText(settings.USER_PASSWORD.get()); passwordEditText.setText(settings.USER_PASSWORD.get());
boolean hasOsmPOI = false; boolean hasPoiGroup = false;
assert poi != null; assert poi != null;
for (OsmPoint p : poi) { for (OsmPoint p : poi) {
if (p.getGroup() == OsmPoint.Group.POI) { if (p.getGroup() == OsmPoint.Group.POI) {
hasOsmPOI = true; hasPoiGroup = true;
break; break;
} }
} }
messageLabel.setVisibility(hasOsmPOI ? View.VISIBLE : View.GONE); final boolean hasPOI = hasPoiGroup;
messageEditText.setVisibility(hasOsmPOI ? View.VISIBLE : View.GONE); messageLabel.setVisibility(hasPOI ? View.VISIBLE : View.GONE);
closeChangeSetCheckBox.setVisibility(hasOsmPOI ? View.VISIBLE : View.GONE); messageEditText.setVisibility(hasPOI ? View.VISIBLE : View.GONE);
closeChangeSetCheckBox.setVisibility(hasPOI ? View.VISIBLE : View.GONE);
view.findViewById(R.id.osm_note_header).setVisibility(hasPOI ? View.GONE : View.VISIBLE);
uploadAnonymously.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { uploadAnonymously.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@ -87,7 +89,7 @@ public class SendPoiDialogFragment extends DialogFragment {
progressDialogPoiUploader = (ProgressDialogPoiUploader) getParentFragment(); progressDialogPoiUploader = (ProgressDialogPoiUploader) getParentFragment();
} }
builder.setTitle(R.string.upload_osm_note) builder.setTitle(hasPOI ? R.string.upload_poi : R.string.upload_osm_note)
.setView(view) .setView(view)
.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() { .setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
@Override @Override
@ -105,7 +107,7 @@ public class SendPoiDialogFragment extends DialogFragment {
} }
progressDialogPoiUploader.showProgressDialog(poi, progressDialogPoiUploader.showProgressDialog(poi,
closeChangeSetCheckBox.isChecked(), closeChangeSetCheckBox.isChecked(),
uploadAnonymously.isChecked()); !hasPOI && uploadAnonymously.isChecked());
} }
}) })
.setNegativeButton(R.string.shared_string_cancel, null); .setNegativeButton(R.string.shared_string_cancel, null);