Added main menu and notifications action bars

git-svn-id: https://forja.rediris.es/svn/cusl6-swadroid/trunk@129 5bc14d19-1e4b-4ba2-aa50-860af135f48c
This commit is contained in:
Juan Miguel Boyero Corral 2011-11-22 22:11:19 +00:00
parent 8d913af525
commit 5deaf3ec01
18 changed files with 247 additions and 153 deletions

View File

@ -2,10 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="es.ugr.swad.swadroid"
android:installLocation="auto" android:versionCode="10" android:versionName="0.3.4">
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher_swadroid" android:debuggable="false">
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher_swadroid" android:debuggable="true">
<activity android:name=".SWADMain"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher_swadroid" android:configChanges="keyboard|keyboardHidden|orientation">
android:icon="@drawable/ic_launcher_swadroid" android:configChanges="keyboard|keyboardHidden|orientation" android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
@ -20,7 +20,7 @@
android:label="@string/loginModuleLabel" android:configChanges="keyboard|keyboardHidden|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar">
</activity>
<activity android:name=".modules.Courses" android:theme="@android:style/Theme.Translucent.NoTitleBar"><activity android:name=".modules.Courses" android:theme="@android:style/Theme.Dialog"></activity></activity>
<activity android:label="@string/notificationsModuleLabel" android:name=".modules.notifications.Notifications"></activity>
<activity android:label="@string/notificationsModuleLabel" android:name=".modules.notifications.Notifications" android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name=".modules.tests.Tests"></activity>
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

View File

