mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-19 20:29:02 +00:00
Merge: develop changes
This commit is contained in:
commit
1ccdf9852e
3 changed files with 34 additions and 4 deletions
|
|
@ -112,6 +112,9 @@
|
|||
|
||||
<string name="about.title">About</string>
|
||||
<string name="about.changelog">Changelog</string>
|
||||
<!-- Network Errors -->
|
||||
<string name="network_error_title">Connection Error</string>
|
||||
<string name="network_error_no_network_body">You are not connected to the internet.</string>
|
||||
|
||||
<string name="checklist.title.add">Add checklist</string>
|
||||
<string name="checklist.title.edit">Edit checklist</string>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.habitrpg.android.habitica;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
|
|
@ -204,15 +207,30 @@ public class APIHelper implements ErrorHandler, Profiler {
|
|||
|
||||
@Override
|
||||
public Throwable handleError(RetrofitError cause) {
|
||||
//String json = new String(((TypedByteArray)cause.getResponse().getBody()).getBytes());
|
||||
//Log.v("failure", json.toString());
|
||||
|
||||
retrofit.client.Response res = cause.getResponse();
|
||||
|
||||
retrofit.mime.TypedInput body = res.getBody();
|
||||
if (res != null) {
|
||||
retrofit.mime.TypedInput body = res.getBody();
|
||||
}
|
||||
|
||||
if (cause.isNetworkError()) {
|
||||
final Activity activity = (Activity) this.mContext;
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
new AlertDialog.Builder(activity)
|
||||
.setTitle(R.string.network_error_title)
|
||||
.setMessage(R.string.network_error_no_network_body)
|
||||
.setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}
|
||||
})
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
||||
//JsonSyntaxException d = (JsonSyntaxException)cause;
|
||||
}
|
||||
|
||||
return cause;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,15 @@ public class TagsAdapter extends TypeAdapter<Tags>{
|
|||
case END_OBJECT:
|
||||
in.endObject();
|
||||
isClosed=true;
|
||||
break;
|
||||
case BEGIN_ARRAY:
|
||||
in.beginArray();
|
||||
break;
|
||||
|
||||
case END_ARRAY:
|
||||
in.endArray();
|
||||
isClosed = true;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
} while(!isClosed);
|
||||
|
|
|
|||
Loading…
Reference in a new issue