Formatting
This commit is contained in:
parent
f0ed7e4e25
commit
68b1ccb9db
2 changed files with 54 additions and 54 deletions
|
@ -1,57 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:id="@+id/messageEditTextLabel"
|
||||
android:text="@string/osb_comment_dialog_message"/>
|
||||
<TextView
|
||||
android:id="@+id/messageEditTextLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="@string/osb_comment_dialog_message" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/messageEditText"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:inputType="textMultiLine"
|
||||
android:minLines="1"/>
|
||||
<EditText
|
||||
android:id="@+id/messageEditText"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:inputType="textMultiLine"
|
||||
android:minLines="1" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/closeChangeSetCheckBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="@string/close_changeset"/>
|
||||
<CheckBox
|
||||
android:id="@+id/closeChangeSetCheckBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="@string/close_changeset" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="@string/user_name"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="@string/user_name" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userNameEditText"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"/>
|
||||
<EditText
|
||||
android:id="@+id/userNameEditText"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="@string/user_password"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="@string/user_password" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/passwordEditText"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:inputType="textPassword"/>
|
||||
<EditText
|
||||
android:id="@+id/passwordEditText"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:inputType="textPassword" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -40,12 +40,12 @@ public class OsmBugsRemoteUtil implements OsmBugsUtil {
|
|||
this.app = app;
|
||||
settings = app.getSettings();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public OsmBugResult commit(OsmNotesPoint point, String text, Action action) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
String msg = "";
|
||||
if(action == OsmPoint.Action.CREATE) {
|
||||
if (action == OsmPoint.Action.CREATE) {
|
||||
b.append(getNotesApi()).append("?"); //$NON-NLS-1$
|
||||
b.append("lat=").append(point.getLatitude()); //$NON-NLS-1$
|
||||
b.append("&lon=").append(point.getLongitude()); //$NON-NLS-1$
|
||||
|
@ -54,19 +54,19 @@ public class OsmBugsRemoteUtil implements OsmBugsUtil {
|
|||
} else {
|
||||
b.append(getNotesApi()).append("/");
|
||||
b.append(point.getId()); //$NON-NLS-1$
|
||||
if(action == OsmPoint.Action.REOPEN) {
|
||||
if (action == OsmPoint.Action.REOPEN) {
|
||||
b.append("/reopen");
|
||||
msg = "reopen note";
|
||||
} else if(action == OsmPoint.Action.MODIFY) {
|
||||
} else if (action == OsmPoint.Action.MODIFY) {
|
||||
b.append("/comment");
|
||||
msg = "adding comment";
|
||||
} else if(action == OsmPoint.Action.DELETE) {
|
||||
} else if (action == OsmPoint.Action.DELETE) {
|
||||
b.append("/close");
|
||||
msg = "close note";
|
||||
}
|
||||
b.append("?text=").append(URLEncoder.encode(text)); //$NON-NLS-1$
|
||||
}
|
||||
return editingPOI(b.toString(), "POST", msg);
|
||||
return editingPOI(b.toString(), "POST", msg);
|
||||
}
|
||||
|
||||
private OsmBugResult editingPOI(String url, String requestMethod, String userOperation) {
|
||||
|
@ -104,13 +104,13 @@ public class OsmBugsRemoteUtil implements OsmBugsUtil {
|
|||
log.info("Response : " + responseBody); //$NON-NLS-1$
|
||||
connection.disconnect();
|
||||
if (!ok) {
|
||||
r.warning = msg + "\n" + responseBody;
|
||||
r.warning = msg + "\n" + responseBody;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
// that's tricky case why NPE is thrown to fix that problem httpClient could be used
|
||||
String msg = app.getString(R.string.auth_failed);
|
||||
log.error(msg, e);
|
||||
r.warning = app.getString(R.string.auth_failed) + "";
|
||||
r.warning = app.getString(R.string.auth_failed) + "";
|
||||
} catch (MalformedURLException e) {
|
||||
log.error(userOperation + " " + app.getString(R.string.failed_op), e); //$NON-NLS-1$
|
||||
r.warning = e.getMessage() + "";
|
||||
|
|
Loading…
Reference in a new issue