From b7a938c2ef038b4bb374edbc9c1183700bc7b11f Mon Sep 17 00:00:00 2001 From: Juan Miguel Boyero Corral Date: Thu, 14 Jul 2011 23:54:51 +0200 Subject: [PATCH 1/8] Cleanup --- SWADroid/src/es/ugr/swad/swadroid/Base64.java | 2 +- .../src/es/ugr/swad/swadroid/ImageExpandableListAdapter.java | 2 ++ SWADroid/src/es/ugr/swad/swadroid/SWADMain.java | 1 + SWADroid/src/es/ugr/swad/swadroid/model/Course.java | 5 +++-- SWADroid/src/es/ugr/swad/swadroid/model/DataBaseHelper.java | 3 ++- SWADroid/src/es/ugr/swad/swadroid/model/Notification.java | 5 +++-- SWADroid/src/es/ugr/swad/swadroid/model/PairTable.java | 2 +- SWADroid/src/es/ugr/swad/swadroid/model/Test.java | 5 +++-- SWADroid/src/es/ugr/swad/swadroid/model/TestAnswer.java | 5 +++-- SWADroid/src/es/ugr/swad/swadroid/model/TestQuestion.java | 5 +++-- SWADroid/src/es/ugr/swad/swadroid/model/TestTag.java | 5 +++-- SWADroid/src/es/ugr/swad/swadroid/model/User.java | 5 +++-- SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java | 3 ++- SWADroid/src/es/ugr/swad/swadroid/modules/Module.java | 3 ++- .../swad/swadroid/modules/notifications/Notifications.java | 3 ++- .../swadroid/modules/tests/CheckedAnswersArrayAdapter.java | 1 - .../ugr/swad/swadroid/modules/tests/TestsConfigDownload.java | 3 ++- .../swad/swadroid/modules/tests/TestsQuestionsDownload.java | 3 ++- SWADroid/src/es/ugr/swad/swadroid/widget/NumberPicker.java | 5 ++--- 19 files changed, 40 insertions(+), 26 deletions(-) diff --git a/SWADroid/src/es/ugr/swad/swadroid/Base64.java b/SWADroid/src/es/ugr/swad/swadroid/Base64.java index 71d5a662..850a8ae8 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/Base64.java +++ b/SWADroid/src/es/ugr/swad/swadroid/Base64.java @@ -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 { diff --git a/SWADroid/src/es/ugr/swad/swadroid/ImageExpandableListAdapter.java b/SWADroid/src/es/ugr/swad/swadroid/ImageExpandableListAdapter.java index cdf83782..c99a26db 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/ImageExpandableListAdapter.java +++ b/SWADroid/src/es/ugr/swad/swadroid/ImageExpandableListAdapter.java @@ -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); diff --git a/SWADroid/src/es/ugr/swad/swadroid/SWADMain.java b/SWADroid/src/es/ugr/swad/swadroid/SWADMain.java index 60f187ec..cf1397b8 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/SWADMain.java +++ b/SWADroid/src/es/ugr/swad/swadroid/SWADMain.java @@ -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)o).get(NAME); Intent activity; diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/Course.java b/SWADroid/src/es/ugr/swad/swadroid/model/Course.java index 1b1eb23d..ff428f7c 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/Course.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/Course.java @@ -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; diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/DataBaseHelper.java b/SWADroid/src/es/ugr/swad/swadroid/model/DataBaseHelper.java index beb857b8..f30f3ec0 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/DataBaseHelper.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/DataBaseHelper.java @@ -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 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(); diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/Notification.java b/SWADroid/src/es/ugr/swad/swadroid/model/Notification.java index fa28bd30..7ac22819 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/Notification.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/Notification.java @@ -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; diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/PairTable.java b/SWADroid/src/es/ugr/swad/swadroid/model/PairTable.java index ba6f844e..55e78eae 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/PairTable.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/PairTable.java @@ -134,7 +134,7 @@ public class PairTable 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 } diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/Test.java b/SWADroid/src/es/ugr/swad/swadroid/model/Test.java index ad8372f5..fdbab11f 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/Test.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/Test.java @@ -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; diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/TestAnswer.java b/SWADroid/src/es/ugr/swad/swadroid/model/TestAnswer.java index b72721de..5c73b2cc 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/TestAnswer.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/TestAnswer.java @@ -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; diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/TestQuestion.java b/SWADroid/src/es/ugr/swad/swadroid/model/TestQuestion.java index c0596ef4..d21cf9fc 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/TestQuestion.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/TestQuestion.java @@ -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; diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/TestTag.java b/SWADroid/src/es/ugr/swad/swadroid/model/TestTag.java index 7cb5951b..337c0caf 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/TestTag.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/TestTag.java @@ -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; diff --git a/SWADroid/src/es/ugr/swad/swadroid/model/User.java b/SWADroid/src/es/ugr/swad/swadroid/model/User.java index b455d7a7..19a29c96 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/model/User.java +++ b/SWADroid/src/es/ugr/swad/swadroid/model/User.java @@ -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; diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java b/SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java index 38375924..8f874bf0 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java @@ -117,7 +117,8 @@ public class Courses extends Module { List coursesSWAD = new ArrayList(); List newCourses = new ArrayList(); List obsoleteCourses = new ArrayList(); - Vector res = (Vector) result; + @SuppressWarnings("rawtypes") + Vector res = (Vector) result; SoapObject soap = (SoapObject) res.get(1); int csSize = soap.getPropertyCount(); for (int i = 0; i < csSize; i++) { diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java b/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java index d2e902a4..4dcff968 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java @@ -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(@SuppressWarnings("rawtypes") Class cl, boolean simple) throws IOException, SoapFault, IllegalAccessException, InstantiationException, XmlPullParserException { /** 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 9cc301aa..fa67c630 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/Notifications.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/Notifications.java @@ -193,7 +193,8 @@ public class Notifications extends Module { if (result != null) { //Stores notifications data returned by webservice response - Vector res = (Vector) result; + @SuppressWarnings("rawtypes") + Vector res = (Vector) result; SoapObject soap = (SoapObject) res.get(1); int csSize = soap.getPropertyCount(); for (int i = 0; i < csSize; i++) { diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/CheckedAnswersArrayAdapter.java b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/CheckedAnswersArrayAdapter.java index 015305de..2dad08e1 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/CheckedAnswersArrayAdapter.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/CheckedAnswersArrayAdapter.java @@ -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; diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsConfigDownload.java b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsConfigDownload.java index c22db27d..e6283b15 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsConfigDownload.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsConfigDownload.java @@ -195,7 +195,8 @@ public class TestsConfigDownload extends Module { if (result != null) { //Stores tests data returned by webservice response - Vector res = (Vector) result; + @SuppressWarnings("rawtypes") + Vector res = (Vector) result; Integer pluggable = new Integer(res.get(0).toString()); isPluggable = Global.parseIntBool(pluggable); diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsQuestionsDownload.java b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsQuestionsDownload.java index 4445f408..7b16fe85 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsQuestionsDownload.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsQuestionsDownload.java @@ -97,7 +97,8 @@ public class TestsQuestionsDownload extends Module { if (result != null) { //Stores tests data returned by webservice response - Vector res = (Vector) result; + @SuppressWarnings("rawtypes") + Vector res = (Vector) result; SoapObject tagsListObject = (SoapObject)res.get(0); SoapObject questionsListObject = (SoapObject)res.get(1); diff --git a/SWADroid/src/es/ugr/swad/swadroid/widget/NumberPicker.java b/SWADroid/src/es/ugr/swad/swadroid/widget/NumberPicker.java index e0869d2c..a916a264 100755 --- a/SWADroid/src/es/ugr/swad/swadroid/widget/NumberPicker.java +++ b/SWADroid/src/es/ugr/swad/swadroid/widget/NumberPicker.java @@ -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); From b79d951ce07e824ec96ae662f79107dc51e34e66 Mon Sep 17 00:00:00 2001 From: Juan Miguel Boyero Corral Date: Tue, 16 Aug 2011 17:22:12 +0200 Subject: [PATCH 2/8] New achievement Apprentice Historian (Level 1) --- index.html | 38 ++++++++++++++++++++++++++++++++++++++ index.rss | 8 ++++++++ 2 files changed, 46 insertions(+) create mode 100644 index.html create mode 100644 index.rss diff --git a/index.html b/index.html new file mode 100644 index 00000000..91ee727e --- /dev/null +++ b/index.html @@ -0,0 +1,38 @@ + + + + + +Juan Miguel Boyero Corral's Git Achievements + + + + + +

Juan Miguel Boyero Corral's Git Achievements

+Unlocked 3/0 Git Achievements for 5 points
+
    +
  • Apprentice Historian (Level 1)
    Investigate the commit log using git-log.
  • +
  • Apprentice Merchant (Level 1)
    Added an external repository with git-remote add.
  • +
  • Student
    Accessed the documentation for a command with git-[command] --help
  • +
+Git commands sorted by usage: +
+      6 achievements
+      5 remote
+      2 status
+      2 log
+      1 config
+
+ +Show locked Achievements +
+There are 0 Achievements. Some achievements can be leveled up depending on the number of times it is used (Used 2 times = level 1, 4 = level 2, 8 = level 3, 16 = level 4, 32 = level 5, etc) +
    +
+ diff --git a/index.rss b/index.rss new file mode 100644 index 00000000..1e5bf486 --- /dev/null +++ b/index.rss @@ -0,0 +1,8 @@ + +Juan Miguel Boyero Corral's Git Achievements + + +Apprentice Historian (Level 1)Investigate the commit log using git log. +Apprentice Merchant (Level 1)Added an external repository with git remote add. +StudentAccessed the documentation for a command with git [command] --help + From d4b6ec9a57327c2f4c86265e5203f051b0dc4424 Mon Sep 17 00:00:00 2001 From: Juan Miguel Boyero Corral Date: Thu, 18 Aug 2011 12:18:40 +0200 Subject: [PATCH 3/8] Cleanup --- index.html | 38 -------------------------------------- index.rss | 8 -------- 2 files changed, 46 deletions(-) delete mode 100644 index.html delete mode 100644 index.rss diff --git a/index.html b/index.html deleted file mode 100644 index 91ee727e..00000000 --- a/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - -Juan Miguel Boyero Corral's Git Achievements - - - - - -

Juan Miguel Boyero Corral's Git Achievements

-Unlocked 3/0 Git Achievements for 5 points
-
    -
  • Apprentice Historian (Level 1)
    Investigate the commit log using git-log.
  • -
  • Apprentice Merchant (Level 1)
    Added an external repository with git-remote add.
  • -
  • Student
    Accessed the documentation for a command with git-[command] --help
  • -
-Git commands sorted by usage: -
-      6 achievements
-      5 remote
-      2 status
-      2 log
-      1 config
-
- -Show locked Achievements -
-There are 0 Achievements. Some achievements can be leveled up depending on the number of times it is used (Used 2 times = level 1, 4 = level 2, 8 = level 3, 16 = level 4, 32 = level 5, etc) -
    -
- diff --git a/index.rss b/index.rss deleted file mode 100644 index 1e5bf486..00000000 --- a/index.rss +++ /dev/null @@ -1,8 +0,0 @@ - -Juan Miguel Boyero Corral's Git Achievements - - -Apprentice Historian (Level 1)Investigate the commit log using git log. -Apprentice Merchant (Level 1)Added an external repository with git remote add. -StudentAccessed the documentation for a command with git [command] --help - From 6709bc713412588bac4d204a0fa0ae77e4095387 Mon Sep 17 00:00:00 2001 From: Juan Miguel Boyero Corral Date: Thu, 18 Aug 2011 12:19:40 +0200 Subject: [PATCH 4/8] Added new stuff --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index e422f7ba..b0a26be7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ SWADroid/default.properties SWADroid/.classpath SWADroid/.project SWADroid/.settings/ +capturas/ +iconos/ +gitstats/ SWADroidTest/ +SWADroid.apk From 69192d0321591d4978494033254b84444bc7db37 Mon Sep 17 00:00:00 2001 From: Juan Miguel Boyero Corral Date: Thu, 18 Aug 2011 12:20:45 +0200 Subject: [PATCH 5/8] Cleanup --- .../swad/swadroid/modules/tests/TestsConfigDownload.java | 7 ++++--- .../swadroid/modules/tests/TestsQuestionsDownload.java | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsConfigDownload.java b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsConfigDownload.java index e6283b15..462ea692 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsConfigDownload.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsConfigDownload.java @@ -195,8 +195,7 @@ public class TestsConfigDownload extends Module { if (result != null) { //Stores tests data returned by webservice response - @SuppressWarnings("rawtypes") - Vector res = (Vector) result; + Vector res = (Vector) result; Integer pluggable = new Integer(res.get(0).toString()); isPluggable = Global.parseIntBool(pluggable); @@ -261,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(); } diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsQuestionsDownload.java b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsQuestionsDownload.java index 7b16fe85..8e585698 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsQuestionsDownload.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/tests/TestsQuestionsDownload.java @@ -97,8 +97,7 @@ public class TestsQuestionsDownload extends Module { if (result != null) { //Stores tests data returned by webservice response - @SuppressWarnings("rawtypes") - Vector res = (Vector) result; + Vector res = (Vector) result; SoapObject tagsListObject = (SoapObject)res.get(0); SoapObject questionsListObject = (SoapObject)res.get(1); From 50ab6a5b08b929307b262a09e80be3ca62e4f20f Mon Sep 17 00:00:00 2001 From: Juan Miguel Boyero Corral Date: Thu, 18 Aug 2011 12:23:52 +0200 Subject: [PATCH 6/8] Cleanup --- SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java | 3 +-- SWADroid/src/es/ugr/swad/swadroid/modules/Module.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java b/SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java index 8f874bf0..7f371106 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/Courses.java @@ -117,8 +117,7 @@ public class Courses extends Module { List coursesSWAD = new ArrayList(); List newCourses = new ArrayList(); List obsoleteCourses = new ArrayList(); - @SuppressWarnings("rawtypes") - 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++) { diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java b/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java index 4dcff968..70b63654 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java @@ -407,7 +407,7 @@ public abstract class Module extends Activity { * @throws IllegalAccessException * @throws XmlPullParserException */ - protected void sendRequest(@SuppressWarnings("rawtypes") Class cl, boolean simple) + protected void sendRequest(Class cl, boolean simple) throws IOException, SoapFault, IllegalAccessException, InstantiationException, XmlPullParserException { /** From 25cd8d5c56d2cc19b2266d5f9cbe91231c8022fa Mon Sep 17 00:00:00 2001 From: Juan Miguel Boyero Corral Date: Thu, 18 Aug 2011 12:29:54 +0200 Subject: [PATCH 7/8] Added messages module --- SWADroid/AndroidManifest.xml | 3 +- SWADroid/gen/es/ugr/swad/swadroid/R.java | 276 +++++++++--------- SWADroid/res/drawable-hdpi/message_reply.png | Bin 0 -> 2808 bytes SWADroid/res/drawable-ldpi/message_reply.png | Bin 0 -> 1398 bytes SWADroid/res/drawable-mdpi/message_reply.png | Bin 0 -> 1834 bytes SWADroid/res/layout/messages_dialog.xml | 62 ++++ .../res/layout/notifications_list_item.xml | 21 +- SWADroid/res/values-es/strings.xml | 12 +- SWADroid/res/values/strings.xml | 14 +- SWADroid/src/es/ugr/swad/swadroid/Global.java | 4 + .../src/es/ugr/swad/swadroid/SWADMain.java | 11 +- .../ugr/swad/swadroid/modules/Messages.java | 202 +++++++++++++ .../modules/notifications/Notifications.java | 19 +- .../NotificationsCursorAdapter.java | 50 +++- 14 files changed, 513 insertions(+), 161 deletions(-) create mode 100644 SWADroid/res/drawable-hdpi/message_reply.png create mode 100644 SWADroid/res/drawable-ldpi/message_reply.png create mode 100644 SWADroid/res/drawable-mdpi/message_reply.png create mode 100644 SWADroid/res/layout/messages_dialog.xml create mode 100644 SWADroid/src/es/ugr/swad/swadroid/modules/Messages.java diff --git a/SWADroid/AndroidManifest.xml b/SWADroid/AndroidManifest.xml index 8e46184e..ba9c2ff3 100644 --- a/SWADroid/AndroidManifest.xml +++ b/SWADroid/AndroidManifest.xml @@ -19,11 +19,12 @@ android:name=".modules.Login" android:label="@string/loginModuleLabel" android:configChanges="keyboard|keyboardHidden|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar"> - + + diff --git a/SWADroid/gen/es/ugr/swad/swadroid/R.java b/SWADroid/gen/es/ugr/swad/swadroid/R.java index c82854ad..45f0ddf7 100644 --- a/SWADroid/gen/es/ugr/swad/swadroid/R.java +++ b/SWADroid/gen/es/ugr/swad/swadroid/R.java @@ -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; diff --git a/SWADroid/res/drawable-hdpi/message_reply.png b/SWADroid/res/drawable-hdpi/message_reply.png new file mode 100644 index 0000000000000000000000000000000000000000..841eb1479d3606c56b31cf998d8898fbb74c01ad GIT binary patch literal 2808 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipe_ z3L6R%U}}*7019|XL_t(|+U=WZY#ir#$A9lTv%9m)V<|34DY7JzIxC8zV$-r@3${d5 ziGcuN3?m2fAwXKRanTk<+YfCnASh6zMjN!t`AG+z>+aRLQloXdzT#}28>k|iE- zQbjAu5@m@L5AoXFnR(x*AC?p)*Ahu-mlECm0|PF=o$ELM_qjNPl1eJ6q>@T1sicxh zDygKBN-C+Ol1eJ+y3|6yc;LW+eIgQjU);1(xu>6g`qhq(4%*w>?;KD^M+d+53=jRr@ue+ENDWzDyVIwEse3M6Z z?qqy&iXaFUo(h*(0z@JaD$C0_e*8F_w)`H`Q`3t&hP&948f$58-cEOSH!UqKWU{&Y zcDXr@L)?qe-Q7d;_8nw0(~CZadnYHhB5d2%OmANw>l+&>D@%~cWbZ3D@wi83dYZnz zKAN^|yW?AFErcw`{rV<*)Ddf~>V{+_;IH?~_iS zB_8*#2lS=fW|vhueU_Z>vti?=g4Aoe5KqloLqkI&UOYixZ!cBJ7IF*vMLUnZ&M~)uhfe);vs=6AnmIal__rgIag@{mHUCrv%575=w zNvgUERRkviq^hepboeMgopO;xIfxX#e=Al@Sg~RSTbs7=^2;w%nXH`YeG0UpNG2=! z!7mPxPSns?Q-vy0J+F%yIAgIGJ9j?9D+do!nXEtx@PtK#s$@CeKGcP&-%9J6m0X!$Ts<#J*|&`}Q}F`RfAAu6A}X7*7x zWU@I2&V8OwfA-=l3mdr}KYna1URIHu7@xrNJYrsqxaSdz#jf9kh@iDb040LbI-gOr zMvGj(a3z8TjvqV9?%lglO3&L0IF3V3JAA$S5+B~UnsnB3F(W9gK=Luk8iQ*?b|eg; z?;|3J*!&vLn;2sZVHgmE`Jd5f6hG%@PiLJkYHOm_8pK*`7&_JjUwh%>ZGOS)p!t@X zb{wu;z6?N5PY;dj8%b7H5r*M=7iq3b|8&TY(?dMD@dKQ`<}(y(v{GPXF48H@6b`Rl z6T(0tMz8|vrkvm)IM*E^z5sDgdGCGP?l>}p|rvv|7ZNNJLORo(ahKi zPz%hOl6Rc7gki|5>B|iHzA8#3{hn;JW_VL4TyVlk5vw=xM<>o8$Tl84Jx{{g0CX)YrOF+WhuLZG!34M(3BfdpM z6*oxBY*lS7r%t^|E}LQBzJ26!KDk^Dv3BN(1#I2AmABu%z@=ACm}_vAx$K89+Pc5s{s+HtW;V{QOc6bEUg7#bX; zzyBOy_u{)rkXs?)6n zWAi_)6scLA1#s%kldM^@hR2_Hg3-~jcNzN@v+ih|ALVLjZ(c+HWJu4Lk5+mHj4VM8 z5sZbQMxorWc6yJU83d6>wed}5doEag|5$=^l zEY=9tSWF?7n26BV+e1S`1CKuT7*~f!7Tm2nTJcX^=crCr((*ux7k@K|ucK(k-eW*{ z_uQ3(w00O79%giOgbzOWAif_kJUnt!?=zpyk4)2hWt{RU%dx=>@k9bAB3SMRKyv3n z+FHwn^ZnG+q}cuFqomX4(0cKu)JjjYsmdcg6%y4Eg1}&vK@0Z~kYK~SdrY_p2Z?|} z5%@ksgO}OAe?PxVr+Mo)zrCvq`do80KS)n-^lAR~F__R0-q1kL z3us_qpl|J3{b+4%O4Y5b!wcXtQ(T#x_j zFG#=ipYGZx|6tJZ5-W5xCdzS@(t1fQQ^X>HkI7{SrzbMU{KZP_?zR*ir2?WBs8 zr?r=;R&MmVi)7}hV}k8xzw*)ELY;5@U;h{B=l*c{0Gidh&wuwd6^lQvw40A3HbjCP z5(XPC{Ntz7g+8BNR&c)fJ>GuyQ&0Hgqu=qTCJ8cA5@a$2xg6mlUJhT3mYsuURr{yk z_)8V>{&}X$RASABp@0A5|KARpRo$O|lcBFa^DkjG^I(w8s=)UNgRm&)T9$wYU-%=c zKldMueB)0}8Q2i|K4IX$KmM7m(29Nbc`82rTnSD|C6)BP)c*nyC>x|$rJ3FU0000< KMNUMnLSTZ4U}^6F literal 0 HcmV?d00001 diff --git a/SWADroid/res/drawable-ldpi/message_reply.png b/SWADroid/res/drawable-ldpi/message_reply.png new file mode 100644 index 0000000000000000000000000000000000000000..b2248b43f8e4acdfb9b3da6c64639edc89174a4a GIT binary patch literal 1398 zcmV-+1&R8JP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipe_ z3L7dZ4oX=700j0)L_t(o!|j;QiyX%l$3IooJ=3!@tC2K6_8>U|dy(WHI5>y=13AR; z575QIArRI^i81y`M#f-Y{PPguLlg)EbO;0zuyc?x#y*%}VsNm}E8+;ppdY)|?#@cP zJJZwMRbBOb*wtEV&uVv*HA%1@6f|^I*Qeh5zSplCZrLrnW#4r>bLPx{buTq);>nXI z+ex(=f15CQQMgm5PW5gIboT7os8*}}@xXxtk6PzYN`EUbB7sUAGcz;u=Pb*9aqQT! z^7_5##);idyA@ZHALn^NrCOywNKtCHVPL#bC(kXdR{MTiWG!HBB#_Zsj4`Dv10i^s z=(bg!7rP3SBvsNhl>jO>rqo)?jrXH(9s#t{BuP!>Sw>@g4+2OC{}G7N8U+mceUhZ6 zoJ)}r^P^1pNhjD`wF;C{ zv^yP&qQKe$W6X{{V~oMtf}$vBcRFaT5RpyiN85Sm-hKP%&Ce4@F;OK(f@}*$D}^l` zS(el7cJbbCy=I#Vpwpco9j2s%0dZVG8;vn$(r2!XwM6c4gX^8%@0_m93jsOdc7WVWZW;NpR_s+}Yp@VA178s-0 zsdLt|*OwI5<6PJXR0gkNMU?gjjMWkq#W9yI&#ty0U(>)JK#hwl(yUmG&_4`vDs|CH!(5svk*MK48)tfzdZ2B(H4gnGWDlR%jl#L1QfE< zHh^^?Z~bWZo;Y!$U9Z>UttzY_{JgoCKdpZ<<;Gesn`Eqx)`D7p?v^1`KyW2?!BkMCHRKX~ozeL5L?Q&;PE=t@=AJhcVbTIF^Hu77PY6xm(7(xCqE*YEJj zvk&t9SKsP7%ye9DwpA40m_>@xtu}c|Hu6XyI7`R|J~(^Zu64}!y!tlN&p!;nV9*g{{`!{>&fP_3xbF{OZ2N;@p$Azx=>(X{qZ)s@qxn`Rh}=4|MtT z)T(YOwJ?8r>fIt8+?@~ei2ns^Ja+o4>#5)TfBswe5{8*?J+qOrCIA2c07*qoM6N<$ Ef`^KytpET3 literal 0 HcmV?d00001 diff --git a/SWADroid/res/drawable-mdpi/message_reply.png b/SWADroid/res/drawable-mdpi/message_reply.png new file mode 100644 index 0000000000000000000000000000000000000000..5fc789643c565d06684fa399381741838a0c9ad7 GIT binary patch literal 1834 zcmV+_2i5qAP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipe_ z3L6>^*Lw8;00yc_L_t(&-tCxMY+P3rhQGDXnVB;eJEp$p(%89;b3=oYrcYEtNL)k{ z5Gj{8S`?_@0Z~;{l&UY>f{+jtArz{-v{DfuMQY<9o?2C?fs%`q#!X@;LmC>7J#~}R zo*9qlT=w2Pj1yAFN$jzc63M@Gq|uz2v)8}Y`q%mQh9xXv2}@YQ5|*%ph9NV*IC$_N zyLRmYVE_L8oBtnz+_PuTshP3elmNhi0|z!NTefVdtE&rb%tso$qZGwrk%@_k^}BcP z&d&i1Fy&d%Q@yd!Ytw^1B>A9I&0p_HPlqn%^Nj!RE(FV=*!#yWdyEm#XHR;*;WP@to|ooda;-X#*E z6e%x3VPupQD_3HtW12gGt30fwd07jELV;DQR$(k?t?z8lI}S?V;>7~(9qp7#LPYSq1m}hZ>0Z8qbUHn+;O9-? z>M%$pQ*?H9GdOsLwzk&Bf>(<6)>i)U_8_&)$H=5o_0c!qaob4AE#P?`n>KIZ@ZrP6 zWAoF5h~UNJ96J0aqs^VfV{vSw?~8^T*IJA*Y}vepp|gV|J+Gd@Ib1CXm;RxPG_T!A zDT2V-hQnBpN3ekFIBeRuiGhKWY}&LLtu-QYQw=G{;g9(-R`#yttt(U1++@8nfDu8a z$tbBCwQHArxJXa*A0_lFEQ-mAv}R-9M$Vi$O)i(CR`YKVqll16c|3o5jGoSJPEJHb zDvpzII8qH!D#Q;$tTkZ47>geSOw}xI6j7N{?cY0e^h=J7VmgeHzux)4i{Cl$#_VqN z$iLovEs<*aR2T$gn$l#_863yC_L|39ln7P?ryd=ZN`=Bmftc&Ex~GSj8@oor5n)^l z{THsVzPpWoUWstj)s$M|0y+%QVKBq42r}(#1S?`SCJd=eR;g6VZ|!^Jq1=KiAWAVX zFhE~lmTa~Utu_D7=gDR_Afj*t&Xq$>T&@yJrucht3Q>yadLcSO%yDs*Gwpk3YQok# z%UUAkgCAi~<;FE&EmkR}s#Qh`!))8WjdH0>7z6-hvsv=_JZpPaGc+ZfF9)bZnxTmh z*HKvWVLuf_bJd(+LczB}WTY_>3lK{r7&v*7HEViVw{AV9Qn_C0>CDx9pPu_yvH!$H z)~#MezUJ_LEx-}M*Jk#v8Nx`y z?A*CC4@jd2TgF;)DObN*>iofEpug#QNl?zB)WK>)6#S3CB6sMG*zwE1epTX$KRaI9 zitCDqvmg=cC`8vLi7Ml79DnA^pS@ zu^@J~zQkIC)e$!I(Y~L&D=jn=>wnx|P>J+%iN!65U^F%g&e~e_NgYfj!Auw7`n{H^ z*TGCzD2kHjfA#2#*&n^cT|4y5{^Srt&pu4;(v|yF#y=!p>T@EFH98RM*PeQJ?^h1Z z=XvX%{u5!XdiMwnJ^OH7h$&D1=jV@nzU%uhJTI}tx2!Rs!+CFQ^LxL(z&&w;c=s1y zqx*>$DE{Uf-wvylPy3StB{Qv*} literal 0 HcmV?d00001 diff --git a/SWADroid/res/layout/messages_dialog.xml b/SWADroid/res/layout/messages_dialog.xml new file mode 100644 index 00000000..a1f59eea --- /dev/null +++ b/SWADroid/res/layout/messages_dialog.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ 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 1224e3dd..c19ae353 100644 --- a/SWADroid/res/layout/notifications_list_item.xml +++ b/SWADroid/res/layout/notifications_list_item.xml @@ -8,7 +8,10 @@ + + + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="vertical" + android:layout_marginTop="3dip" + android:layout_marginRight="6dip"> Notificaciones Asignaturas Tests - Enviar mensaje + Enviar mensaje ERROR Cerrar Configuración @@ -32,7 +32,7 @@ Notificaciones Obteniendo nuevas notificaciones... 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. + notificaciones más recientes pulse el icono de la esquina superior derecha de la pantalla.Notificaciones descargadas Tests 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... @@ -102,4 +102,12 @@ Error durante la conexión con el servidor Tiempo de espera agotado intentando conectar con el servidor + Enviando mensaje... + Mensaje enviadoError al enviar el mensaje. Compruebe los datos introducidos + Destinatarios (separados por comas) + Asunto + Mensaje + Enviar + + \ No newline at end of file diff --git a/SWADroid/res/values/strings.xml b/SWADroid/res/values/strings.xml index cc953045..f9457ade 100644 --- a/SWADroid/res/values/strings.xml +++ b/SWADroid/res/values/strings.xml @@ -5,7 +5,7 @@ Notifications Courses Tests - Send message + Send message ERROR Close Preferences @@ -30,7 +30,7 @@ Notifications Retrieving new notifications... Did not download any notification.\n\nTo download most recent - notifications click the icon in the upper right of the screen. + notifications click the icon in the upper right of the screen.Notifications downloaded Tests Synchronizing test questions.\n\nDepending of the number of questions to synchronize, the data processing can take several minutes.\n\nPlease wait... @@ -87,16 +87,22 @@ Show details The teacher does not allow to see the details The teacher does not allow to see the results - IMPORTANT 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? - + IMPORTANT + Due to changes in the database all notifications data have been deleted.\n\nSorry. Incorrect user or password Error in server response Error while connecting to server Timeout trying to connect to the server + Sending message... + Message sended successfullyError while sending the message. Check the data in the message fields + Receivers (separated by comma) + Subject + Message + Send \ No newline at end of file diff --git a/SWADroid/src/es/ugr/swad/swadroid/Global.java b/SWADroid/src/es/ugr/swad/swadroid/Global.java index a89cac01..c1fc01a5 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/Global.java +++ b/SWADroid/src/es/ugr/swad/swadroid/Global.java @@ -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 */ diff --git a/SWADroid/src/es/ugr/swad/swadroid/SWADMain.java b/SWADroid/src/es/ugr/swad/swadroid/SWADMain.java index cf1397b8..ebf24cad 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/SWADMain.java +++ b/SWADroid/src/es/ugr/swad/swadroid/SWADMain.java @@ -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; @@ -177,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; @@ -226,7 +229,7 @@ public class SWADMain extends ExpandableListActivity { messagesData.add(map); map = new HashMap(); - 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); diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/Messages.java b/SWADroid/src/es/ugr/swad/swadroid/modules/Messages.java new file mode 100644 index 00000000..f6a6c183 --- /dev/null +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/Messages.java @@ -0,0 +1,202 @@ +/* + * This file is part of SWADroid. + * + * Copyright (C) 2010 Juan Miguel Boyero Corral + * + * 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 . + */ +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 + */ +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(); + } + +} 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 fa67c630..17289556 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/Notifications.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/Notifications.java @@ -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,8 +186,7 @@ public class Notifications extends Module { if (result != null) { //Stores notifications data returned by webservice response - @SuppressWarnings("rawtypes") - 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++) { @@ -240,7 +232,8 @@ public class Notifications extends Module { */ @Override protected void postConnect() { - refreshScreen(); + refreshScreen(); + Toast.makeText(this, R.string.notificationsDownloadedMsg, Toast.LENGTH_SHORT).show(); } /** 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 bf3827c0..97a45c80 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsCursorAdapter.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsCursorAdapter.java @@ -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 * */ -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 Date: Mon, 26 Sep 2011 23:17:33 +0200 Subject: [PATCH 8/8] Bumped version --- HISTORY.md | 5 +++++ SWADroid/AndroidManifest.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 35c1d49b..6a4959a4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +## 0.5 (2011-09-26) + +* Added messages module +* Minor fixes + ## 0.4.5 (2011-07-08) * Optimized questions syncronization diff --git a/SWADroid/AndroidManifest.xml b/SWADroid/AndroidManifest.xml index ba9c2ff3..49e5c452 100644 --- a/SWADroid/AndroidManifest.xml +++ b/SWADroid/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:installLocation="auto" android:versionCode="23" android:versionName="0.5">