when doing html - \n has to be </br>
This commit is contained in:
parent
33292103e8
commit
8993c9ada7
1 changed files with 18 additions and 15 deletions
|
@ -301,6 +301,22 @@ public class TicketListActivity extends SherlockListActivity {
|
|||
|
||||
try {
|
||||
JSONObject pass_json = new JSONObject(FileHelper.file2String(new File(passbookParser.getPath() + "/pass.json")));
|
||||
|
||||
int size = (int) res.getResources().getDimension(R.dimen.pass_icon_size);
|
||||
ImageView icon_img = (ImageView) res.findViewById(R.id.icon);
|
||||
|
||||
if (passbookParser.getPath() != null) {
|
||||
Bitmap ico = passbookParser.getIconBitmap();
|
||||
|
||||
if (ico != null)
|
||||
icon_img.setImageBitmap(Bitmap.createScaledBitmap(ico, size, size, false));
|
||||
else
|
||||
icon_img.setImageBitmap(Bitmap.createScaledBitmap(ico, size, size, false));
|
||||
}
|
||||
|
||||
icon_img.setBackgroundColor(passbookParser.getBgcolor());
|
||||
|
||||
|
||||
tv.setText(pass_json.getString("description"));
|
||||
String more_str = "";
|
||||
|
||||
|
@ -321,14 +337,14 @@ public class TicketListActivity extends SherlockListActivity {
|
|||
JSONArray pri_arr = eventTicket.getJSONArray("primaryFields");
|
||||
for (int i = 0; i < pri_arr.length(); i++) {
|
||||
JSONObject sec_obj = pri_arr.getJSONObject(i);
|
||||
more_str += "<b>" + sec_obj.getString("label") + "</b>:" + sec_obj.getString("value") + "\n";
|
||||
more_str += "<b>" + sec_obj.getString("label") + "</b>:" + sec_obj.getString("value") + "<br/>";
|
||||
}
|
||||
}
|
||||
if (eventTicket.has("secondaryFields")) {
|
||||
JSONArray sec_arr = eventTicket.getJSONArray("secondaryFields");
|
||||
for (int i = 0; i < sec_arr.length(); i++) {
|
||||
JSONObject sec_obj = sec_arr.getJSONObject(i);
|
||||
more_str += "<b>" + sec_obj.getString("label") + "</b>: " + sec_obj.getString("value") + "\n";
|
||||
more_str += "<b>" + sec_obj.getString("label") + "</b>: " + sec_obj.getString("value") + "<br/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -336,19 +352,6 @@ public class TicketListActivity extends SherlockListActivity {
|
|||
more_tv.setText(Html.fromHtml(more_str));
|
||||
|
||||
|
||||
int size = (int) res.getResources().getDimension(R.dimen.pass_icon_size);
|
||||
ImageView icon_img = (ImageView) res.findViewById(R.id.icon);
|
||||
if (passbookParser.getPath() != null) {
|
||||
Bitmap ico = passbookParser.getIconBitmap();
|
||||
|
||||
if (ico != null)
|
||||
icon_img.setImageBitmap(Bitmap.createScaledBitmap(ico, size, size, false));
|
||||
|
||||
}
|
||||
|
||||
icon_img.setBackgroundColor(passbookParser.getBgcolor());
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue