Merge branch 'release/0.5'

This commit is contained in:
Juan Miguel Boyero Corral 2011-09-26 23:17:58 +02:00
commit a09c34535c
33 changed files with 561 additions and 187 deletions

4
.gitignore vendored
View File

@ -3,4 +3,8 @@ SWADroid/default.properties
SWADroid/.classpath
SWADroid/.project
SWADroid/.settings/
capturas/
iconos/
gitstats/
SWADroidTest/
SWADroid.apk

View File

@ -1,3 +1,8 @@
## 0.5 (2011-09-26)
* Added messages module
* Minor fixes
## 0.4.5 (2011-07-08)
* Optimized questions syncronization

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="es.ugr.swad.swadroid"
android:installLocation="auto" android:versionName="0.4.5" android:versionCode="22">
android:installLocation="auto" android:versionCode="23" android:versionName="0.5">
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher_swadroid" android:debuggable="true">
<activity android:name=".SWADMain"
android:label="@string/app_name"
@ -19,11 +19,12 @@
android:name=".modules.Login"
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:name=".modules.Courses" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="@string/coursesModuleLabel"><activity android:name=".modules.Courses" android:theme="@android:style/Theme.Dialog"></activity></activity>
<activity android:label="@string/notificationsModuleLabel" android:name=".modules.notifications.Notifications" android:theme="@android:style/Theme.NoTitleBar">
</activity><activity android:name=".modules.tests.Tests" android:theme="@android:style/Theme.NoTitleBar" android:label="@string/testsModuleLabel"></activity>
<activity android:label="@string/testsModuleLabel" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:name=".modules.tests.TestsQuestionsDownload"><activity android:label="@string/testsModuleLabel" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:name=".modules.tests.TestsQuestionsDownload"></activity></activity>
<activity android:name=".modules.tests.TestsConfigDownload" android:label="@string/testsModuleLabel" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity><activity android:theme="@android:style/Theme.NoTitleBar" android:label="@string/testsModuleLabel" android:configChanges="orientation" android:name=".modules.tests.TestsMake"></activity>
<activity android:theme="@android:style/Theme.Translucent.NoTitleBar" android:name=".modules.Messages" android:label="@string/messagesModuleLabel" android:configChanges="keyboard|keyboardHidden|orientation"></activity>
</application>

View File

