Added notification details layout
git-svn-id: https://forja.rediris.es/svn/cusl6-swadroid/trunk@135 5bc14d19-1e4b-4ba2-aa50-860af135f48c
This commit is contained in:
parent
1d39498316
commit
53ae3c0db5
|
@ -17,8 +17,8 @@
|
|||
|
||||
<ListView
|
||||
android:id="@+id/android:list"
|
||||
android:cacheColorHint="@color/background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:listSelector="@android:color/transparent">
|
||||
android:layout_height="wrap_content">
|
||||
</ListView>
|
||||
</LinearLayout>
|
|
@ -1,15 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/background">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/eventMetaData"
|
||||
android:layout_height="wrap_content" android:layout_width="100dip" android:orientation="vertical"
|
||||
android:layout_marginTop="6dip">
|
||||
android:layout_marginTop="6dip" android:layout_alignParentLeft="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/notificationIcon"
|
||||
|
@ -46,8 +46,9 @@
|
|||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/eventContent"
|
||||
android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="vertical"
|
||||
android:layout_marginTop="3dip" android:layout_marginRight="6dip">
|
||||
android:layout_marginTop="3dip" android:layout_toRightOf="@+id/eventMetaData" android:layout_toLeftOf="@+id/eventRight">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/eventType"
|
||||
|
@ -71,6 +72,21 @@
|
|||
android:singleLine="false"
|
||||
android:textColor="@color/foreground1"
|
||||
android:textSize="16sp"
|
||||
android:padding="2dip" />
|
||||
android:padding="1dip" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/eventRight"
|
||||
android:layout_height="match_parent" android:layout_width="wrap_content" android:orientation="vertical"
|
||||
android:layout_marginTop="3dip" android:layout_marginRight="6dip" android:layout_alignParentRight="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/notificationDetailsIcon"
|
||||
android:src="@android:drawable/ic_input_add"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
</ImageView>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
|
@ -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,10 +168,13 @@ 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);
|
||||
|
||||
if(isDebuggable)
|
||||
Log.d(Global.NOTIFICATIONS_TAG, n.toString());
|
||||
}
|
||||
|
||||
//Request finalized without errors
|
||||
if(isDebuggable)
|
||||
Log.i(Global.NOTIFICATIONS_TAG, "Retrieved " + csSize + " notifications");
|
||||
|
||||
//Clear old notifications to control database size
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user