diff --git a/SWADroid/res/layout/notifications_list_item.xml b/SWADroid/res/layout/notifications_list_item.xml index c19ae353..1683b67b 100644 --- a/SWADroid/res/layout/notifications_list_item.xml +++ b/SWADroid/res/layout/notifications_list_item.xml @@ -96,6 +96,7 @@ android:textColor="@color/foreground1" android:textSize="16sp" android:padding="1dip" + android:autoLink="web" android:visibility="gone" /> \ No newline at end of file diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsCursorAdapter.java b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsCursorAdapter.java index 35dfb0d2..2acd24b0 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsCursorAdapter.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsCursorAdapter.java @@ -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(); } }