@ -38,80 +38,87 @@ public final class R {
public static final int forward=0x7f020008;
public static final int grades=0x7f020009;
public static final int ic_launcher_swadroid=0x7f02000a;
public static final int msg=0x7f02000b;
public static final int note=0x7f02000c;
public static final int notif=0x7f02000d;
public static final int recmsg=0x7f02000e;
public static final int survey=0x7f02000f;
public static final int test=0x7f020010;
public static final int timepicker_down_btn=0x7f020011;
public static final int timepicker_down_disabled=0x7f020012;
public static final int timepicker_down_disabled_focused=0x7f020013;
public static final int timepicker_down_normal=0x7f020014;
public static final int timepicker_down_pressed=0x7f020015;
public static final int timepicker_down_selected=0x7f020016;
public static final int timepicker_input=0x7f020017;
public static final int timepicker_input_disabled=0x7f020018;
public static final int timepicker_input_normal=0x7f020019;
public static final int timepicker_input_pressed=0x7f02001a;
public static final int timepicker_input_selected=0x7f02001b;
public static final int timepicker_up_btn=0x7f02001c;
public static final int timepicker_up_disabled=0x7f02001d;
public static final int timepicker_up_disabled_focused=0x7f02001e;
public static final int timepicker_up_normal=0x7f02001f;
public static final int timepicker_up_pressed=0x7f020020;
public static final int timepicker_up_selected=0x7f020021;
public static final int title_button=0x7f020022;
public static final int title_refresh=0x7f020023;
public static final int message_reply=0x7f02000b;
public static final int msg=0x7f02000c;
public static final int note=0x7f02000d;
public static final int notif=0x7f02000e;
public static final int recmsg=0x7f02000f;
public static final int survey=0x7f020010;
public static final int test=0x7f020011;
public static final int timepicker_down_btn=0x7f020012;
public static final int timepicker_down_disabled=0x7f020013;
public static final int timepicker_down_disabled_focused=0x7f020014;
public static final int timepicker_down_normal=0x7f020015;
public static final int timepicker_down_pressed=0x7f020016;
public static final int timepicker_down_selected=0x7f020017;
public static final int timepicker_input=0x7f020018;
public static final int timepicker_input_disabled=0x7f020019;
public static final int timepicker_input_normal=0x7f02001a;
public static final int timepicker_input_pressed=0x7f02001b;
public static final int timepicker_input_selected=0x7f02001c;
public static final int timepicker_up_btn=0x7f02001d;
public static final int timepicker_up_disabled=0x7f02001e;
public static final int timepicker_up_disabled_focused=0x7f02001f;
public static final int timepicker_up_normal=0x7f020020;
public static final int timepicker_up_pressed=0x7f020021;
public static final int timepicker_up_selected=0x7f020022;
public static final int title_button=0x7f020023;
public static final int title_refresh=0x7f020024;
}
public static final class id {
public static final int actionBarLayout=0x7f090000;
public static final int decrement=0x7f090018;
public static final int eventContent=0x7f090011;
public static final int eventDate=0x7f09000e;
public static final int eventLocation=0x7f090013;
public static final int eventMetaData=0x7f09000c;
public static final int eventSender=0x7f090010;
public static final int eventSummary=0x7f090014;
public static final int eventText=0x7f090015;
public static final int eventTime=0x7f09000f;
public static final int eventType=0x7f090012;
public static final int increment=0x7f090016;
public static final int decrement=0x7f09001e;
public static final int eventContent=0x7f090017;
public static final int eventDate=0x7f090013;
public static final int eventLocation=0x7f090019;
public static final int eventMetaData=0x7f090011;
public static final int eventSender=0x7f090015;
public static final int eventSummary=0x7f09001a;
public static final int eventText=0x7f09001b;
public static final int eventTime=0x7f090014;
public static final int eventType=0x7f090018;
public static final int increment=0x7f09001c;
public static final int listIcon=0x7f090009;
public static final int listItems=0x7f09000b;
public static final int listText=0x7f09000a;
public static final int messageReplyButton=0x7f090016;
public static final int message_body_text=0x7f09000e;
public static final int message_button_accept=0x7f09000f;
public static final int message_button_cancel=0x7f090010;
public static final int message_receivers_text=0x7f09000c;
public static final int message_subject_text=0x7f09000d;
public static final int moduleIcon=0x7f090001;
public static final int moduleName=0x7f090002;
public static final int notificationIcon=0x7f09000d;
public static final int preferences_menu=0x7f090031;
public static final int notificationIcon=0x7f090012;
public static final int preferences_menu=0x7f090037;
public static final int refresh=0x7f090008;
public static final int testAnswerTypesAcceptButton=0x7f09001b;
public static final int testAnswerTypesList=0x7f09001a;
public static final int testAnswerTypesText=0x7f090019;
public static final int testAnswerTypesAcceptButton=0x7f090021;
public static final int testAnswerTypesList=0x7f090020;
public static final int testAnswerTypesText=0x7f09001f;
public static final int testEvaluateButton=0x7f090006;
public static final int testMakeAnswer=0x7f09001f;
public static final int testMakeBottomBar=0x7f090024;
public static final int testMakeCorrectAnswer=0x7f090022;
public static final int testMakeCorrectAnswerImage=0x7f090020;
public static final int testMakeEditText=0x7f090021;
public static final int testMakeList=0x7f090023;
public static final int testMakeNextButton=0x7f090027;
public static final int testMakePrevButton=0x7f090025;
public static final int testMakeQuestionScore=0x7f09001d;
public static final int testMakeStem=0x7f09001c;
public static final int testMakeText=0x7f09001e;
public static final int testNumQuestionsAcceptButton=0x7f09002d;
public static final int testNumQuestionsNumberPicker=0x7f09002a;
public static final int testNumQuestionsText=0x7f09002c;
public static final int testResultsButton=0x7f09002b;
public static final int testResultsScore=0x7f090029;
public static final int testResultsText=0x7f090028;
public static final int testMakeAnswer=0x7f090025;
public static final int testMakeBottomBar=0x7f09002a;
public static final int testMakeCorrectAnswer=0x7f090028;
public static final int testMakeCorrectAnswerImage=0x7f090026;
public static final int testMakeEditText=0x7f090027;
public static final int testMakeList=0x7f090029;
public static final int testMakeNextButton=0x7f09002d;
public static final int testMakePrevButton=0x7f09002b;
public static final int testMakeQuestionScore=0x7f090023;
public static final int testMakeStem=0x7f090022;
public static final int testMakeText=0x7f090024;
public static final int testNumQuestionsAcceptButton=0x7f090033;
public static final int testNumQuestionsNumberPicker=0x7f090030;
public static final int testNumQuestionsText=0x7f090032;
public static final int testResultsButton=0x7f090031;
public static final int testResultsScore=0x7f09002f;
public static final int testResultsText=0x7f09002e;
public static final int testShowResultsButton=0x7f090004;
public static final int testTagsAcceptButton=0x7f090030;
public static final int testTagsList=0x7f09002f;
public static final int testTagsText=0x7f09002e;
public static final int test_questions_bar=0x7f090026;
public static final int timepicker_input=0x7f090017;
public static final int testTagsAcceptButton=0x7f090036;
public static final int testTagsList=0x7f090035;
public static final int testTagsText=0x7f090034;
public static final int test_questions_bar=0x7f09002c;
public static final int timepicker_input=0x7f09001d;
public static final int title_sep_1=0x7f090007;
public static final int title_sep_2=0x7f090005;
public static final int title_sep_3=0x7f090003;
@ -123,99 +130,108 @@ public final class R {
public static final int list_item_single_choice=0x7f030003;
public static final int list_items=0x7f030004;
public static final int main=0x7f030005;
public static final int notifications_list_item=0x7f030006;
public static final int number_picker=0x7f030007;
public static final int simple_list_item=0x7f030008;
public static final int tests_answer_types=0x7f030009;
public static final int tests_make_main=0x7f03000a;
public static final int tests_make_questions=0x7f03000b;
public static final int tests_make_results=0x7f03000c;
public static final int tests_num_questions=0x7f03000d;
public static final int tests_tags=0x7f03000e;
public static final int messages_dialog=0x7f030006;
public static final int notifications_list_item=0x7f030007;
public static final int number_picker=0x7f030008;
public static final int simple_list_item=0x7f030009;
public static final int tests_answer_types=0x7f03000a;
public static final int tests_make_main=0x7f03000b;
public static final int tests_make_questions=0x7f03000c;
public static final int tests_make_results=0x7f03000d;
public static final int tests_num_questions=0x7f03000e;
public static final int tests_tags=0x7f03000f;
}
public static final class menu {
public static final int menu_main=0x7f080000;
}
public static final class string {
public static final int about_preferences=0x7f070014;
public static final int acceptMsg=0x7f07003b;
public static final int allMsg=0x7f07003d;
public static final int acceptMsg=0x7f07003c;
public static final int allMsg=0x7f07003e;
public static final int app_name=0x7f070000;
public static final int assignment=0x7f070030;
public static final int assignment=0x7f070031;
public static final int author_preferences=0x7f070016;
public static final int cancelMsg=0x7f07003c;
public static final int cancelMsg=0x7f07003d;
public static final int close_dialog=0x7f070007;
public static final int content=0x7f07002d;
public static final int content=0x7f07002e;
public static final int coursesModuleLabel=0x7f070003;
public static final int coursesProgressDescription=0x7f070021;
public static final int coursesProgressTitle=0x7f070020;
public static final int dateMsg=0x7f070034;
public static final int errorBadLoginMsg=0x7f070054;
public static final int errorConnectionMsg=0x7f070056;
public static final int errorCopyMsg_DB=0x7f070024;
public static final int errorMsgLaunchingActivity=0x7f070022;
public static final int errorMsgNoConnection=0x7f070025;
public static final int errorMsgWorkaroundEmulator=0x7f070023;
public static final int errorServerResponseMsg=0x7f070055;
public static final int errorTimeoutMsg=0x7f070057;
public static final int evaluation=0x7f07002f;
public static final int examAnnouncement=0x7f070028;
public static final int falseMsg=0x7f07003a;
public static final int coursesProgressDescription=0x7f070022;
public static final int coursesProgressTitle=0x7f070021;
public static final int dateMsg=0x7f070035;
public static final int errorBadLoginMsg=0x7f070055;
public static final int errorConnectionMsg=0x7f070057;
public static final int errorCopyMsg_DB=0x7f070025;
public static final int errorMsgLaunchingActivity=0x7f070023;
public static final int errorMsgNoConnection=0x7f070026;
public static final int errorMsgWorkaroundEmulator=0x7f070024;
public static final int errorServerResponseMsg=0x7f070056;
public static final int errorTimeoutMsg=0x7f070058;
public static final int evaluation=0x7f070030;
public static final int examAnnouncement=0x7f070029;
public static final int falseMsg=0x7f07003b;
public static final int firstRunMsg=0x7f070052;
public static final int forumReply=0x7f07002c;
public static final int fromMsg=0x7f070033;
public static final int initialDialogTitle=0x7f070051;
public static final int forumReply=0x7f07002d;
public static final int fromMsg=0x7f070034;
public static final int initialDialogTitle=0x7f070053;
public static final int loginModuleLabel=0x7f070001;
public static final int loginProgressDescription=0x7f07001a;
public static final int loginProgressTitle=0x7f070019;
public static final int loginSuccessfulMsg=0x7f070027;
public static final int loginSuccessfulMsg=0x7f070028;
public static final int loginTitle_menu=0x7f070018;
public static final int marksFile=0x7f070029;
public static final int message=0x7f07002b;
public static final int messageModuleLabel=0x7f070005;
public static final int messages=0x7f07002e;
public static final int noContentMsg=0x7f070036;
public static final int noCourseSelectedMsg=0x7f07003f;
public static final int noMsg=0x7f070038;
public static final int noQuestionsAvailableTestsDownloadMsg=0x7f070040;
public static final int noQuestionsPluggableTestsDownloadMsg=0x7f070041;
public static final int noSubjectMsg=0x7f070035;
public static final int notice=0x7f07002a;
public static final int marksFile=0x7f07002a;
public static final int message=0x7f07002c;
public static final int messageSendErrorMsg=0x7f07005b;
public static final int messageSendedMsg=0x7f07005a;
public static final int message_body_title=0x7f07005e;
public static final int message_receivers_title=0x7f07005c;
public static final int message_subject_title=0x7f07005d;
public static final int messages=0x7f07002f;
public static final int messagesModuleLabel=0x7f070005;
public static final int noContentMsg=0x7f070037;
public static final int noCourseSelectedMsg=0x7f070040;
public static final int noMsg=0x7f070039;
public static final int noQuestionsAvailableTestsDownloadMsg=0x7f070041;
public static final int noQuestionsPluggableTestsDownloadMsg=0x7f070042;
public static final int noSubjectMsg=0x7f070036;
public static final int notice=0x7f07002b;
public static final int notificationsDownloadedMsg=0x7f07001e;
public static final int notificationsEmptyListMsg=0x7f07001d;
public static final int notificationsModuleLabel=0x7f070002;
public static final int notificationsProgressDescription=0x7f07001c;
public static final int notificationsProgressTitle=0x7f07001b;
public static final int organization_preferences=0x7f070017;
public static final int preferencesTitle_menu=0x7f070013;
public static final int questionsTestsDownloadSuccesfulMsg=0x7f070042;
public static final int questionsTestsDownloadSuccesfulMsg=0x7f070043;
public static final int saveMsg_preferences=0x7f070010;
public static final int saveSummary_preferences=0x7f070011;
public static final int saveTitle_preferences=0x7f070012;
public static final int selectCourseTitle=0x7f07003e;
public static final int selectCourseTitle=0x7f07003f;
public static final int sendMsg=0x7f07005f;
public static final int sendingMessageMsg=0x7f070059;
public static final int set_preferences=0x7f070008;
public static final int survey=0x7f070031;
public static final int testAnswerTypesMsg=0x7f070049;
public static final int testEvaluateMsg=0x7f07004b;
public static final int testNoAnswerTypesSelectedMsg=0x7f07004a;
public static final int testNoDetailsMsg=0x7f07004f;
public static final int testNoQuestionsCourseMsg=0x7f070043;
public static final int testNoQuestionsMeetsSpecifiedCriteriaMsg=0x7f070045;
public static final int testNoQuestionsMsg=0x7f070044;
public static final int testNoResultsMsg=0x7f070050;
public static final int testNoTagsSelectedMsg=0x7f070048;
public static final int testNumQuestionsMsg=0x7f070046;
public static final int testResultsTextMsg=0x7f07004c;
public static final int testShowResultsDetailsMsg=0x7f07004e;
public static final int testShowResultsMsg=0x7f07004d;
public static final int testTagsMsg=0x7f070047;
public static final int testsDownloadProgressDescription=0x7f07001f;
public static final int testsDownloadProgressTitle=0x7f07001e;
public static final int survey=0x7f070032;
public static final int testAnswerTypesMsg=0x7f07004a;
public static final int testEvaluateMsg=0x7f07004c;
public static final int testNoAnswerTypesSelectedMsg=0x7f07004b;
public static final int testNoDetailsMsg=0x7f070050;
public static final int testNoQuestionsCourseMsg=0x7f070044;
public static final int testNoQuestionsMeetsSpecifiedCriteriaMsg=0x7f070046;
public static final int testNoQuestionsMsg=0x7f070045;
public static final int testNoResultsMsg=0x7f070051;
public static final int testNoTagsSelectedMsg=0x7f070049;
public static final int testNumQuestionsMsg=0x7f070047;
public static final int testResultsTextMsg=0x7f07004d;
public static final int testShowResultsDetailsMsg=0x7f07004f;
public static final int testShowResultsMsg=0x7f07004e;
public static final int testTagsMsg=0x7f070048;
public static final int testsDownloadProgressDescription=0x7f070020;
public static final int testsDownloadProgressTitle=0x7f07001f;
public static final int testsModuleLabel=0x7f070004;
public static final int title_error_dialog=0x7f070006;
public static final int trueMsg=0x7f070039;
public static final int unknownNotification=0x7f070032;
public static final int upgradeMsg=0x7f070053;
public static final int upgradeMsg_DB=0x7f070026;
public static final int trueMsg=0x7f07003a;
public static final int unknownNotification=0x7f070033;
public static final int upgradeMsg=0x7f070054;
public static final int upgradeMsg_DB=0x7f070027;
public static final int userIDName_preferences=0x7f07000a;
public static final int userIDSummary_preferences=0x7f07000b;
public static final int userIDTitle_preferences=0x7f07000c;
@ -224,7 +240,7 @@ public final class R {
public static final int userPasswordTitle_preferences=0x7f07000f;
public static final int user_preferences=0x7f070009;
public static final int versionTitle_preferences=0x7f070015;
public static final int yesMsg=0x7f070037;
public static final int yesMsg=0x7f070038;
}
public static final class xml {
public static final int preferences=0x7f040000;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="3dip">
<EditText
android:id="@+id/message_receivers_text"
android:hint="@string/message_receivers_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/foreground1">
</EditText>
<EditText
android:id="@+id/message_subject_text"
android:hint="@string/message_subject_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/foreground1">
</EditText>
<EditText
android:id="@+id/message_body_text"
android:hint="@string/message_body_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/foreground1">
</EditText>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<Button
android:id="@+id/message_button_accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sendMsg">
</Button>
<Button
android:id="@+id/message_button_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cancelMsg">
</Button>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -8,7 +8,10 @@
<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_height="wrap_content"
android:layout_width="100dip"
android:gravity="center_horizontal"
android:orientation="vertical"
android:layout_marginTop="6dip">
<ImageView
@ -42,13 +45,25 @@
android:textColor="@color/foreground2"
android:layout_marginBottom="6dip"
android:padding="1dip" />
<ImageView
android:id="@+id/messageReplyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:cropToPadding="false"
android:background="@drawable/message_reply"
android:clickable="true"
android:visibility="gone" />
</LinearLayout>
<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_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginTop="3dip"
android:layout_marginRight="6dip">
<TextView
android:id="@+id/eventType"

View File

@ -5,7 +5,7 @@
<string name="notificationsModuleLabel">Notificaciones</string>
<string name="coursesModuleLabel">Asignaturas</string>
<string name="testsModuleLabel">Tests</string>
<string name="messageModuleLabel">Enviar mensaje</string>
<string name="messagesModuleLabel">Enviar mensaje</string>
<string name="title_error_dialog">ERROR</string>
<string name="close_dialog">Cerrar</string>
<string name="set_preferences">Configuración</string>
@ -32,7 +32,7 @@
<string name="notificationsProgressTitle">Notificaciones</string>
<string name="notificationsProgressDescription">Obteniendo nuevas notificaciones...</string>
<string name="notificationsEmptyListMsg">No se ha descargado ninguna notificación.\n\nPara descargar las
notificaciones más recientes pulse el icono de la esquina superior derecha de la pantalla.</string>
notificaciones más recientes pulse el icono de la esquina superior derecha de la pantalla.</string><string name="notificationsDownloadedMsg">Notificaciones descargadas</string>
<string name="testsDownloadProgressTitle">Tests</string>
<string name="testsDownloadProgressDescription">Sincronizando preguntas de test.\n\nDependiendo del número de
preguntas a sincronizar, el procesamiento de los datos puede tardar unos minutos.\n\nPor favor, espere...</string>
@ -102,4 +102,12 @@
<string name="errorConnectionMsg">Error durante la conexión con el servidor</string>
<string name="errorTimeoutMsg">Tiempo de espera agotado intentando conectar con el
servidor</string>
<string name="sendingMessageMsg">Enviando mensaje...</string>
<string name="messageSendedMsg">Mensaje enviado</string><string name="messageSendErrorMsg">Error al enviar el mensaje. Compruebe los datos introducidos</string>
<string name="message_receivers_title">Destinatarios (separados por comas)</string>
<string name="message_subject_title">Asunto</string>
<string name="message_body_title">Mensaje</string>
<string name="sendMsg">Enviar</string>
</resources>

View File

@ -5,7 +5,7 @@
<string name="notificationsModuleLabel">Notifications</string>
<string name="coursesModuleLabel">Courses</string>
<string name="testsModuleLabel">Tests</string>
<string name="messageModuleLabel">Send message</string>
<string name="messagesModuleLabel">Send message</string>
<string name="title_error_dialog">ERROR</string>
<string name="close_dialog">Close</string>
<string name="set_preferences">Preferences</string>
@ -30,7 +30,7 @@
<string name="notificationsProgressTitle">Notifications</string>
<string name="notificationsProgressDescription">Retrieving new notifications...</string>
<string name="notificationsEmptyListMsg">Did not download any notification.\n\nTo download most recent
notifications click the icon in the upper right of the screen.</string>
notifications click the icon in the upper right of the screen.</string><string name="notificationsDownloadedMsg">Notifications downloaded</string>
<string name="testsDownloadProgressTitle">Tests</string>
<string name="testsDownloadProgressDescription">Synchronizing test questions.\n\nDepending of the number of
questions to synchronize, the data processing can take several minutes.\n\nPlease wait...</string>
@ -87,16 +87,22 @@
<string name="testShowResultsDetailsMsg">Show details</string>
<string name="testNoDetailsMsg">The teacher does not allow to see the details</string>
<string name="testNoResultsMsg">The teacher does not allow to see the results</string>
<string name="initialDialogTitle">IMPORTANT</string>
<string name="firstRunMsg">Before using the application for the first time you
must enter the user name and password for SWAD at the setup
screen.\n\nYou can access to the setup screen from the application
menu anytime.\n\nDo you want to open the configuration screen now?
</string>
</string><string name="initialDialogTitle">IMPORTANT</string>
<string name="upgradeMsg">Due to changes in the database all notifications
data have been deleted.\n\nSorry.</string>
<string name="errorBadLoginMsg">Incorrect user or password</string>
<string name="errorServerResponseMsg">Error in server response</string>
<string name="errorConnectionMsg">Error while connecting to server</string>
<string name="errorTimeoutMsg">Timeout trying to connect to the server</string>
<string name="sendingMessageMsg">Sending message...</string>
<string name="messageSendedMsg">Message sended successfully</string><string name="messageSendErrorMsg">Error while sending the message. Check the data in the message fields</string>
<string name="message_receivers_title">Receivers (separated by comma)</string>
<string name="message_subject_title">Subject</string>
<string name="message_body_title">Message</string>
<string name="sendMsg">Send</string>
</resources>

View File

@ -1360,7 +1360,7 @@ public class Base64
@Override
public Class<?> resolveClass(java.io.ObjectStreamClass streamClass)
throws java.io.IOException, ClassNotFoundException {
Class c = Class.forName(streamClass.getName(), false, loader);
Class<?> c = Class.forName(streamClass.getName(), false, loader);
if( c == null ){
return super.resolveClass(streamClass);
} else {

View File

@ -68,6 +68,10 @@ public class Global {
* Request code for Tests module.
*/
public static final int TESTS_MAKE_REQUEST_CODE = 7;
/**
* Request code for Tests module.
*/
public static final int MESSAGES_REQUEST_CODE = 8;
/**
* Prefix tag name for Logcat
*/

View File

@ -55,6 +55,7 @@ public class ImageExpandableListAdapter extends SimpleExpandableListAdapter {
/* (non-Javadoc)
* @see android.widget.SimpleExpandableListAdapter#getGroupView(int, boolean, android.view.View, android.view.ViewGroup)
*/
@SuppressWarnings("unchecked")
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
@ -68,6 +69,7 @@ public class ImageExpandableListAdapter extends SimpleExpandableListAdapter {
return v;
}
@SuppressWarnings("unchecked")
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
final View v = super.getChildView(groupPosition, childPosition, isLastChild, convertView, parent);

View File

@ -38,8 +38,8 @@ import android.view.View;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import es.ugr.swad.swadroid.model.DataBaseHelper;
import es.ugr.swad.swadroid.modules.Messages;
import es.ugr.swad.swadroid.modules.notifications.Notifications;
import es.ugr.swad.swadroid.modules.tests.Tests;
import es.ugr.swad.swadroid.ssl.SecureConnection;
@ -166,6 +166,7 @@ public class SWADMain extends ExpandableListActivity {
int groupPosition, int childPosition, long id) {
// Get the item that was clicked
Object o = this.getExpandableListAdapter().getChild(groupPosition, childPosition);
@SuppressWarnings("unchecked")
String keyword = (String) ((Map<String,Object>)o).get(NAME);
Intent activity;
@ -176,8 +177,11 @@ public class SWADMain extends ExpandableListActivity {
} else if(keyword.equals(getString(R.string.testsModuleLabel))) {
activity = new Intent(getBaseContext(), Tests.class);
startActivityForResult(activity, Global.TESTS_REQUEST_CODE);
} else if(keyword.equals(getString(R.string.messageModuleLabel))) {
Toast.makeText(this, "Opción en desarrollo", Toast.LENGTH_SHORT).show();
} else if(keyword.equals(getString(R.string.messagesModuleLabel))) {
//Toast.makeText(this, "Opción en desarrollo", Toast.LENGTH_SHORT).show();
activity = new Intent(getBaseContext(), Messages.class);
activity.putExtra("notificationCode", new Long(0));
startActivityForResult(activity, Global.MESSAGES_REQUEST_CODE);
}
return true;
@ -225,7 +229,7 @@ public class SWADMain extends ExpandableListActivity {
messagesData.add(map);
map = new HashMap<String,Object>();
map.put(NAME, getString(R.string.messageModuleLabel) );
map.put(NAME, getString(R.string.messagesModuleLabel) );
map.put(IMAGE, getResources().getDrawable(R.drawable.msg));
messagesData.add(map);

View File

@ -33,7 +33,8 @@ public class Course extends Model {
private String name;
private static PropertyInfo PI_id = new PropertyInfo();
private static PropertyInfo PI_name = new PropertyInfo();
private static PropertyInfo[] PI_PROP_ARRAY =
@SuppressWarnings("unused")
private static PropertyInfo[] PI_PROP_ARRAY =
{
PI_id,
PI_name
@ -108,7 +109,7 @@ public class Course extends Model {
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#getPropertyInfo(int, java.util.Hashtable, org.ksoap2.serialization.PropertyInfo)
*/
public void getPropertyInfo(int param, Hashtable arg1, PropertyInfo propertyInfo) {
public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
switch(param){
case 0:
propertyInfo.type = PropertyInfo.LONG_CLASS;

View File

@ -89,6 +89,7 @@ public class DataBaseHelper {
* @param ent Cursor to the table rows
* @return A Model's subclass object
*/
@SuppressWarnings("rawtypes")
private Model createObjectByTable(String table, Entity ent) {
Model o = null;
Pair<String, String> params;
@ -552,7 +553,7 @@ public class DataBaseHelper {
* Removes a PairTable from database
* @param p PairTable to be removed
*/
public void removePairTable(PairTable p)
public void removePairTable(@SuppressWarnings("rawtypes") PairTable p)
{
String table = p.getTable();
Integer first = (Integer) p.getFirst();

View File

@ -73,7 +73,8 @@ public class Notification extends Model {
private static PropertyInfo PI_summary = new PropertyInfo();
private static PropertyInfo PI_status = new PropertyInfo();
private static PropertyInfo PI_content = new PropertyInfo();
private static PropertyInfo[] PI_PROP_ARRAY =
@SuppressWarnings("unused")
private static PropertyInfo[] PI_PROP_ARRAY =
{
PI_id,
PI_eventType,
@ -326,7 +327,7 @@ public class Notification extends Model {
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#getPropertyInfo(int, java.util.Hashtable, org.ksoap2.serialization.PropertyInfo)
*/
public void getPropertyInfo(int param, Hashtable arg1, PropertyInfo propertyInfo) {
public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
switch(param){
case 0:
propertyInfo.type = PropertyInfo.LONG_CLASS;

View File

@ -134,7 +134,7 @@ public class PairTable<FIRST, SECOND> extends Model {
return 0;
}
public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
public void getPropertyInfo(int arg0, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo arg2) {
// TODO Auto-generated method stub
}

View File

@ -74,7 +74,8 @@ public class Test extends Model {
private static PropertyInfo PI_def = new PropertyInfo();
private static PropertyInfo PI_max = new PropertyInfo();
private static PropertyInfo PI_feedback = new PropertyInfo();
private static PropertyInfo[] PI_PROP_ARRAY =
@SuppressWarnings("unused")
private static PropertyInfo[] PI_PROP_ARRAY =
{
PI_min,
PI_def,
@ -532,7 +533,7 @@ public class Test extends Model {
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#getPropertyInfo(int, java.util.Hashtable, org.ksoap2.serialization.PropertyInfo)
*/
public void getPropertyInfo(int param, Hashtable arg1, PropertyInfo propertyInfo) {
public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
switch(param){
case 0:
propertyInfo.type = PropertyInfo.INTEGER_CLASS;

View File

@ -56,7 +56,8 @@ public class TestAnswer extends Model {
private static PropertyInfo PI_correctAnswered = new PropertyInfo();
private static PropertyInfo PI_answer = new PropertyInfo();
private static PropertyInfo PI_ansInd = new PropertyInfo();
private static PropertyInfo[] PI_PROP_ARRAY =
@SuppressWarnings("unused")
private static PropertyInfo[] PI_PROP_ARRAY =
{
PI_id,
PI_correct,
@ -257,7 +258,7 @@ public class TestAnswer extends Model {
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#getPropertyInfo(int, java.util.Hashtable, org.ksoap2.serialization.PropertyInfo)
*/
public void getPropertyInfo(int param, Hashtable arg1, PropertyInfo propertyInfo) {
public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
switch(param){
case 0:
propertyInfo.type = PropertyInfo.LONG_CLASS;

View File

@ -58,7 +58,8 @@ public class TestQuestion extends Model {
private static PropertyInfo PI_editTime = new PropertyInfo();
private static PropertyInfo PI_ansType = new PropertyInfo();
private static PropertyInfo PI_shuffle = new PropertyInfo();
private static PropertyInfo[] PI_PROP_ARRAY =
@SuppressWarnings("unused")
private static PropertyInfo[] PI_PROP_ARRAY =
{
PI_id,
PI_stem,
@ -269,7 +270,7 @@ public class TestQuestion extends Model {
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#getPropertyInfo(int, java.util.Hashtable, org.ksoap2.serialization.PropertyInfo)
*/
public void getPropertyInfo(int param, Hashtable arg1, PropertyInfo propertyInfo) {
public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
switch(param){
case 0:
propertyInfo.type = PropertyInfo.LONG_CLASS;

View File

@ -42,7 +42,8 @@ public class TestTag extends Model {
private static PropertyInfo PI_id = new PropertyInfo();
private static PropertyInfo PI_tagText = new PropertyInfo();
private static PropertyInfo PI_tagInd = new PropertyInfo();
private static PropertyInfo[] PI_PROP_ARRAY =
@SuppressWarnings("unused")
private static PropertyInfo[] PI_PROP_ARRAY =
{
PI_id,
PI_tagText,
@ -184,7 +185,7 @@ public class TestTag extends Model {
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#getPropertyInfo(int, java.util.Hashtable, org.ksoap2.serialization.PropertyInfo)
*/
public void getPropertyInfo(int param, Hashtable arg1, PropertyInfo propertyInfo) {
public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
switch(param){
case 0:
propertyInfo.type = PropertyInfo.LONG_CLASS;

View File

@ -69,7 +69,8 @@ public class User implements KvmSerializable {
private static PropertyInfo PI_userSurname2 = new PropertyInfo();
private static PropertyInfo PI_userFirstName = new PropertyInfo();
private static PropertyInfo PI_userTypeName = new PropertyInfo();
private static PropertyInfo[] PI_PROP_ARRAY =
@SuppressWarnings("unused")
private static PropertyInfo[] PI_PROP_ARRAY =
{
PI_userCode,
PI_userTypeCode,
@ -258,7 +259,7 @@ public class User implements KvmSerializable {
return 8;
}
public void getPropertyInfo(int param, Hashtable arg1, PropertyInfo propertyInfo) {
public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
switch(param){
case 0:
propertyInfo.type = PropertyInfo.STRING_CLASS;

View File

@ -117,7 +117,7 @@ public class Courses extends Module {
List<Model> coursesSWAD = new ArrayList<Model>();
List<Model> newCourses = new ArrayList<Model>();
List<Model> obsoleteCourses = new ArrayList<Model>();
Vector res = (Vector) result;
Vector<?> res = (Vector<?>) result;
SoapObject soap = (SoapObject) res.get(1);
int csSize = soap.getPropertyCount();
for (int i = 0; i < csSize; i++) {

View File

@ -0,0 +1,202 @@
/*
* This file is part of SWADroid.
*
* Copyright (C) 2010 Juan Miguel Boyero Corral <juanmi1982@gmail.com>
*
* SWADroid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SWADroid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SWADroid. If not, see <http://www.gnu.org/licenses/>.
*/
package es.ugr.swad.swadroid.modules;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import org.ksoap2.SoapFault;
import org.xmlpull.v1.XmlPullParserException;
import es.ugr.swad.swadroid.Global;
import es.ugr.swad.swadroid.R;
import es.ugr.swad.swadroid.model.User;
import android.app.Dialog;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout.LayoutParams;
import android.widget.Toast;
/**
* Module for send messages.
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
*/
public class Messages extends Module {
/**
* Messages tag name for Logcat
*/
public static final String TAG = Global.APP_TAG + " Messages";
/**
* Message code
*/
private Long notificationCode;
/**
* Message's receivers
*/
private String receivers;
/**
* Message's subject
*/
private String subject;
/**
* Message's body
*/
private String body;
private Dialog messageDialog;
private OnClickListener positiveClickListener = new OnClickListener() {
public void onClick(View v) {
try {
if(isDebuggable) {
Log.d(TAG, "notificationCode = " + Long.toString(notificationCode));
}
runConnection();
} catch (Exception ex) {
String errorMsg = getString(R.string.errorServerResponseMsg);
error(errorMsg);
if(isDebuggable) {
Log.e(ex.getClass().getSimpleName(), errorMsg);
ex.printStackTrace();
}
}
}
};
private OnClickListener negativeClickListener = new OnClickListener() {
public void onClick(View v) {
finish();
}
};
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#onCreate(android.os.Bundle)
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setMETHOD_NAME("sendMessage");
}
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#onStart()
*/
@Override
protected void onStart() {
messageDialog = new Dialog(this);
Button acceptButton, cancelButton;
EditText receiversText, subjectText;
super.onStart();
notificationCode = getIntent().getLongExtra("notificationCode", 0);
messageDialog.setTitle(R.string.messagesModuleLabel);
messageDialog.setContentView(R.layout.messages_dialog);
messageDialog.setCancelable(true);
messageDialog.getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
acceptButton = (Button) messageDialog.findViewById(R.id.message_button_accept);
acceptButton.setOnClickListener(positiveClickListener);
cancelButton = (Button) messageDialog.findViewById(R.id.message_button_cancel);
cancelButton.setOnClickListener(negativeClickListener);
if(notificationCode != 0) {
subject = getIntent().getStringExtra("summary");
receiversText = (EditText) messageDialog.findViewById(R.id.message_receivers_text);
subjectText = (EditText) messageDialog.findViewById(R.id.message_subject_text);
subjectText.setText("Re: " + subject);
receiversText.setVisibility(View.GONE);
}
messageDialog.show();
}
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#onPause()
*/
@Override
protected void onPause() {
super.onPause();
messageDialog.dismiss();
}
private void readData() {
EditText rcv = (EditText) messageDialog.findViewById(R.id.message_receivers_text);
receivers = rcv.getText().toString();
EditText subj = (EditText) messageDialog.findViewById(R.id.message_subject_text);
subject = subj.getText().toString();
EditText bd = (EditText) messageDialog.findViewById(R.id.message_body_text);
body = bd.getText().toString();
}
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#requestService()
*/
@Override
protected void requestService() throws NoSuchAlgorithmException,
IOException, XmlPullParserException, SoapFault,
IllegalAccessException, InstantiationException {
readData();
createRequest();
addParam("wsKey", User.getWsKey());
addParam("notificationCode", notificationCode);
addParam("to", receivers);
addParam("subject", subject);
addParam("body", body);
sendRequest(User.class, false);
setResult(RESULT_OK);
}
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#connect()
*/
@Override
protected void connect() {
String progressDescription = getString(R.string.sendingMessageMsg);
int progressTitle = R.string.messagesModuleLabel;
new Connect(false, progressDescription, progressTitle).execute();
Toast.makeText(this, R.string.sendingMessageMsg, Toast.LENGTH_SHORT).show();
Log.i(TAG, getString(R.string.sendingMessageMsg));
}
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#postConnect()
*/
@Override
protected void postConnect() {
Toast.makeText(this, R.string.messageSendedMsg, Toast.LENGTH_SHORT).show();
Log.i(TAG, getString(R.string.messageSendedMsg));
finish();
}
}

View File

@ -266,6 +266,7 @@ public abstract class Module extends Activity {
/* (non-Javadoc)
* @see android.app.Activity#onCreate()
*/
@SuppressWarnings("static-access")
@Override
protected void onCreate(Bundle savedInstanceState) {
//Check if debug mode is enabled
@ -406,7 +407,7 @@ public abstract class Module extends Activity {
* @throws IllegalAccessException
* @throws XmlPullParserException
*/
protected void sendRequest(Class cl, boolean simple)
protected void sendRequest(Class<?> cl, boolean simple)
throws IOException, SoapFault, IllegalAccessException, InstantiationException, XmlPullParserException {
/**

View File

@ -45,6 +45,7 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
/**
* Notifications module for get user's notifications
@ -105,16 +106,8 @@ public class Notifications extends Module {
TextView text;
ListView list;
OnItemClickListener clickListener = new OnItemClickListener() {
public void onItemClick(AdapterView<?> av, View v, int arg2,
long arg3) {
TextView content = (TextView) v.findViewById(R.id.eventText);
if(content.getVisibility() == View.VISIBLE)
{
content.setVisibility(View.GONE);
} else {
content.setVisibility(View.VISIBLE);
}
public void onItemClick(AdapterView<?> av, View v, int position, long rowId) {
adapter.toggleContentVisibility(position);
}
};
@ -193,7 +186,7 @@ public class Notifications extends Module {
if (result != null) {
//Stores notifications data returned by webservice response
Vector res = (Vector) result;
Vector<?> res = (Vector<?>) result;
SoapObject soap = (SoapObject) res.get(1);
int csSize = soap.getPropertyCount();
for (int i = 0; i < csSize; i++) {
@ -239,7 +232,8 @@ public class Notifications extends Module {
*/
@Override
protected void postConnect() {
refreshScreen();
refreshScreen();
Toast.makeText(this, R.string.notificationsDownloadedMsg, Toast.LENGTH_SHORT).show();
}
/**

View File

@ -21,11 +21,14 @@ package es.ugr.swad.swadroid.modules.notifications;
import java.util.Date;
import es.ugr.swad.swadroid.R;
import es.ugr.swad.swadroid.modules.Messages;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import android.widget.ImageView;
@ -36,9 +39,18 @@ import android.widget.TextView;
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
*
*/
public class NotificationsCursorAdapter extends CursorAdapter {
public class NotificationsCursorAdapter extends CursorAdapter {
private boolean [] contentVisible;
public NotificationsCursorAdapter(Context context, Cursor c) {
super(context, c);
int numRows = c.getCount();
contentVisible = new boolean[numRows];
for(int i=0; i<numRows; i++) {
contentVisible[i] = false;
}
}
public NotificationsCursorAdapter(Context context, Cursor c,
@ -48,11 +60,18 @@ public class NotificationsCursorAdapter extends CursorAdapter {
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
public void bindView(View view, Context context, Cursor cursor) {
final Context ctx = context;
final Long notificationCode = cursor.getLong(cursor.getColumnIndex("id"));
long unixTime;
String type, sender, senderFirstname, senderSurname1, senderSurname2, summaryText, contentText;
String[] dateContent;
Date d;
Date d;
int numRows = cursor.getCount();
if(contentVisible.length == 0) {
contentVisible = new boolean[numRows];
}
view.setScrollContainer(false);
TextView eventType = (TextView) view.findViewById(R.id.eventType);
@ -60,12 +79,23 @@ public class NotificationsCursorAdapter extends CursorAdapter {
TextView eventTime = (TextView) view.findViewById(R.id.eventTime);
TextView eventSender = (TextView) view.findViewById(R.id.eventSender);
TextView location = (TextView) view.findViewById(R.id.eventLocation);
TextView summary = (TextView) view.findViewById(R.id.eventSummary);
final TextView summary = (TextView) view.findViewById(R.id.eventSummary);
TextView content = (TextView) view.findViewById(R.id.eventText);
ImageView notificationIcon = (ImageView) view.findViewById(R.id.notificationIcon);
ImageView messageReplyButton = (ImageView) view.findViewById(R.id.messageReplyButton);
OnClickListener replyMessageListener = new OnClickListener() {
public void onClick(View v) {
Intent activity = new Intent(ctx.getApplicationContext(), Messages.class);
activity.putExtra("notificationCode", notificationCode);
activity.putExtra("summary", summary.getText().toString());
ctx.startActivity(activity);
}
};
if(eventType != null) {
type = cursor.getString(cursor.getColumnIndex("eventType"));
messageReplyButton.setVisibility(View.GONE);
if(type.equals("examAnnouncement"))
{
@ -83,6 +113,8 @@ public class NotificationsCursorAdapter extends CursorAdapter {
{
type = context.getString(R.string.message);
notificationIcon.setImageResource(R.drawable.recmsg);
messageReplyButton.setOnClickListener(replyMessageListener);
messageReplyButton.setVisibility(View.VISIBLE);
} else if(type.equals("forumReply"))
{
type = context.getString(R.string.forumReply);
@ -145,6 +177,12 @@ public class NotificationsCursorAdapter extends CursorAdapter {
contentText = context.getString(R.string.noContentMsg);
content.setText(Html.fromHtml(contentText));
if(contentVisible[cursor.getPosition()]) {
content.setVisibility(View.VISIBLE);
} else {
content.setVisibility(View.GONE);
}
}
}
@ -156,4 +194,8 @@ public class NotificationsCursorAdapter extends CursorAdapter {
return v;
}
public void toggleContentVisibility(int position) {
contentVisible[position] = !contentVisible[position];
this.notifyDataSetChanged();
}
}

View File

@ -25,7 +25,6 @@ import es.ugr.swad.swadroid.model.TestAnswer;
import android.content.Context;
import android.graphics.Color;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;

View File

@ -195,7 +195,7 @@ public class TestsConfigDownload extends Module {
if (result != null) {
//Stores tests data returned by webservice response
Vector res = (Vector) result;
Vector<?> res = (Vector<?>) result;
Integer pluggable = new Integer(res.get(0).toString());
isPluggable = Global.parseIntBool(pluggable);
@ -260,7 +260,9 @@ public class TestsConfigDownload extends Module {
protected void postConnect() {
if(numQuestions == 0) {
Toast.makeText(this, R.string.noQuestionsAvailableTestsDownloadMsg, Toast.LENGTH_LONG).show();
} else if(!isPluggable) {
}
if(!isPluggable) {
Toast.makeText(this, R.string.noQuestionsPluggableTestsDownloadMsg, Toast.LENGTH_LONG).show();
}

View File

@ -97,7 +97,7 @@ public class TestsQuestionsDownload extends Module {
if (result != null) {
//Stores tests data returned by webservice response
Vector res = (Vector) result;
Vector<?> res = (Vector<?>) result;
SoapObject tagsListObject = (SoapObject)res.get(0);
SoapObject questionsListObject = (SoapObject)res.get(1);

View File

@ -23,7 +23,6 @@ import android.text.InputType;
import android.text.Spanned;
import android.text.method.NumberKeyListener;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@ -46,7 +45,8 @@ import es.ugr.swad.swadroid.R;
public class NumberPicker extends LinearLayout implements OnClickListener,
OnFocusChangeListener, OnLongClickListener {
private static final String TAG = "NumberPicker";
@SuppressWarnings("unused")
private static final String TAG = "NumberPicker";
private static final int DEFAULT_MAX = 200;
private static final int DEFAULT_MIN = 0;
@ -113,7 +113,6 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
this(context, attrs, 0);
}
@SuppressWarnings({"UnusedDeclaration"})
public NumberPicker(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs);
setOrientation(VERTICAL);