Added the new menu Enrollment for groups choice

This commit is contained in:
Helena Rodriguez 2012-06-13 14:40:11 +02:00
parent 5da67a8ee3
commit 3270c3b16f
11 changed files with 173 additions and 11 deletions

View File

@ -152,6 +152,11 @@
android:label="@string/documentsDownloadModuleLabel"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".modules.groups.MyGroupsManager"
android:label="@string/myGroupsModuleLabel"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<provider
android:name=".sync.DummyProvider"

View File

@ -12,10 +12,12 @@
android:padding="20dip"
android:textColor="@color/foreground1"
android:textSize="24sp"
android:visibility="gone">
android:visibility="gone"
android:text="@string/myGroupsModuleLabel">
</TextView>
<include android:id="@+id/courseNameLayout" layout="@layout/course_or_group_name"/>
<ExpandableListView
android:id="@+id/android:list"
android:layout_width="match_parent"

View File

@ -4,10 +4,9 @@
android:layout_height="match_parent"
android:orientation="vertical"
>
<RadioButton android:id="@+id/radioButton"
<CheckBox android:id="@+id/checkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Prueba"
/>
android:text="Prueba"/>
</RelativeLayout>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/padlockIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/shopper_icon"
android:layout_alignParentLeft="true"
/>
<TextView
android:id="@+id/groupTypeText"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toRightOf="@id/padlockIcon" />
<TextView
android:id="@+id/vacantsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/padlockIcon"
android:text="@string/vacants" />
<TextView
android:id="@+id/numStudentText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/vacantsText"
android:layout_below="@id/padlockIcon"
android:text="@string/numStudent" />
<TextView
android:id="@+id/maxStudentText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/numStudentText"
android:layout_below="@id/padlockIcon"
android:text="@string/numStudent" />
</RelativeLayout>

View File

@ -109,4 +109,6 @@
<string name="vacants">Vacants</string>
<!-- <string name="numStudent">Nombre d'estud.</string> -->
<!-- <string name="maxStudent">Màxim d'estud.</string> -->
<string name="enrollment">Inscripció</string>
<string name="myGroupsModuleLabel">Els meus grups</string>
</resources>

View File

@ -133,4 +133,6 @@ Es muss mindestens ein Antworttyp ausgewählt werden</string>
<string name="vacants">Frei</string>
<string name="numStudent">Anzahl der Stud.</string>
<string name="maxStudent">Max. Stud</string>
<string name="enrollment">Einschreibung</string>
<string name="myGroupsModuleLabel">Meine Gruppen</string>
</resources>

View File

@ -180,5 +180,6 @@
<string name="vacants">Vacantes</string>
<string name="numStudent">Nº de estud.</string>
<string name="maxStudent">Máx.estud</string>
<string name="enrollment">Inscripción</string>
<string name="myGroupsModuleLabel">Mis Grupos</string>
</resources>

View File

@ -185,4 +185,7 @@
<string name="vacants">Vacants</string>
<string name="numStudent">No. of stud.</string>
<string name="maxStudent">Max.stud.</string>
<string name="enrollment">Enrollment</string>
<string name="myGroupsModuleLabel">My groups</string>
</resources>

View File

