Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
This commit is contained in:
commit
77b1f2138e
3 changed files with 9 additions and 5 deletions
|
@ -74,7 +74,6 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
|
||||||
protected void displayMessageStatusInfo(View view, Message message) {
|
protected void displayMessageStatusInfo(View view, Message message) {
|
||||||
TextView msgStatusTextView = (TextView) view.findViewById(R.id.dlgMsgDetMsgStatus);
|
TextView msgStatusTextView = (TextView) view.findViewById(R.id.dlgMsgDetMsgStatus);
|
||||||
int msgStatusResId;
|
int msgStatusResId;
|
||||||
int msgStatusColorResId = R.color.primaryText;
|
|
||||||
switch (message.getStatus()) {
|
switch (message.getStatus()) {
|
||||||
case Message.STATUS_WAITING:
|
case Message.STATUS_WAITING:
|
||||||
msgStatusResId = R.string.dlg_msg_details_msg_status_waiting;
|
msgStatusResId = R.string.dlg_msg_details_msg_status_waiting;
|
||||||
|
@ -87,7 +86,7 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
|
||||||
break;
|
break;
|
||||||
case Message.STATUS_SEND_FAILED:
|
case Message.STATUS_SEND_FAILED:
|
||||||
msgStatusResId = R.string.dlg_msg_details_msg_status_failed;
|
msgStatusResId = R.string.dlg_msg_details_msg_status_failed;
|
||||||
msgStatusColorResId = R.color.error;
|
msgStatusTextView.setTextColor(getContext().getResources().getColor(R.color.error));
|
||||||
break;
|
break;
|
||||||
case Message.STATUS_RECEIVED:
|
case Message.STATUS_RECEIVED:
|
||||||
msgStatusResId = R.string.dlg_msg_details_msg_status_received;
|
msgStatusResId = R.string.dlg_msg_details_msg_status_received;
|
||||||
|
@ -99,7 +98,6 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
|
||||||
msgStatusResId = R.string.dlg_msg_details_msg_status_sent;
|
msgStatusResId = R.string.dlg_msg_details_msg_status_sent;
|
||||||
}
|
}
|
||||||
msgStatusTextView.setText(msgStatusResId);
|
msgStatusTextView.setText(msgStatusResId);
|
||||||
msgStatusTextView.setTextColor(getContext().getResources().getColor(msgStatusColorResId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,6 +11,7 @@ import java.io.OutputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
|
|
||||||
|
@ -154,6 +155,7 @@ public class HttpUploadConnection implements Transferable {
|
||||||
|
|
||||||
private void upload() {
|
private void upload() {
|
||||||
OutputStream os = null;
|
OutputStream os = null;
|
||||||
|
InputStream errorStream = null;
|
||||||
HttpURLConnection connection = null;
|
HttpURLConnection connection = null;
|
||||||
PowerManager.WakeLock wakeLock = mHttpConnectionManager.createWakeLock("http_upload_"+message.getUuid());
|
PowerManager.WakeLock wakeLock = mHttpConnectionManager.createWakeLock("http_upload_"+message.getUuid());
|
||||||
try {
|
try {
|
||||||
|
@ -213,13 +215,17 @@ public class HttpUploadConnection implements Transferable {
|
||||||
mXmppConnectionService.resendMessage(message, delayed);
|
mXmppConnectionService.resendMessage(message, delayed);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
errorStream = connection.getErrorStream();
|
||||||
|
Logging.e("httpupload", "file upload failed: http code (" + code + ") " + new Scanner(errorStream).useDelimiter("\\A").next());
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Logging.d(Config.LOGTAG, e.getMessage());
|
errorStream = connection.getErrorStream();
|
||||||
|
Logging.e("httpupload", "http response: " + new Scanner(errorStream).useDelimiter("\\A").next() + ", exception message: " + e.getMessage());
|
||||||
fail();
|
fail();
|
||||||
} finally {
|
} finally {
|
||||||
StreamUtil.close(os);
|
StreamUtil.close(os);
|
||||||
|
StreamUtil.close(errorStream);
|
||||||
if (connection != null) {
|
if (connection != null) {
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
}
|
}
|
||||||
|
|
|
@ -364,7 +364,7 @@ public abstract class XmppActivity extends Activity {
|
||||||
mPrimaryTextColor = getResources().getColor(R.color.primaryText);
|
mPrimaryTextColor = getResources().getColor(R.color.primaryText);
|
||||||
mSecondaryTextColor = getResources().getColor(R.color.secondaryText);
|
mSecondaryTextColor = getResources().getColor(R.color.secondaryText);
|
||||||
mTertiaryTextColor = getResources().getColor(R.color.black12);
|
mTertiaryTextColor = getResources().getColor(R.color.black12);
|
||||||
mColorRed = getResources().getColor(R.color.warning);
|
mColorRed = getResources().getColor(R.color.error);
|
||||||
mColorOrange = getResources().getColor(R.color.orange500);
|
mColorOrange = getResources().getColor(R.color.orange500);
|
||||||
mColorGreen = getResources().getColor(R.color.online);
|
mColorGreen = getResources().getColor(R.color.online);
|
||||||
mPrimaryColor = getResources().getColor(R.color.primary);
|
mPrimaryColor = getResources().getColor(R.color.primary);
|
||||||
|
|
Loading…
Add table
Reference in a new issue