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:
parent
2056fbe78c
commit
347ef25235
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -199,4 +199,4 @@ public class Notices extends Module {
|
|||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -661,8 +661,7 @@ public class TestsMake extends Module {
|
|||
} else {
|
||||
Toast.makeText(getBaseContext(), R.string.testNoQuestionsMsg, Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Reference in New Issue
Block a user