@ -130,11 +130,14 @@ public class Global {
* Request code for Downloads Manager
* */
public static final int DOWNLOADSMANAGER_REQUEST_CODE = 15;
/**
* Request code for Notify Download
* */
public static final int NOTIFYDOWNLOAD_REQUEST_CODE = 15;
public static final int NOTIFYDOWNLOAD_REQUEST_CODE = 16;
/**
* Request code for MyGroups Manager
* */
public static final int MYGROUPSMANAGER_REQUEST_CODE= 17;
/**
* Prefix tag name for Logcat
*/

View File

@ -58,6 +58,7 @@ import es.ugr.swad.swadroid.modules.Notices;
import es.ugr.swad.swadroid.modules.attendance.Attendance;
import es.ugr.swad.swadroid.modules.downloads.DownloadsManager;
import es.ugr.swad.swadroid.modules.downloads.DirectoryTreeDownload;
import es.ugr.swad.swadroid.modules.groups.MyGroupsManager;
import es.ugr.swad.swadroid.modules.notifications.Notifications;
import es.ugr.swad.swadroid.modules.tests.Tests;
import es.ugr.swad.swadroid.ssl.SecureConnection;
@ -119,10 +120,14 @@ public class SWADMain extends MenuExpandableListActivity {
* Group position inside the main menu for Course group
* */
private int COURSE_GROUP = 2;
/**
* Group position inside the main menu for Enrollment group
* */
private int ENROLLMENT_GROUP = 3;
/**
* Group position inside the main menu for User group
* */
private int USERS_GROUP = 3;
private int USERS_GROUP = 4;
/**
* Child position inside the messages menu for Notification
* */
@ -151,7 +156,10 @@ public class SWADMain extends MenuExpandableListActivity {
* Child position inside the users menu for Rollcall
* */
private int ROLLCALL_CHILD = 0;
/**
* Child position inside the enrollment menu for My Groups
* */
private int MYGROUPS_CHILD = 0;
/**
* Gets the database helper
@ -234,6 +242,9 @@ public class SWADMain extends MenuExpandableListActivity {
/*activity = new Intent(getBaseContext(),DirectoryTreeDownload.class);
activity.putExtra("treeCode",Global.SHARE_AREA_CODE);
startActivityForResult(activity,Global.DIRECTORY_TREE_REQUEST_CODE);*/
}else if(keyword.equals(getString(R.string.myGroupsModuleLabel))){
activity = new Intent(getBaseContext(), MyGroupsManager.class);
startActivityForResult(activity,Global.MYGROUPSMANAGER_REQUEST_CODE);
}
return true;
@ -495,12 +506,16 @@ public class SWADMain extends MenuExpandableListActivity {
evaluation.put(IMAGE, getResources().getDrawable(R.drawable.grades));
headerData.add( evaluation);
//DISABLE until it will be functional
final HashMap<String, Object> courses = new HashMap<String,Object>();
courses.put(NAME, getString(R.string.course));
courses.put(IMAGE, getResources().getDrawable(R.drawable.blackboard));
headerData.add(courses);
final HashMap<String, Object> enrolment = new HashMap<String,Object>();
enrolment.put(NAME, getString(R.string.enrollment));
//enrolment.put(IMAGE, getResources().getDrawable(R.drawable.blackboard));
headerData.add(enrolment);
final ArrayList<ArrayList<HashMap<String, Object>>> childData = new ArrayList<ArrayList<HashMap<String, Object>>>();
final ArrayList<HashMap<String, Object>> messagesData = new ArrayList<HashMap<String, Object>>();
@ -513,6 +528,9 @@ public class SWADMain extends MenuExpandableListActivity {
final ArrayList<HashMap<String,Object>> documentsData = new ArrayList<HashMap<String, Object>>();
childData.add(documentsData);
final ArrayList<HashMap<String,Object>> enrollmentData = new ArrayList<HashMap<String, Object>>();
childData.add(enrollmentData);
//Messages category
HashMap<String, Object> map = new HashMap<String,Object>();
map.put(NAME, getString(R.string.notificationsModuleLabel) );
@ -541,6 +559,13 @@ public class SWADMain extends MenuExpandableListActivity {
map.put(NAME, getString(R.string.sharedsDownloadModuleLabel));
map.put(IMAGE, getResources().getDrawable(R.drawable.folderusers));
documentsData.add(map);
map = new HashMap<String,Object>();
map.put(NAME, getString(R.string.myGroupsModuleLabel));
//map.put(IMAGE, getResources().getDrawable(R.drawable.folder));
enrollmentData.add(map);
setListAdapter( new ImageExpandableListAdapter(
this,
headerData,

View File

@ -0,0 +1,80 @@
package es.ugr.swad.swadroid.modules.groups;
import com.android.dataframework.DataFramework;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.SimpleCursorTreeAdapter;
import android.widget.TextView;
import es.ugr.swad.swadroid.Global;
import es.ugr.swad.swadroid.MenuActivity;
import es.ugr.swad.swadroid.model.DataBaseHelper;
import es.ugr.swad.swadroid.modules.Groups;
import es.ugr.swad.swadroid.R;
public class MyGroupsManager extends MenuActivity {
/**
* Database Framework.
*/
protected static DataFramework db;
@Override
protected void onStart() {
// TODO Auto-generated method stub
super.onStart();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initialize database
try {
db = DataFramework.getInstance();
db.open(this, getPackageName());
dbHelper = new DataBaseHelper(db);
} catch (Exception ex) {
Log.e(ex.getClass().getSimpleName(), ex.getMessage());
ex.printStackTrace();
}
setContentView(R.layout.group_choice);
this.findViewById(R.id.courseSelectedText).setVisibility(View.VISIBLE);
this.findViewById(R.id.groupSpinner).setVisibility(View.GONE);
TextView courseNameText = (TextView) this.findViewById(R.id.courseSelectedText);
courseNameText.setText(Global.getSelectedCourseShortName());
//TODO Add icon for My Groups Module
//ImageView moduleIcon = (ImageView) this.findViewById(R.id.moduleIcon);
//moduleIcon.setBackgroundResource(R.drawable.folder);
TextView moduleText = (TextView) this.findViewById(R.id.moduleName);
moduleText.setText(R.string.myGroupsModuleLabel);
Intent activity = new Intent(getBaseContext(),Groups.class);
startActivityForResult(activity,Global.GROUPS_REQUEST_CODE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
switch (requestCode) {
case Global.GROUPS_REQUEST_CODE:
setMenu();
break;
}
}
}
private void setMenu(){
//TODO Set Adapter for Expandable list
}
}