Added navigation ability for HTML links in notifications
This commit is contained in:
parent
e0d1f6bb06
commit
23fac9b0cd
|
@ -96,6 +96,7 @@
|
|||
android:textColor="@color/foreground1"
|
||||
android:textSize="16sp"
|
||||
android:padding="1dip"
|
||||
android:autoLink="web"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -76,6 +76,7 @@ public class NotificationsCursorAdapter extends CursorAdapter {
|
|||
public void bindView(View view, Context context, Cursor cursor) {
|
||||
final Context ctx = context;
|
||||
final Long notificationCode = cursor.getLong(cursor.getColumnIndex("id"));
|
||||
final Cursor curs = cursor;
|
||||
long unixTime;
|
||||
String type, sender, senderFirstname, senderSurname1, senderSurname2, summaryText, contentText;
|
||||
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) {
|
||||
type = cursor.getString(cursor.getColumnIndex("eventType"));
|
||||
messageReplyButton.setVisibility(View.GONE);
|
||||
|
@ -226,8 +239,8 @@ public class NotificationsCursorAdapter extends CursorAdapter {
|
|||
Intent activity = new Intent(ctx.getApplicationContext(), Marks.class);
|
||||
activity.putExtra("content", content.getText().toString());
|
||||
ctx.startActivity(activity);
|
||||
} else {
|
||||
contentVisible[position] = !contentVisible[position];
|
||||
} else {
|
||||
contentVisible[position] = !contentVisible[position];
|
||||
this.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user