vocabularymanager

parent 4cb773c3
......@@ -26,7 +26,7 @@ public class PictoMenu {
public static final String IMAGE_PICTO = "imagePicto";
public static final String PATH_SOUND = "pathSound";
VOCA activity;
VocabularyManager activity;
//Variables used on the picto menu (only supervisors)
private static final int CAMERA_PIC_REQUEST = 1;
......@@ -40,7 +40,7 @@ public class PictoMenu {
// TODO describe this variable
static final int SELECT_PICTURE = 1;
public PictoMenu(VOCA activity) {
public PictoMenu(VocabularyManager activity) {
this.activity=activity;
}
......
......@@ -51,6 +51,7 @@ import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.pictogram.tts.TTSHelper;
import com.yottacode.tools.GUITools;
import org.json.JSONArray;
import org.json.JSONException;
......@@ -923,23 +924,6 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
*/
private class OnPictoLongClickListener implements AdapterView.OnItemLongClickListener {
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
/*if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
// Si es supervisor al hacer longClick deshabilito ese pictograma o lo habilito
Picto p = getCurrentPictoGridAdapter().getItem(position);
if (p == null) {
// No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria
if (getCurrentCategory() != null || *//*!PCBcontext.getPcbdb().getCurrentUser().has_categories()*//*!PCBcontext.getVocabulary().has_categories()) {
int cat = getCurrentCategory() != null ? currentCategory.get_id() : Picto.NO_CATEGORY;
new PictoMenu(VOCA.this).createMenuForNewPicto(position % maxColumns, (int) (position / maxColumns), cat);
} else
Toast.makeText(VOCA.this, VOCA.this.getResources().getString(R.string.notNewCats), Toast.LENGTH_SHORT).show();
} else {
//Si es supervisor hacer aparecer el menú de opciones del picto
new PictoMenu(VOCA.this).createMenuForPicto(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big(),p);
getCurrentPictoGridAdapter().notifyDataSetChanged();
}
} else {*/
ClipData.Item item = new ClipData.Item("" + position);
String[] mimeTypes = {ClipDescription.MIMETYPE_TEXT_PLAIN};
ClipData data = new ClipData("" + position, mimeTypes, item);
......@@ -961,7 +945,6 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
//view.setVisibility(View.INVISIBLE);
}
}
//}
return true;
}
}
......@@ -1131,58 +1114,47 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
}
}
/*@Override
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
int in=0,out=0;
Intent nextActivity=null;
Intent nextActivity = null;
Intent intent = getIntent();
boolean student_view=intent.getBooleanExtra("student_view",false);
if (PCBcontext.getPcbdb()!=null && (PCBcontext.getPcbdb().getCurrentUser().is_supervisor() || student_view) ) {
if ( PCBcontext.getPcbdb() != null && PCBcontext.getPcbdb().getCurrentUser().is_supervisor() ) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
firstTouchX = event.getX();
break;
case MotionEvent.ACTION_UP:
if (event.getX() > firstTouchX + 150) { //izquierda a derecha
if (!student_view || !PCBcontext.getPcbdb().getCurrentUser().is_teacher()) {
PCBcontext.getPcbdb().getCurrentUser().get_Img_sup().update_id(student_view ? PCBcontext.getDevice().getLastSupId() : User.NO_SUPERVISOR);
nextActivity = intent;
} else
if (!PCBcontext.getNetService().online())
GUITools.show_alert(VOCA.this, R.string.session_noinet);
else {
PCBcontext.getPcbdb().getCurrentUser().get_Img_sup().update_id(PCBcontext.getDevice().getLastSupId());
nextActivity = new Intent(this, SessionActivity.class);
}
in = R.anim.rightin;
out = R.anim.rightout;
overridePendingTransition(R.anim.leftin, R.anim.leftout);
if (event.getX() > firstTouchX + 150) { // izquierda a derecha
// No action
} else if (firstTouchX > event.getX() + 150) { //derecha a izquierda
if (!student_view && PCBcontext.getPcbdb().getCurrentUser().is_teacher() ) {
if (!PCBcontext.getNetService().online())
GUITools.show_alert(VOCA.this, R.string.session_noinet);
else
nextActivity = new Intent(this, SessionActivity.class);
} else {
PCBcontext.getPcbdb().getCurrentUser().get_Img_sup().update_id(student_view ? PCBcontext.getDevice().getLastSupId() : User.NO_SUPERVISOR);
nextActivity = intent;
}
nextActivity = new Intent(this, VocabularyManager.class);
in = R.anim.leftin;
out = R.anim.leftout;
}
if (nextActivity != null) {
tape_delivered=false;
intent.putExtra("student_view", !PCBcontext.getPcbdb().getCurrentUser().is_supervisor());
finish();
startActivity(nextActivity);
overridePendingTransition(in, out);
}
break;
}
}
return super.dispatchTouchEvent(event);
}*/
}
/**
* Para capturar el evento para abrir camara o galeria y procesar
......
......@@ -55,6 +55,12 @@
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.communicator.VocabularyManager"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="landscape" />
<!-- Intent Filter to run the app when the boot is completed -->
<receiver android:name=".kiosk.BootReceiver">
<intent-filter>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment