diff --git a/SWADroid/res/layout/notifications.xml b/SWADroid/res/layout/notifications.xml
index f44fa6cd..1cd12a0c 100644
--- a/SWADroid/res/layout/notifications.xml
+++ b/SWADroid/res/layout/notifications.xml
@@ -17,8 +17,8 @@
+ android:layout_height="wrap_content">
\ No newline at end of file
diff --git a/SWADroid/res/layout/notifications_list_item.xml b/SWADroid/res/layout/notifications_list_item.xml
index 769e7a95..65e0f581 100644
--- a/SWADroid/res/layout/notifications_list_item.xml
+++ b/SWADroid/res/layout/notifications_list_item.xml
@@ -1,15 +1,15 @@
-
+ android:orientation="horizontal">
+ android:layout_marginTop="6dip" android:layout_alignParentLeft="true">
+ android:layout_marginTop="3dip" android:layout_toRightOf="@+id/eventMetaData" android:layout_toLeftOf="@+id/eventRight">
+ android:padding="1dip" />
-
\ No newline at end of file
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/Notifications.java b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/Notifications.java
index 6d8bd6a8..ae402a37 100644
--- a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/Notifications.java
+++ b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/Notifications.java
@@ -41,6 +41,7 @@ import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
+import android.widget.ListView;
import android.widget.TextView;
/**
@@ -111,6 +112,14 @@ public class Notifications extends Module {
runConnection();
}
+ /* (non-Javadoc)
+ * @see android.app.ListActivity#onListItemClick(android.widget.ListView, android.view.View, int, long)
+ */
+ @Override
+ protected void onListItemClick(ListView l, View v, int position, long id) {
+ super.onListItemClick(l, v, position, id);
+ }
+
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#onResume()
*/
@@ -159,11 +168,14 @@ public class Notifications extends Module {
Integer status = new Integer(pii.getProperty("status").toString());
Notification n = new Notification(lastId+i, eventType, eventTime, userSurname1, userSurname2, userFirstName, location, summary, status);
dbHelper.insertNotification(n);
- Log.d(Global.NOTIFICATIONS_TAG, n.toString());
+
+ if(isDebuggable)
+ Log.d(Global.NOTIFICATIONS_TAG, n.toString());
}
//Request finalized without errors
- Log.i(Global.NOTIFICATIONS_TAG, "Retrieved " + csSize + " notifications");
+ if(isDebuggable)
+ Log.i(Global.NOTIFICATIONS_TAG, "Retrieved " + csSize + " notifications");
//Clear old notifications to control database size
dbHelper.clearOldNotifications(SIZE_LIMIT);
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 9f41e55b..d6486bde 100644
--- a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsCursorAdapter.java
+++ b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsCursorAdapter.java
@@ -59,7 +59,7 @@ public class NotificationsCursorAdapter extends CursorAdapter {
TextView eventSender = (TextView) view.findViewById(R.id.eventSender);
TextView location = (TextView) view.findViewById(R.id.eventLocation);
TextView summary = (TextView) view.findViewById(R.id.eventSummary);
- ImageView icon = (ImageView) view.findViewById(R.id.notificationIcon);
+ ImageView notificationIcon = (ImageView) view.findViewById(R.id.notificationIcon);
if(eventType != null) {
type = cursor.getString(cursor.getColumnIndex("eventType"));
@@ -67,23 +67,23 @@ public class NotificationsCursorAdapter extends CursorAdapter {
if(type.equals("examAnnouncement"))
{
type = context.getString(R.string.examAnnouncement);
- icon.setImageResource(R.drawable.announce);
+ notificationIcon.setImageResource(R.drawable.announce);
} else if(type.equals("marksFile"))
{
type = context.getString(R.string.marksFile);
- icon.setImageResource(R.drawable.grades);
+ notificationIcon.setImageResource(R.drawable.grades);
} else if(type.equals("notice"))
{
type = context.getString(R.string.notice);
- icon.setImageResource(R.drawable.note);
+ notificationIcon.setImageResource(R.drawable.note);
} else if(type.equals("message"))
{
type = context.getString(R.string.message);
- icon.setImageResource(R.drawable.recmsg);
+ notificationIcon.setImageResource(R.drawable.recmsg);
} else if(type.equals("forumReply"))
{
type = context.getString(R.string.forumReply);
- icon.setImageResource(R.drawable.forum);;
+ notificationIcon.setImageResource(R.drawable.forum);
}
eventType.setText(type);
@@ -113,7 +113,7 @@ public class NotificationsCursorAdapter extends CursorAdapter {
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
LayoutInflater vi = LayoutInflater.from(context);
- View v = vi.inflate(R.layout.notifications_list_item, null);
+ View v = vi.inflate(R.layout.notifications_list_item, parent, false);
return v;
}