working on #329 and #328

parent 21bf9507
......@@ -22,7 +22,6 @@ import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
......@@ -69,6 +68,7 @@ public class Vocabulary implements Iterable<Picto> {
VocabularyTalk.iVocabularyListener vocabulary_listeners[] = {new VocabularyTalk.iVocabularyListener() {
@Override
public void change(action action, int picto_cat, int picto_id, JSONObject args) {
switch (action) {
case delete: {
removePicto(picto_cat, picto_id);
......@@ -169,7 +169,7 @@ public class Vocabulary implements Iterable<Picto> {
*/
public void synchronize() {
Log.e(LOG_TAG,"SYNCRO from "+ Arrays.toString(Thread.currentThread().getStackTrace()));
boolean upload_pending=synchronize_upload(); // (i) uploading
// and (ii) downloading
......@@ -368,7 +368,10 @@ Log.e(LOG_TAG,"SYNCRO from "+ Arrays.toString(Thread.currentThread().getStackTra
int index=find_picto_index(pic_cat, pic_id);
if (index>=0) { //puede ocurrir que se intente modificar un pictograma que fue borrado
Picto picto = this.pictos.get(pic_cat).get(index);
String old_legend=picto.get_legend();
picto.set_json_attr(attrs);
if (!old_legend.equals(picto.get_legend())) //puede ocurrir que se cambie la leyenda de TODOS los pictos
this.synchronize();
PCBcontext.getPcbdb().modifyPicto(pic_id, attrs.toString());
}
else
......
......@@ -188,7 +188,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
if(!PCBcontext.getRoom().inRoom()){
PCBcontext.getRoom().connect();
}
//PCBcontext.getVocabulary().synchronize();
PCBcontext.getVocabulary().synchronize();
synchronizeStudentAttributes();
nextSynchro(now+restfullSynchroTimming);
}
......
......@@ -5,10 +5,8 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
......@@ -18,14 +16,12 @@ import android.speech.tts.UtteranceProgressListener;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.DragEvent;
import android.view.Gravity;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
......@@ -51,7 +47,6 @@ 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;
......@@ -611,7 +606,6 @@ public class VOCA extends Activity implements VocabularyTalk.iVocabularyListener
public void change(action action, int picto_cat, int picto_id, JSONObject args) {
Log.i(LOG_TAG, "Vocabulary action listened: " + action);
if (args != null) Log.d(LOG_TAG, "args: " + args.toString());
vocabulary.synchronize();
refresh();
}
......
......@@ -87,7 +87,7 @@ public class NetServiceTablet implements NetService.iNetServiceDevice {
public void restart_app(boolean resetPrevUser) {
Log.e(LOG_TAG,"App restarting, reset last login:"+resetPrevUser);
Log.i(LOG_TAG,"App restarting, reset last login:"+resetPrevUser);
Context context=PCBcontext.getActivityContext();
......
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