Adapted all Modules to work with a global actual course. It is

functional, however, initial states should be revised and better
defined. The appearance should be also improved.
This commit is contained in:
Helena Rodriguez 2012-04-09 18:29:22 +02:00
parent 2056fbe78c
commit 347ef25235
7 changed files with 12 additions and 10 deletions

View File

@ -12,12 +12,10 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:prompt="@string/selectCourseTitle" />
<ExpandableListView
android:id="@+id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="@color/background" >
</ExpandableListView>
</LinearLayout>
</LinearLayout>

View File

@ -30,7 +30,7 @@ public class Global {
/**
* SWAD application key
*/
private static final String AppKey = "";
private static final String AppKey = "HTC-Desire";
/**
* Server URL
*/
@ -271,6 +271,7 @@ public class Global {
public static void setSelectedCourseCode(long actualCourseCode){
if(actualCourseCode >0) selectedCourseCode = actualCourseCode;
}
<<<<<<< HEAD
public static boolean isPreferencesChanged(){
return preferencesChanged;
@ -282,4 +283,6 @@ public class Global {
public static void setPreferencesChanged(boolean newState){
preferencesChanged = newState;
}
=======
>>>>>>> Adapted all Modules to work with a global actual course. It is
}

View File

@ -19,6 +19,7 @@
package es.ugr.swad.swadroid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -441,6 +442,7 @@ public class SWADMain extends MenuExpandableListActivity {
courseCode = courseSelected.getId();
Global.setSelectedCourseCode(courseCode);
int userRole = courseSelected.getUserRole();
if(userRole == 3 && actualRole != 3) createTeacherMenu();
if(userRole == 2 && actualRole != 2) createStudentMenu();
}

View File

@ -412,6 +412,7 @@ public abstract class Module extends MenuActivity {
* Use of KeepAliveHttpsTransport deals with the problems with the Android ssl libraries having trouble
* with certificates and certificate authorities somehow messing up connecting/needing reconnects.
*/
String u =prefs.getServer();
URL = prefs.getServer();
connection = new KeepAliveHttpsTransportSE(URL, 443, "", TIMEOUT);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

View File

@ -199,4 +199,4 @@ public class Notices extends Module {
}
}

View File

@ -74,8 +74,7 @@ public class TestsConfigDownload extends Module {
protected void onStart() {
super.onStart();
prefs.getPreferences(getBaseContext());
try {
try {
if(isDebuggable) {
Log.d(TAG, "selectedCourseCode = " + Long.toString(Global.getSelectedCourseCode()));
}
@ -89,7 +88,7 @@ public class TestsConfigDownload extends Module {
Log.e(ex.getClass().getSimpleName(), errorMsg);
ex.printStackTrace();
}
}
}
}

View File

@ -661,8 +661,7 @@ public class TestsMake extends Module {
} else {
Toast.makeText(getBaseContext(), R.string.testNoQuestionsMsg, Toast.LENGTH_LONG).show();
finish();
}
}
}
/* (non-Javadoc)