Bugfixes + improved formatting

This commit is contained in:
Sathyanarayanan Gunasekaran 2011-07-06 21:31:36 +05:30 committed by n8fr8
parent e114be51d0
commit 841d83b3b4
1 changed files with 4 additions and 4 deletions

View File

@ -613,7 +613,6 @@ public class Orbot extends Activity implements TorConstants, OnLongClickListener
msg.getData().putString(HANDLER_TOR_MSG, getString(R.string.status_starting_up)); msg.getData().putString(HANDLER_TOR_MSG, getString(R.string.status_starting_up));
mHandler.sendMessage(msg); mHandler.sendMessage(msg);
trafficRow.setVisibility(RelativeLayout.VISIBLE);
} }
@ -745,6 +744,7 @@ public class Orbot extends Activity implements TorConstants, OnLongClickListener
case TorServiceConstants.MESSAGE_TRAFFIC_COUNT : case TorServiceConstants.MESSAGE_TRAFFIC_COUNT :
trafficRow.setVisibility(RelativeLayout.VISIBLE);
Bundle data = msg.getData(); Bundle data = msg.getData();
DataCount datacount = new DataCount(data.getLong("upload"),data.getLong("download")); DataCount datacount = new DataCount(data.getLong("upload"),data.getLong("download"));
downloadText.setText(formatCount(datacount.Download)); downloadText.setText(formatCount(datacount.Download));
@ -921,8 +921,8 @@ public class Orbot extends Activity implements TorConstants, OnLongClickListener
// Under 2Mb, returns "xxx.xKb" // Under 2Mb, returns "xxx.xKb"
// Over 2Mb, returns "xxx.xxMb" // Over 2Mb, returns "xxx.xxMb"
if (count < 1e6 * 2) if (count < 1e6 * 2)
return ((float)((int)(count*10/1024))/10 + "kB"); return ((float)((int)(count*10/1024))/10 + " kbps");
return ((float)((int)(count*100/1024/1024))/100 + "MB"); return ((float)((int)(count*100/1024/1024))/100 + " mbps");
//return count+" kB"; //return count+" kB";
} }