@ -9,93 +9,109 @@ package es.ugr.swad.swadroid;
public final class R {
public static final class array {
public static final int functions=0x7f050000;
public static final int functions=0x7f060000;
}
public static final class attr {
}
public static final class color {
public static final int background=0x7f050004;
public static final int foreground1=0x7f050002;
public static final int foreground2=0x7f050003;
public static final int title_background=0x7f050000;
public static final int title_separator=0x7f050005;
public static final int title_text=0x7f050001;
}
public static final class drawable {
public static final int announce=0x7f020000;
public static final int erroricon=0x7f020001;
public static final int forum=0x7f020002;
public static final int grades=0x7f020003;
public static final int ic_launcher_swadroid=0x7f020004;
public static final int note=0x7f020005;
public static final int notif=0x7f020006;
public static final int notif36x36=0x7f020007;
public static final int recmsg=0x7f020008;
public static final int test=0x7f020009;
public static final int btn_bg_pressed=0x7f020001;
public static final int btn_bg_selected=0x7f020002;
public static final int erroricon=0x7f020003;
public static final int forum=0x7f020004;
public static final int grades=0x7f020005;
public static final int ic_launcher_swadroid=0x7f020006;
public static final int note=0x7f020007;
public static final int notif=0x7f020008;
public static final int recmsg=0x7f020009;
public static final int test=0x7f02000a;
public static final int title_button=0x7f02000b;
public static final int title_refresh=0x7f02000c;
}
public static final class id {
public static final int eventDate=0x7f080004;
public static final int eventLocation=0x7f080008;
public static final int eventSender=0x7f080006;
public static final int eventSummary=0x7f080009;
public static final int eventTime=0x7f080005;
public static final int eventType=0x7f080007;
public static final int functionIcon=0x7f080000;
public static final int functionText=0x7f080001;
public static final int notificationIcon=0x7f080003;
public static final int notificationsUpdateButton=0x7f080002;
public static final int preferences_menu=0x7f08000a;
public static final int eventDate=0x7f090008;
public static final int eventLocation=0x7f09000c;
public static final int eventSender=0x7f09000a;
public static final int eventSummary=0x7f09000d;
public static final int eventTime=0x7f090009;
public static final int eventType=0x7f09000b;
public static final int functionIcon=0x7f090004;
public static final int functionText=0x7f090005;
public static final int moduleIcon=0x7f090000;
public static final int moduleName=0x7f090001;
public static final int notificationIcon=0x7f090007;
public static final int notificationsUpdateButton=0x7f090006;
public static final int preferences_menu=0x7f09000e;
public static final int refresh=0x7f090003;
public static final int title_sep_1=0x7f090002;
}
public static final class layout {
public static final int functions_list_item=0x7f030000;
public static final int main=0x7f030001;
public static final int notifications=0x7f030002;
public static final int notifications_list_item=0x7f030003;
public static final int action_bar=0x7f030000;
public static final int functions_list_item=0x7f030001;
public static final int main=0x7f030002;
public static final int notifications=0x7f030003;
public static final int notifications_list_item=0x7f030004;
}
public static final class menu {
public static final int menu_main=0x7f070000;
public static final int menu_main=0x7f080000;
}
public static final class string {
public static final int app_name=0x7f060000;
public static final int close_dialog=0x7f060005;
public static final int content=0x7f060026;
public static final int coursesModuleLabel=0x7f060003;
public static final int coursesProgressDescription=0x7f060018;
public static final int coursesProgressTitle=0x7f060017;
public static final int dateMsg=0x7f060028;
public static final int errorConnectionMsg=0x7f06002e;
public static final int errorCopyMsg_DB=0x7f06001b;
public static final int errorMsgLaunchingActivity=0x7f060019;
public static final int errorMsgNoConnection=0x7f06001c;
public static final int errorMsgWorkaroundEmulator=0x7f06001a;
public static final int errorServerResponseMsg=0x7f06002d;
public static final int errorTimeoutMsg=0x7f06002f;
public static final int examAnnouncement=0x7f060021;
public static final int firstRunMsg=0x7f06002b;
public static final int forumReply=0x7f060025;
public static final int fromMsg=0x7f060027;
public static final int initialDialogTitle=0x7f06002c;
public static final int loginModuleLabel=0x7f060001;
public static final int loginProgressDescription=0x7f060014;
public static final int loginProgressTitle=0x7f060013;
public static final int loginSuccessfulMsg=0x7f06001e;
public static final int loginTitle_menu=0x7f060012;
public static final int marksFile=0x7f060022;
public static final int message=0x7f060024;
public static final int noMsg=0x7f06002a;
public static final int notice=0x7f060023;
public static final int notificationsModuleLabel=0x7f060002;
public static final int notificationsProgressDescription=0x7f060016;
public static final int notificationsProgressTitle=0x7f060015;
public static final int notificationsSuccessfulMsg=0x7f06001f;
public static final int notificationsUpdateButton=0x7f060020;
public static final int preferencesTitle_menu=0x7f060011;
public static final int saveMsg_preferences=0x7f06000e;
public static final int saveSummary_preferences=0x7f06000f;
public static final int saveTitle_preferences=0x7f060010;
public static final int set_preferences=0x7f060006;
public static final int title_error_dialog=0x7f060004;
public static final int upgradeMsg_DB=0x7f06001d;
public static final int userIDName_preferences=0x7f060008;
public static final int userIDSummary_preferences=0x7f060009;
public static final int userIDTitle_preferences=0x7f06000a;
public static final int userPasswordName_preferences=0x7f06000b;
public static final int userPasswordSummary_preferences=0x7f06000c;
public static final int userPasswordTitle_preferences=0x7f06000d;
public static final int user_preferences=0x7f060007;
public static final int yesMsg=0x7f060029;
public static final int app_name=0x7f070000;
public static final int close_dialog=0x7f070005;
public static final int content=0x7f070026;
public static final int coursesModuleLabel=0x7f070003;
public static final int coursesProgressDescription=0x7f070018;
public static final int coursesProgressTitle=0x7f070017;
public static final int dateMsg=0x7f070028;
public static final int errorConnectionMsg=0x7f07002e;
public static final int errorCopyMsg_DB=0x7f07001b;
public static final int errorMsgLaunchingActivity=0x7f070019;
public static final int errorMsgNoConnection=0x7f07001c;
public static final int errorMsgWorkaroundEmulator=0x7f07001a;
public static final int errorServerResponseMsg=0x7f07002d;
public static final int errorTimeoutMsg=0x7f07002f;
public static final int examAnnouncement=0x7f070021;
public static final int firstRunMsg=0x7f07002b;
public static final int forumReply=0x7f070025;
public static final int fromMsg=0x7f070027;
public static final int initialDialogTitle=0x7f07002c;
public static final int loginModuleLabel=0x7f070001;
public static final int loginProgressDescription=0x7f070014;
public static final int loginProgressTitle=0x7f070013;
public static final int loginSuccessfulMsg=0x7f07001e;
public static final int loginTitle_menu=0x7f070012;
public static final int marksFile=0x7f070022;
public static final int message=0x7f070024;
public static final int noMsg=0x7f07002a;
public static final int notice=0x7f070023;
public static final int notificationsModuleLabel=0x7f070002;
public static final int notificationsProgressDescription=0x7f070016;
public static final int notificationsProgressTitle=0x7f070015;
public static final int notificationsSuccessfulMsg=0x7f07001f;
public static final int notificationsUpdateButton=0x7f070020;
public static final int preferencesTitle_menu=0x7f070011;
public static final int saveMsg_preferences=0x7f07000e;
public static final int saveSummary_preferences=0x7f07000f;
public static final int saveTitle_preferences=0x7f070010;
public static final int set_preferences=0x7f070006;
public static final int title_error_dialog=0x7f070004;
public static final int upgradeMsg_DB=0x7f07001d;
public static final int userIDName_preferences=0x7f070008;
public static final int userIDSummary_preferences=0x7f070009;
public static final int userIDTitle_preferences=0x7f07000a;
public static final int userPasswordName_preferences=0x7f07000b;
public static final int userPasswordSummary_preferences=0x7f07000c;
public static final int userPasswordTitle_preferences=0x7f07000d;
public static final int user_preferences=0x7f070007;
public static final int yesMsg=0x7f070029;
}
public static final class xml {
public static final int preferences=0x7f040000;

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/btn_bg_pressed"/>
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/btn_bg_pressed"/>
<item android:state_focused="true" android:drawable="@drawable/btn_bg_selected"/>
<item android:state_focused="false" android:state_pressed="false" android:drawable="@android:color/transparent"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="50dip"
android:background="@color/title_background">
<!-- Logo -->
<ImageView
android:id="@+id/moduleIcon"
android:layout_height="35dip"
android:layout_width="35dip"
android:scaleType="centerCrop"
android:layout_centerVertical="true"
android:layout_marginLeft="12dip">
</ImageView>
<!-- Title -->
<TextView
android:id="@+id/moduleName"
android:layout_toRightOf="@+id/moduleIcon"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:textColor="@color/title_text"
android:textSize="18sp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:padding="8dp">
</TextView>
<!-- Right buttons -->
<ImageView
android:id="@+id/title_sep_1"
android:layout_toLeftOf="@+id/refresh"
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_alignWithParentIfMissing="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:background="@color/title_separator"
android:visibility="gone"/>
<ImageButton
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignWithParentIfMissing="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/title_refresh"
android:onClick="onRefreshClick"
android:background="@drawable/title_button"
android:visibility="gone"/>
</RelativeLayout>

View File

@ -4,7 +4,7 @@
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#ffffff">
android:background="@color/background">
<ImageView
android:id="@+id/functionIcon"
@ -19,7 +19,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="20dip"
android:textColor="#000000"
android:textColor="@color/foreground1"
android:textSize="24sp">
</TextView>
</LinearLayout>

View File

@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background">
<include layout="@layout/action_bar"/>
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ListView>
</LinearLayout>

View File

@ -1,20 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background">
<include layout="@layout/action_bar"/>
<Button
android:id="@+id/notificationsUpdateButton"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="@string/notificationsUpdateButton"
android:layout_gravity="center_horizontal"/>
android:layout_gravity="center_horizontal"
android:visibility="gone">
</Button>
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:listSelector="@android:color/transparent" />
android:listSelector="@android:color/transparent">
</ListView>
</LinearLayout>

View File

@ -4,7 +4,7 @@
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#ffffff">
android:background="@color/background">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
@ -14,7 +14,7 @@
<ImageView
android:id="@+id/notificationIcon"
android:gravity="center_horizontal"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ImageView>
@ -23,7 +23,7 @@
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center_horizontal"
android:textColor="#848484"
android:textColor="@color/foreground2"
android:layout_marginTop="6dip" />
<TextView
@ -31,7 +31,7 @@
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center_horizontal"
android:textColor="#848484" />
android:textColor="@color/foreground2" />
<TextView
android:id="@+id/eventSender"
@ -39,7 +39,7 @@
android:layout_width="match_parent"
android:singleLine="false"
android:gravity="center_horizontal"
android:textColor="#848484"
android:textColor="@color/foreground2"
android:layout_marginBottom="6dip"
android:padding="1dip" />
</LinearLayout>
@ -53,7 +53,7 @@
android:id="@+id/eventType"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textColor="#000000"
android:textColor="@color/foreground1"
android:textSize="18sp"
android:textStyle="bold" />
@ -61,7 +61,7 @@
android:id="@+id/eventLocation"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textColor="#000000"
android:textColor="@color/foreground1"
android:padding="1dip" />
<TextView
@ -69,7 +69,7 @@
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:singleLine="false"
android:textColor="#000000"
android:textColor="@color/foreground1"
android:textSize="16sp"
android:padding="2dip" />
</LinearLayout>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Needs to remove the "s" from "https" for the menus -->
<menu xmlns:android="http://schemas.android.com/apk/res/android"><item android:id="@+id/preferences_menu"
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/preferences_menu"
android:title="@string/preferencesTitle_menu"
android:icon="@android:drawable/ic_menu_manage">
</item>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="title_background">#81bef7</color>
<color name="title_text">#ffffffff</color>
<color name="foreground1">#000000</color>
<color name="foreground2">#848484</color>
<color name="background">#ffffffff</color>
<color name="title_separator">#ffffff</color>
</resources>

View File

@ -31,10 +31,9 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import es.ugr.swad.swadroid.model.DataBaseHelper;
import es.ugr.swad.swadroid.modules.notifications.Notifications;
@ -192,20 +191,27 @@ public class SWADMain extends ListActivity {
public void onCreate(Bundle icicle) {
int lastVersion, currentVersion;
FunctionsArrayAdapter<String> functionsArray;
ImageView image;
TextView text;
//Initialize screen
super.onCreate(icicle);
setContentView(R.layout.main);
/*Window w = getWindow();
w.requestFeature(Window.FEATURE_LEFT_ICON);
w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher_swadroid);*/
try {
//Initialize screen
super.onCreate(icicle);
Window w = getWindow();
w.requestFeature(Window.FEATURE_LEFT_ICON);
setContentView(R.layout.main);
w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher_swadroid);
functions = getResources().getStringArray(R.array.functions);
functionsArray = new FunctionsArrayAdapter<String>(this, R.layout.functions_list_item, functions);
setListAdapter(functionsArray);
image = (ImageView)this.findViewById(R.id.moduleIcon);
image.setBackgroundResource(R.drawable.ic_launcher_swadroid);
text = (TextView)this.findViewById(R.id.moduleName);
text.setText(R.string.app_name);
functions = getResources().getStringArray(R.array.functions);
functionsArray = new FunctionsArrayAdapter<String>(this, R.layout.functions_list_item, functions);
setListAdapter(functionsArray);
try {
//Initialize database
db = DataFramework.getInstance();
db.open(this, this.getPackageName());

View File

@ -34,7 +34,6 @@ import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Window;
import android.widget.Toast;
import es.ugr.swad.swadroid.Global;
import es.ugr.swad.swadroid.Preferences;
@ -271,10 +270,6 @@ public abstract class Module extends ListActivity {
super.onCreate(savedInstanceState);
prefs.getPreferences(getBaseContext());
Window w = getWindow();
w.requestFeature(Window.FEATURE_LEFT_ICON);
w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher_swadroid);
//If not connected to database, connect now
if(dbHelper == null) {
try {

View File

@ -39,8 +39,9 @@ import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
/**
* Notifications module for get user's notifications
@ -52,10 +53,6 @@ public class Notifications extends Module {
* Max size to store notifications
*/
private static final int SIZE_LIMIT = 25;
/**
* Downloads new notifications when pushed
*/
private Button updateButton;
/**
* Notifications adapter for showing the data
*/
@ -77,16 +74,25 @@ public class Notifications extends Module {
* @see es.ugr.swad.swadroid.modules.Module#onCreate(android.os.Bundle)
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(Bundle savedInstanceState) {
ImageButton updateButton;
ImageView image;
TextView text;
super.onCreate(savedInstanceState);
setContentView(R.layout.notifications);
updateButton = (Button)this.findViewById(R.id.notificationsUpdateButton);
updateButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
runConnection();
}
});
image = (ImageView)this.findViewById(R.id.moduleIcon);
image.setBackgroundResource(R.drawable.notif);
text = (TextView)this.findViewById(R.id.moduleName);
text.setText(R.string.notificationsModuleLabel);
image = (ImageView)this.findViewById(R.id.title_sep_1);
image.setVisibility(View.VISIBLE);
updateButton = (ImageButton)this.findViewById(R.id.refresh);
updateButton.setVisibility(View.VISIBLE);
//dbHelper.emptyTable(Global.DB_TABLE_NOTIFICATIONS);
dbCursor = dbHelper.getDb().getCursor(Global.DB_TABLE_NOTIFICATIONS, selection, orderby);
@ -95,6 +101,15 @@ public class Notifications extends Module {
setMETHOD_NAME("getNotifications");
}
/**
* Launches an action when refresh button is pushed
* @param v Actual view
*/
public void onRefreshClick(View v)
{
runConnection();
}
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#onResume()

View File

@ -22,7 +22,6 @@ import java.util.Date;
import es.ugr.swad.swadroid.R;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Color;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
@ -36,13 +35,7 @@ import android.widget.TextView;
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
*
*/
public class NotificationsCursorAdapter extends CursorAdapter {
private static final String EXAM_ANNOUNCEMENT_COLOR = "#380B61";
private static final String MARKS_FILE_COLOR = "#4B088A";
private static final String NOTICE_COLOR = "#08088A";
private static final String MESSAGE_COLOR = "#0B615E";
private static final String FORUM_REPLY_COLOR = "#0B0B3B";
public class NotificationsCursorAdapter extends CursorAdapter {
public NotificationsCursorAdapter(Context context, Cursor c) {
super(context, c);
}
@ -56,7 +49,7 @@ public class NotificationsCursorAdapter extends CursorAdapter {
@Override
public void bindView(View view, Context context, Cursor cursor) {
long unixTime;
String type, sender, from, dateTitle, summaryTitle, summaryText;
String type, sender, summaryText;
String[] dateContent;
Date d;
@ -75,27 +68,22 @@ public class NotificationsCursorAdapter extends CursorAdapter {
{
type = context.getString(R.string.examAnnouncement);
icon.setImageResource(R.drawable.announce);
//view.setBackgroundColor(Color.parseColor(EXAM_ANNOUNCEMENT_COLOR));
} else if(type.equals("marksFile"))
{
type = context.getString(R.string.marksFile);
icon.setImageResource(R.drawable.grades);
//view.setBackgroundColor(Color.parseColor(MARKS_FILE_COLOR));
} else if(type.equals("notice"))
{
type = context.getString(R.string.notice);
icon.setImageResource(R.drawable.note);
//view.setBackgroundColor(Color.parseColor(NOTICE_COLOR));
} else if(type.equals("message"))
{
type = context.getString(R.string.message);
icon.setImageResource(R.drawable.recmsg);
//view.setBackgroundColor(Color.parseColor(MESSAGE_COLOR));
} else if(type.equals("forumReply"))
{
type = context.getString(R.string.forumReply);
icon.setImageResource(R.drawable.forum);
//view.setBackgroundColor(Color.parseColor(FORUM_REPLY_COLOR));
icon.setImageResource(R.drawable.forum);;
}
eventType.setText(type);
@ -103,7 +91,6 @@ public class NotificationsCursorAdapter extends CursorAdapter {
if((eventDate != null) && (eventTime != null)){
unixTime = Long.parseLong(cursor.getString(cursor.getColumnIndex("eventTime")));
d = new Date(unixTime * 1000);
//dateTitle = context.getString(R.string.dateMsg);
dateContent = d.toLocaleString().split(" ");
eventDate.setText(dateContent[0]);
eventTime.setText(dateContent[1]);
@ -112,14 +99,12 @@ public class NotificationsCursorAdapter extends CursorAdapter {
sender = cursor.getString(cursor.getColumnIndex("userFirstname")) + " "
+ cursor.getString(cursor.getColumnIndex("userSurname1")) + " "
+ cursor.getString(cursor.getColumnIndex("userSurname2"));
//from = context.getString(R.string.fromMsg);
eventSender.setText(sender);
}
if(location != null) {
location.setText(cursor.getString(cursor.getColumnIndex("location")));
}
if(summary != null){
//summaryTitle = context.getString(R.string.content);
summaryText = cursor.getString(cursor.getColumnIndex("summary"));
summary.setText(Html.fromHtml(summaryText));
}