Added navigation ability for HTML links in notifications
git-svn-id: https://forja.rediris.es/svn/cusl6-swadroid/trunk@238 5bc14d19-1e4b-4ba2-aa50-860af135f48c
This commit is contained in:
parent
1343d04146
commit
52041869f2
|
@ -96,6 +96,7 @@
|
||||||
android:textColor="@color/foreground1"
|
android:textColor="@color/foreground1"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:padding="1dip"
|
android:padding="1dip"
|
||||||
|
android:autoLink="web"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -76,6 +76,7 @@ public class NotificationsCursorAdapter extends CursorAdapter {
|
||||||
public void bindView(View view, Context context, Cursor cursor) {
|
public void bindView(View view, Context context, Cursor cursor) {
|
||||||
final Context ctx = context;
|
final Context ctx = context;
|
||||||
final Long notificationCode = cursor.getLong(cursor.getColumnIndex("id"));
|
final Long notificationCode = cursor.getLong(cursor.getColumnIndex("id"));
|
||||||
|
final Cursor curs = cursor;
|
||||||
long unixTime;
|
long unixTime;
|
||||||
String type, sender, senderFirstname, senderSurname1, senderSurname2, summaryText, contentText;
|
String type, sender, senderFirstname, senderSurname1, senderSurname2, summaryText, contentText;
|
||||||
String[] dateContent;
|
String[] dateContent;
|
||||||
|
@ -106,6 +107,18 @@ public class NotificationsCursorAdapter extends CursorAdapter {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OnClickListener contentListener = new OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
TextView content = (TextView) v.findViewById(R.id.eventText);
|
||||||
|
|
||||||
|
if(content.getSelectionStart() == -1 && content.getSelectionEnd() == -1) {
|
||||||
|
toggleContentVisibility(curs.getPosition());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
content.setOnClickListener(contentListener);
|
||||||
|
|
||||||
if(eventType != null) {
|
if(eventType != null) {
|
||||||
type = cursor.getString(cursor.getColumnIndex("eventType"));
|
type = cursor.getString(cursor.getColumnIndex("eventType"));
|
||||||
messageReplyButton.setVisibility(View.GONE);
|
messageReplyButton.setVisibility(View.GONE);
|
||||||
|
@ -226,8 +239,8 @@ public class NotificationsCursorAdapter extends CursorAdapter {
|
||||||
Intent activity = new Intent(ctx.getApplicationContext(), Marks.class);
|
Intent activity = new Intent(ctx.getApplicationContext(), Marks.class);
|
||||||
activity.putExtra("content", content.getText().toString());
|
activity.putExtra("content", content.getText().toString());
|
||||||
ctx.startActivity(activity);
|
ctx.startActivity(activity);
|
||||||
} else {
|
} else {
|
||||||
contentVisible[position] = !contentVisible[position];
|
contentVisible[position] = !contentVisible[position];
|
||||||
this.notifyDataSetChanged();
|
this.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user