Merge branch 'develop' of github.com:Amab/SWADroid into develop

This commit is contained in:
Alejandro Alcalde 2014-02-18 20:43:43 +01:00
commit 5f6cb27fc8
2 changed files with 49 additions and 36 deletions

View File

@ -345,6 +345,9 @@
<string name="practicesprogramModuleLabel">Programa de Prácticas</string>
<string name="theoryprogramModuleLabel">Programa de Teoría</string>
<string name="teachingguideModuleLabel">Guía Docente</string>
<string name="informationProgressDescription">Obteniendo información&#8230;\nPor favor, espere&#8230;</string>
<string name="informationProgressTitle">Información</string>
<string name="pradoLoginToast">La contraseña de SWAD tiene al menos 8 caracteres alfanuméricos</string>

View File

@ -23,16 +23,13 @@ import org.ksoap2.serialization.SoapObject;
public class Information extends Module {
public static final String TAG = Constants.APP_TAG + " Information";
/**
* Information Type. String with the type of information (none, HTML, plain text...)
*/
private String infoSrc;
/**
* Information Content. String with the URL of information.
*/
private String infoURL;
/**
* Information Content. String with the content of information.
*/
@ -49,7 +46,7 @@ public class Information extends Module {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview_information_screen_layout);
WebView webview = (WebView) this.findViewById(R.id.contentWebView);
//WebView webview = (WebView) this.findViewById(R.id.contentWebView);
ImageView moduleIcon;
TextView moduleText;
@ -148,10 +145,21 @@ public class Information extends Module {
break;
}
}
}
@Override
protected void connect() {
// TODO Auto-generated method stub
String progressDescription = getString(R.string.informationProgressDescription);
int progressTitle = R.string.informationProgressTitle;
startConnection(true, progressDescription, progressTitle);
}
@Override
protected void requestService() throws Exception {
@ -170,51 +178,51 @@ public class Information extends Module {
//infoType = res.get(1).toString();
//infoContent = res.get(2).toString();
infoSrc = soap.getProperty(infoSrc).toString();
infoTxt = soap.getPrimitiveProperty(infoTxt).toString();
if (infoSrc.equals("none")) {
infoTxt = "Información no disponible";//cargar el string traducible (no esta aun creado)
}
else {
if (infoSrc.equals("URL")) {
infoURL = soap.getPrimitiveProperty(infoTxt).toString();
}
else{
infoTxt = soap.getPrimitiveProperty(infoTxt).toString();
}
}
//Request finalized without errors
setResult(RESULT_OK);
//Request finalized without errors
setResult(RESULT_OK);
}
else{
infoTxt = "es necesaria conexion a internet"; //poner el string traducible correspondiente, si no está, crearlo
infoTxt = getString (R.string.connectionRequired);
}
}
@Override
protected void connect() {
// TODO Auto-generated method stub
}
@Override
protected void postConnect() {
// TODO Auto-generated method stub
WebView webview = (WebView) this.findViewById(R.id.contentWebView);
if (infoSrc.equals("none")) {
webview.loadData("Información no disponible", "text/html; charset=UTF-8", null);//cargar el string traducible (no esta aun creado)
}
else {
if (infoSrc.equals("URL")) {
webview.loadUrl(infoTxt);
}
else{
webview.loadData(infoTxt, "text/html; charset=UTF-8", null);
}
}
finish();
}
@ -223,6 +231,8 @@ public class Information extends Module {
protected void onError() {
// TODO Auto-generated method stub
finish();
}
}