2012-05-29 Santiago Munin <burnin1@gmail.com>
*src/pandrod_event_viewer/pandorafms/EventList.java: Now tags are links to their urls (if have). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6357 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
cd8828798c
commit
e89220a11c
|
@ -1,3 +1,7 @@
|
|||
2012-05-29 Santiago Munín <burnin1@gmail.com>
|
||||
|
||||
*src/pandrod_event_viewer/pandorafms/EventList.java: Now tags are links to their urls (if have).
|
||||
|
||||
2012-05-25 Santiago Munín <burning1@gmail.com>
|
||||
|
||||
* src/pandroid_event_viewer/pandorafms/Options.java: Added the option to show or hide advanced options (filter view).
|
||||
|
|
|
@ -34,10 +34,11 @@
|
|||
<ImageView
|
||||
android:layout_weight="0"
|
||||
android:id="@+id/img_severity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:paddingRight="5px"
|
||||
android:contentDescription="@string/img_severity"
|
||||
android:paddingRight="5dp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/severity_text"
|
||||
|
@ -62,10 +63,11 @@
|
|||
<ImageView
|
||||
android:layout_weight="0"
|
||||
android:id="@+id/img_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:paddingRight="5px"
|
||||
android:contentDescription="@string/img_type"
|
||||
android:paddingRight="0dp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/type_text"
|
||||
|
@ -108,7 +110,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:paddingRight="5px"
|
||||
android:contentDescription="@string/img_group"
|
||||
android:paddingRight="5dp"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_weight="1"
|
||||
|
@ -143,7 +146,7 @@
|
|||
<TextView
|
||||
android:id="@+id/comments_text"
|
||||
android:textColor="#000"
|
||||
android:text="- Empty -"
|
||||
android:text="@string/empty"
|
||||
android:singleLine="false"
|
||||
android:layout_width="wrap_content"
|
||||
/>
|
||||
|
@ -157,7 +160,9 @@
|
|||
<TextView
|
||||
android:id="@+id/tags_text"
|
||||
android:textColor="#000"
|
||||
android:text="- Empty -"
|
||||
android:text="@string/empty"
|
||||
android:linksClickable="true"
|
||||
|
||||
/>
|
||||
</TableRow>
|
||||
<TableRow
|
||||
|
|
|
@ -98,4 +98,8 @@
|
|||
<string name="silence">Silence</string>
|
||||
<string name="tag_label_str">Tag</string>
|
||||
<string name="advanced_options">Show advanced search options</string>
|
||||
<string name="empty">- Empty -</string>
|
||||
<string name="img_severity">Severity image</string>
|
||||
<string name="img_group">Group image</string>
|
||||
<string name="img_type">Type image</string>
|
||||
</resources>
|
|
@ -485,7 +485,26 @@ public class EventList extends ListActivity {
|
|||
if (item.tags.length() != 0) {
|
||||
text = (TextView) viewEventExtended
|
||||
.findViewById(R.id.tags_text);
|
||||
text.setText(item.tags);
|
||||
String[] tags = item.tags.split(",");
|
||||
String tagText = "";
|
||||
for (int i = 0; i < tags.length; i++) {
|
||||
String parts[] = tags[i].split(" ");
|
||||
if (i > 0) {
|
||||
tagText += ", ";
|
||||
}
|
||||
if (parts.length == 2) {
|
||||
if (!parts[1].startsWith("http://")) {
|
||||
parts[1] = "http://" + parts[1];
|
||||
}
|
||||
tagText += "<a href=\"" + parts[1] + "\">"
|
||||
+ parts[0] + "</a>";
|
||||
} else {
|
||||
tagText += parts[0];
|
||||
}
|
||||
}
|
||||
// TODO ask miguel (links are not returned)
|
||||
text.setText(Html.fromHtml(tagText));
|
||||
text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
if (item.user_comment.length() != 0) {
|
||||
|
@ -518,8 +537,6 @@ public class EventList extends ListActivity {
|
|||
.fromHtml("<a href='"
|
||||
+ this.object.url
|
||||
+ "/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente="
|
||||
// "/mobile/index.php?page=agent&id="
|
||||
// //The link to Pandora Console Mobile
|
||||
+ item.id_agent + "'>"
|
||||
+ item.agent_name + "</a>"));
|
||||
text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
|
Loading…
Reference in New Issue