Commit 095eb04b by Arturo Montejo Ráez

merged

parents e4e19f7b dd4eb9af
Showing with 391 additions and 127 deletions
...@@ -10,7 +10,10 @@ android { ...@@ -10,7 +10,10 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
resValue "string", "db_name", "PCB.db" resValue "string", "db_name", "PCB.db"
resValue "integer", "db_version", "2"
resValue "string", "app_version", "0.0"
resValue "string", "core_vocabulary", "core_vocabulary" resValue "string", "core_vocabulary", "core_vocabulary"
resValue "string", "apk", "to_be_set_in_subproject"
} }
buildTypes { buildTypes {
release { release {
......
...@@ -54,9 +54,9 @@ public class Device extends SQLiteOpenHelper { ...@@ -54,9 +54,9 @@ public class Device extends SQLiteOpenHelper {
*/ */
public Device(Context context, CursorFactory factory, int version) { public Device(Context context, CursorFactory factory, int version) {
super(context, DeviceHelper.getDBName(context), factory, version); super(context, DeviceHelper.getDBName(context), factory, DeviceHelper.getDBVersion(context));
if (DeviceHelper.force_create(context)) { if (DeviceHelper.force_create(context)) {
Log.i(this.getClass().getCanonicalName(),"Forcing create new Database "+DeviceHelper.getDBName(context)); Log.i(this.getClass().getCanonicalName(),"Forcing create new Database "+DeviceHelper.getDBName(context)+" v."+ DeviceHelper.getDBVersion(context));
context.deleteDatabase(DeviceHelper.getDBName(context)); context.deleteDatabase(DeviceHelper.getDBName(context));
Log.i(this.getClass().getCanonicalName(), "Database dropped"); Log.i(this.getClass().getCanonicalName(), "Database dropped");
} }
......
package com.yottacode.pictogram.dao;
import android.content.Context;
import com.yottacode.pictogram.R;
import com.yottacode.pictogram.tools.PCBcontext;
import java.io.InputStream;
/**
* Platform abstraction (Android)
* @see PCBDBHelper
* *
*
* @author Fernando Martinez Santiago
* @version 1.0
*/
public class DeviceHelper {
public static float version= Float.valueOf(PCBcontext.getContext().getResources().getString(R.string.app_version)).floatValue();
public static String getDBName(Context context) {
return context.getResources().getString(R.string.db_name);
}
public static int getDBVersion(Context context) {
return context.getResources().getInteger(R.integer.db_version);
}
public static float getAppVersion(Context context) {
return version;
}
public static float setAppVersion(float version) {
return DeviceHelper.version=version;
}
public static InputStream getDBScriptStream(Context context) {
return context.getResources().openRawResource(R.raw.pcbdb_create);
}
public static boolean force_create(Context context) {
return context.getResources().getBoolean(R.bool.force_db_create);
}
}
...@@ -2,14 +2,12 @@ package com.yottacode.pictogram.dao; ...@@ -2,14 +2,12 @@ package com.yottacode.pictogram.dao;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log; import android.util.Log;
import com.yottacode.pictogram.R;
import com.yottacode.pictogram.action.Action; import com.yottacode.pictogram.action.Action;
import com.yottacode.pictogram.grammar.Vocabulary; import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
...@@ -17,37 +15,10 @@ import com.yottacode.pictogram.tools.PCBcontext; ...@@ -17,37 +15,10 @@ import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.InputStream;
import java.util.Calendar; import java.util.Calendar;
import java.util.Vector; import java.util.Vector;
/** /**
* Platform abstraction (Android)
* @see PCBDBHelper
* *
*
* @author Fernando Martinez Santiago
* @version 1.0
*/
class DeviceHelper {
static String getTimestamp() {
return (new android.text.format.Time()).toString();
}
static String getDBName(Context context) {
return context.getResources().getString(R.string.db_name);
}
static InputStream getDBScriptStream(Context context) {
return context.getResources().openRawResource(R.raw.pcbdb_create);
}
static boolean force_create(Context context) {
return context.getResources().getBoolean(R.bool.force_db_create);
}
}
/**
* Data Access Object to manage Pictogram Communicator Board database regarding a logged user * Data Access Object to manage Pictogram Communicator Board database regarding a logged user
* This class requires: * This class requires:
* The script to create the DB allocated in res/raw/pcbdb_create.sql * The script to create the DB allocated in res/raw/pcbdb_create.sql
...@@ -70,7 +41,7 @@ public class PCBDBHelper extends SQLiteOpenHelper { ...@@ -70,7 +41,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
* @param user the user of the PCB, if any. If not, last user is loaded from the DB * @param user the user of the PCB, if any. If not, last user is loaded from the DB
*/ */
public PCBDBHelper(CursorFactory factory, int version, User user) { public PCBDBHelper(CursorFactory factory, int version, User user) {
super(PCBcontext.getContext(), DeviceHelper.getDBName(PCBcontext.getContext()), factory, version); super(PCBcontext.getContext(), DeviceHelper.getDBName(PCBcontext.getContext()), factory, DeviceHelper.getDBVersion(PCBcontext.getContext()));
this.user_online=false; this.user_online=false;
this.setCurrentUser(user == null ? this.getCurrentUser() : user); this.setCurrentUser(user == null ? this.getCurrentUser() : user);
} }
......
...@@ -29,13 +29,14 @@ public class User { ...@@ -29,13 +29,14 @@ public class User {
} }
public final static class JSON_STUDENT_ATTTRS{ public final static class JSON_STUDENT_ATTTRS{
public enum delivery {clean, one, many}
static String CATEGORIES = "categories"; static String CATEGORIES = "categories";
static String INPUT_FEEDBACK = "input_feedback"; static String INPUT_FEEDBACK = "input_feedback";
static String INPUT_SELECTION = "input_selection"; static String INPUT_SELECTION = "input_selection";
static String PICTOGRAM_SIZE ="size"; static String PICTOGRAM_SIZE ="size";
static String TTS_ENGINE = "tts engine"; static String TTS_ENGINE = "tts engine";
static String TTS_VOICE = "tts voice"; static String TTS_VOICE = "tts voice";
static String DELETE_STRIP = "delete_strip_after_delivery"; static String DELIVERY = "delivery";
} }
public final static class JSON_STUDENT_INPUT_FEEDBACK { public final static class JSON_STUDENT_INPUT_FEEDBACK {
public static String VIBRATION="vibration"; public static String VIBRATION="vibration";
...@@ -270,8 +271,27 @@ public class User { ...@@ -270,8 +271,27 @@ public class User {
* *
* @return input feedback of the student configuration (default: "vibration") * @return input feedback of the student configuration (default: "vibration")
*/ */
public boolean delete_tape_after_delivery() { public JSON_STUDENT_ATTTRS.delivery delivery() {
return input_feedback_on(JSON_STUDENT_ATTTRS.DELETE_STRIP); JSON_STUDENT_ATTTRS.delivery delivery;
try {
switch (this.attributes_stu.getInt(JSON_STUDENT_ATTTRS.DELIVERY)) {
case 0:
delivery = JSON_STUDENT_ATTTRS.delivery.clean;
break;
case 1:
delivery = JSON_STUDENT_ATTTRS.delivery.one;
break;
case 2:
delivery = JSON_STUDENT_ATTTRS.delivery.many;
break;
default:
delivery = JSON_STUDENT_ATTTRS.delivery.one;
break;
}
} catch (JSONException e) {
delivery=JSON_STUDENT_ATTTRS.delivery.one;
}
return delivery;
} }
/** /**
......
package com.yottacode.pictogram.net; package com.yottacode.pictogram.net;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent;
import android.widget.TextView;
import com.yottacode.net.RestapiWrapper; import com.yottacode.net.RestapiWrapper;
import com.yottacode.pictogram.R; import com.yottacode.pictogram.R;
import com.yottacode.pictogram.dao.DeviceHelper;
import com.yottacode.pictogram.dao.LoginException; import com.yottacode.pictogram.dao.LoginException;
import com.yottacode.pictogram.dao.User; import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
...@@ -18,6 +27,8 @@ import java.util.Vector; ...@@ -18,6 +27,8 @@ import java.util.Vector;
import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static android.app.Activity.RESULT_OK;
/** /**
* Background services to be executed every "delay" seconds. Tasks to be executed: * Background services to be executed every "delay" seconds. Tasks to be executed:
...@@ -41,6 +52,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -41,6 +52,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
private long lastRestfullSynchro; private long lastRestfullSynchro;
public NetService(int delay, iNetServiceStatus listener) { public NetService(int delay, iNetServiceStatus listener) {
this.updated=RestapiWrapper.ping(PCBcontext.getContext().getResources().getString(R.string.server), ping_session); this.updated=RestapiWrapper.ping(PCBcontext.getContext().getResources().getString(R.string.server), ping_session);
this.listeners = new Vector<>(2); this.listeners = new Vector<>(2);
this.listeners.add(listener); this.listeners.add(listener);
if (listener instanceof iNetServiceDevice) ((iNetServiceDevice)listener).build(); if (listener instanceof iNetServiceDevice) ((iNetServiceDevice)listener).build();
...@@ -74,7 +86,6 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -74,7 +86,6 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
@Override @Override
public void result(JSONObject result) { public void result(JSONObject result) {
} }
@Override @Override
...@@ -156,6 +167,15 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -156,6 +167,15 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
@Override @Override
public void result(JSONObject result) { public void result(JSONObject result) {
try {
float version=Float.valueOf(result.getString("version")).floatValue();
if (PCBcontext.getActivityContext()!=null && version> DeviceHelper.getAppVersion(PCBcontext.getActivityContext())) {
Log.e(LOG_TAG,"New version is required! from v"+DeviceHelper.getAppVersion(PCBcontext.getContext())+" to v"+version);
newVersionAlert(PCBcontext.getActivityContext(),version);
}
} catch (JSONException e) {
Log.e(LOG_TAG,"PING JSON ERROR: "+result+" "+e.getMessage());
}
if (!updated) { if (!updated) {
lastRestfullSynchro=new Date().getTime(); lastRestfullSynchro=new Date().getTime();
updated = true; updated = true;
...@@ -252,7 +272,39 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -252,7 +272,39 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
device=(iNetServiceDevice)listener; device=(iNetServiceDevice)listener;
return device; return device;
} }
static void newVersionAlert(Context contex, final float vnew) {
final SpannableString s = new SpannableString(contex.getResources().getString(R.string.server)
+ "/" + contex.getResources().getString(R.string.apk));
final TextView tx1 = new TextView(contex);
tx1.setText("\t"+contex.getResources().getString(R.string.new_version_detail) +
"\n\t\t"+ s);
tx1.setTextSize(16);
tx1.setAutoLinkMask(RESULT_OK);
tx1.setMovementMethod(LinkMovementMethod.getInstance());
Linkify.addLinks(s, Linkify.WEB_URLS);
AlertDialog.Builder builder = new AlertDialog.Builder(contex);
builder.setTitle(contex.getResources().getString(R.string.app_name)+": "+contex.getResources().getString(R.string.new_version_title)+" v"+vnew)
.setCancelable(false)
.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
DeviceHelper.setAppVersion(vnew);
}
})
.setView(tx1).setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
return false;
}
}).show();
PCBcontext.setActivityContext(null);
}
/** /**
* Created by Fernando on 12/08/2016. * Created by Fernando on 12/08/2016.
*/ */
......
...@@ -27,6 +27,7 @@ public final class PCBcontext { ...@@ -27,6 +27,7 @@ public final class PCBcontext {
private static ActionLog actionLog; private static ActionLog actionLog;
private static boolean init=false; private static boolean init=false;
private static StudentTalk studentTalk; private static StudentTalk studentTalk;
private static Context activityContext;
/** /**
...@@ -38,6 +39,7 @@ public final class PCBcontext { ...@@ -38,6 +39,7 @@ public final class PCBcontext {
init = true; init = true;
context = c; context = c;
device = new Device(c, null, 2); device = new Device(c, null, 2);
activityContext=null;
SSLDummyContext.init(context.getResources().getBoolean(R.bool.ssl_connect)); SSLDummyContext.init(context.getResources().getBoolean(R.bool.ssl_connect));
service = new NetService(context.getResources().getInteger(R.integer.netservice_timing),listener); service = new NetService(context.getResources().getInteger(R.integer.netservice_timing),listener);
wrapper = new RestapiWrapper(context.getResources().getString(R.string.server), null, service); wrapper = new RestapiWrapper(context.getResources().getString(R.string.server), null, service);
...@@ -225,4 +227,12 @@ public final class PCBcontext { ...@@ -225,4 +227,12 @@ public final class PCBcontext {
} }
return actionLog; return actionLog;
} }
public static void setActivityContext(Context context) {
PCBcontext.activityContext = context;
}
public static Context getActivityContext() {
return activityContext;
}
} }
...@@ -66,6 +66,9 @@ ...@@ -66,6 +66,9 @@
<string name="mirror_mode_off">Mirror mode off</string> <string name="mirror_mode_off">Mirror mode off</string>
<string name="mirror_mode_on">Mirror mode on</string> <string name="mirror_mode_on">Mirror mode on</string>
<string name="new_version_title">New version available</string>
<string name="new_version_detail">Please, download and install the new version available at</string>
<!--default tts engine and voice--> <!--default tts engine and voice-->
<string name="default_tts_engine">com.google.android.tts</string> <string name="default_tts_engine">com.google.android.tts</string>
<string name="default_tts_voice_male">en-gb-x-rjs#male_1-local</string> <string name="default_tts_voice_male">en-gb-x-rjs#male_1-local</string>
......
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
<string name="mirror_mode_off">Modo espejo desactivado</string> <string name="mirror_mode_off">Modo espejo desactivado</string>
<string name="mirror_mode_on">Modo espejo activado</string> <string name="mirror_mode_on">Modo espejo activado</string>
<string name="new_version_title">Nueva versión disponible</string>
<string name="new_version_detail">Por favor descargue e instale la nueva versión disponible en</string>
<!--default tts engine and voice--> <!--default tts engine and voice-->
<string name="default_tts_engine">com.google.android.tts</string> <string name="default_tts_engine">com.google.android.tts</string>
<string name="default_tts_voice_male">es-es-x-ana#male_1-local</string> <string name="default_tts_voice_male">es-es-x-ana#male_1-local</string>
......
...@@ -82,6 +82,10 @@ ...@@ -82,6 +82,10 @@
<string name="mirror_mode_off">Modo espejo desactivado</string> <string name="mirror_mode_off">Modo espejo desactivado</string>
<string name="mirror_mode_on">Modo espejo activado</string> <string name="mirror_mode_on">Modo espejo activado</string>
<!--new app version alertbox-->
<string name="new_version_title">Nueva versión disponible</string>
<string name="new_version_detail">Por favor descargue e instale la nueva versión disponible en</string>
<!--default tts engine and voice--> <!--default tts engine and voice-->
<string name="default_tts_engine">com.google.android.tts</string> <string name="default_tts_engine">com.google.android.tts</string>
<string name="default_tts_voice_male">en-gb-x-rjs#male_1-local</string> <string name="default_tts_voice_male">en-gb-x-rjs#male_1-local</string>
......
...@@ -19,6 +19,7 @@ android { ...@@ -19,6 +19,7 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
resValue "string","SerialClass","com.yottacode.pictogram.supervisor_tablet.gui.Supervisor_SerialActivity" resValue "string","SerialClass","com.yottacode.pictogram.supervisor_tablet.gui.Supervisor_SerialActivity"
resValue "string","apk","pictograms.apk"
// signingConfig signingConfigs.config // signingConfig signingConfigs.config
} }
productFlavors { productFlavors {
......
...@@ -16,6 +16,7 @@ import android.widget.ImageView; ...@@ -16,6 +16,7 @@ import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
...@@ -110,7 +111,7 @@ public class PictoAnimation { ...@@ -110,7 +111,7 @@ public class PictoAnimation {
public void onAnimationUpdate(ValueAnimator animation) { public void onAnimationUpdate(ValueAnimator animation) {
int i=(int)animation.getAnimatedValue(); int i=(int)animation.getAnimatedValue();
v.setTranslationY(i); v.setTranslationY(i);
//if (i<=255) activity.ttsButton.setImageAlpha(255-i); if (PCBcontext.getPcbdb().getCurrentUser().delivery()== User.JSON_STUDENT_ATTTRS.delivery.one && i<=255) activity.ttsButton.setImageAlpha(255-i);
} }
......
...@@ -30,8 +30,6 @@ import com.yottacode.pictogram.tabletlibrary.cropper.CropImageView; ...@@ -30,8 +30,6 @@ import com.yottacode.pictogram.tabletlibrary.cropper.CropImageView;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import static android.graphics.Color.BLACK; import static android.graphics.Color.BLACK;
...@@ -425,7 +423,7 @@ public class PictoMenu { ...@@ -425,7 +423,7 @@ public class PictoMenu {
activity.setContentView(R.layout.crop_layout); activity.setContentView(R.layout.crop_layout);
final CropImageView cropImageView = (CropImageView) activity.findViewById(R.id.CropImageView); final CropImageView cropImageView = (CropImageView) activity.findViewById(R.id.CropImageView);
cropImageView.setImageResource(R.drawable.descarga); cropImageView.setImageResource(R.drawable.common_full_open_on_phone);
final ImageView croppedImageView = (ImageView) activity.findViewById(R.id.croppedImageView); final ImageView croppedImageView = (ImageView) activity.findViewById(R.id.croppedImageView);
final Button cropButton = (Button) activity.findViewById(R.id.Button_crop); final Button cropButton = (Button) activity.findViewById(R.id.Button_crop);
......
...@@ -117,7 +117,6 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -117,7 +117,6 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// blockNotificationBar(); // blockNotificationBar();
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big() ? R.layout.activity_pictogram_big : R.layout.activity_pictogram); setContentView(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big() ? R.layout.activity_pictogram_big : R.layout.activity_pictogram);
...@@ -245,6 +244,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -245,6 +244,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
PCBcontext.setActivityContext(this);
Toast.makeText(this.getBaseContext(), PCBcontext.getPcbdb().getCurrentUser().get_name_stu()+" "+PCBcontext.getPcbdb().getCurrentUser().get_surname_stu()+ Toast.makeText(this.getBaseContext(), PCBcontext.getPcbdb().getCurrentUser().get_name_stu()+" "+PCBcontext.getPcbdb().getCurrentUser().get_surname_stu()+
(PCBcontext.getPcbdb().getCurrentUser().is_supervisor() (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()
? " ("+ PCBcontext.getPcbdb().getCurrentUser().get_name_sup()+" "+PCBcontext.getPcbdb().getCurrentUser().get_surname_sup()+")" ? " ("+ PCBcontext.getPcbdb().getCurrentUser().get_name_sup()+" "+PCBcontext.getPcbdb().getCurrentUser().get_surname_sup()+")"
...@@ -872,7 +872,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -872,7 +872,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
PCBcontext.getActionLog().log(new PictosAction(lp)); PCBcontext.getActionLog().log(new PictosAction(lp));
tapeAdapter.ttsAllNew(tts); tapeAdapter.ttsAllNew(tts);
new PictoAnimation().animateTapeView(0,(ViewGroup)arg0.getParent()); new PictoAnimation().animateTapeView(0,(ViewGroup)arg0.getParent());
if (!PCBcontext.getPcbdb().getCurrentUser().delete_tape_after_delivery()) { if (PCBcontext.getPcbdb().getCurrentUser().delivery()!= User.JSON_STUDENT_ATTTRS.delivery.clean) {
showOnlyTape(true); showOnlyTape(true);
} }
} }
...@@ -884,7 +884,8 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -884,7 +884,8 @@ protected void showOnlyTape(boolean onlyTape) {
this.tape_delivered=onlyTape; this.tape_delivered=onlyTape;
if (onlyTape) { if (onlyTape) {
if (!tape_delivered_prev) { if (!tape_delivered_prev) {
//ttsButton.setEnabled(false); if (PCBcontext.getPcbdb().getCurrentUser().delivery()== User.JSON_STUDENT_ATTTRS.delivery.one)
ttsButton.setEnabled(false);
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) { if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.showPictoCategoriesViewButton.setVisibility(View.INVISIBLE); this.showPictoCategoriesViewButton.setVisibility(View.INVISIBLE);
this.pictoCategoryGridView.setVisibility(View.INVISIBLE); this.pictoCategoryGridView.setVisibility(View.INVISIBLE);
...@@ -900,7 +901,8 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -900,7 +901,8 @@ protected void showOnlyTape(boolean onlyTape) {
} }
} }
else { else {
//ttsButton.setEnabled(true); if (PCBcontext.getPcbdb().getCurrentUser().delivery()== User.JSON_STUDENT_ATTTRS.delivery.one)
ttsButton.setEnabled(true);
new PictoAnimation().animateTapeViewVertical(this,true); new PictoAnimation().animateTapeViewVertical(this,true);
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) { if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.showPictoCategoriesViewButton.setVisibility(View.VISIBLE); this.showPictoCategoriesViewButton.setVisibility(View.VISIBLE);
......
...@@ -9,6 +9,7 @@ import android.view.ViewGroup; ...@@ -9,6 +9,7 @@ import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.pictogram.tts.TTSHelper; import com.yottacode.pictogram.tts.TTSHelper;
...@@ -66,7 +67,7 @@ public class TapeAdapter extends BaseAdapter { ...@@ -66,7 +67,7 @@ public class TapeAdapter extends BaseAdapter {
// ELIMINAR TODOS LOS ITEMS DEL ADAPTADOR // ELIMINAR TODOS LOS ITEMS DEL ADAPTADOR
public void endPlay() { public void endPlay() {
if (PCBcontext.getPcbdb().getCurrentUser().delete_tape_after_delivery()) if (PCBcontext.getPcbdb().getCurrentUser().delivery()==User.JSON_STUDENT_ATTTRS.delivery.clean)
clear(); clear();
play = false; play = false;
} }
......
...@@ -69,7 +69,6 @@ public class LoginActivity extends FragmentActivity { ...@@ -69,7 +69,6 @@ public class LoginActivity extends FragmentActivity {
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
// Set supervisor information on topbar // Set supervisor information on topbar
final TextView supervisorFullNameView = (TextView) findViewById(R.id.loginTopbarSupervisorFullName); final TextView supervisorFullNameView = (TextView) findViewById(R.id.loginTopbarSupervisorFullName);
final TextView supervisorUserNameView = (TextView) findViewById(R.id.loginTopbarSupervisorUserName); final TextView supervisorUserNameView = (TextView) findViewById(R.id.loginTopbarSupervisorUserName);
final ImageView supervisorPhotoView = (ImageView) findViewById(R.id.loginTopbarSupervisorPhoto); final ImageView supervisorPhotoView = (ImageView) findViewById(R.id.loginTopbarSupervisorPhoto);
...@@ -115,4 +114,9 @@ public class LoginActivity extends FragmentActivity { ...@@ -115,4 +114,9 @@ public class LoginActivity extends FragmentActivity {
Log.i(LOG_TAG,"Closing Login window"); Log.i(LOG_TAG,"Closing Login window");
PCBcontext.getNetService().closeNotifyStatus(); PCBcontext.getNetService().closeNotifyStatus();
} }
@Override
public void onResume() {
super.onResume();
PCBcontext.setActivityContext(this);
}
} }
...@@ -10,7 +10,6 @@ import android.view.Window; ...@@ -10,7 +10,6 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
public class MainActivity extends Activity { public class MainActivity extends Activity {
......
...@@ -198,5 +198,4 @@ public class SerialActivity extends Activity { ...@@ -198,5 +198,4 @@ public class SerialActivity extends Activity {
} }
} }
...@@ -402,7 +402,11 @@ public class SessionActivity extends FragmentActivity implements ListInstruction ...@@ -402,7 +402,11 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
} }
} }
@Override
public void onResume() {
super.onResume();
PCBcontext.setActivityContext(this);
}
@Override @Override
public void onDestroy() { public void onDestroy() {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<facet type="android" name="Android"> <facet type="android" name="Android">
<configuration> <configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" /> <option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" /> <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" /> <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks> <afterSyncTasks>
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" /> <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" /> <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" /> <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="PROJECT_TYPE" value="1" /> <option name="LIBRARY_PROJECT" value="true" />
</configuration> </configuration>
</facet> </facet>
</component> </component>
...@@ -53,6 +54,7 @@ ...@@ -53,6 +54,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
...@@ -60,6 +62,7 @@ ...@@ -60,6 +62,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
...@@ -67,6 +70,7 @@ ...@@ -67,6 +70,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
...@@ -74,6 +78,7 @@ ...@@ -74,6 +78,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
...@@ -81,8 +86,10 @@ ...@@ -81,8 +86,10 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
...@@ -98,10 +105,16 @@ ...@@ -98,10 +105,16 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/typedefs.txt" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" /> <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
...@@ -117,6 +130,7 @@ ...@@ -117,6 +130,7 @@
<orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" /> <orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" /> <orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
<orderEntry type="module" module-name="commonlibrary" exported="" /> <orderEntry type="module" module-name="commonlibrary" exported="" />
<orderEntry type="library" exported="" name="android-android-24" level="project" />
<orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" /> <orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="socket.io-client-0.5.0" level="project" /> <orderEntry type="library" exported="" name="socket.io-client-0.5.0" level="project" />
......
...@@ -19,11 +19,12 @@ android { ...@@ -19,11 +19,12 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity" resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity"
resValue "string","apk","pictogram.apk"
// signingConfig signingConfigs.config // signingConfig signingConfigs.config
} }
productFlavors { productFlavors {
CIFlavor { CIFlavor {
resValue "string", "server", "https://ci.yottacode.com" resValue "string", "server", "http://ci.yottacode.com"
resValue "bool", "ssl_connect", "false" resValue "bool", "ssl_connect", "false"
} }
DevFlavor { DevFlavor {
......
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
</facet> </facet>
<facet type="android" name="Android"> <facet type="android" name="Android">
<configuration> <configuration>
<option name="SELECTED_BUILD_VARIANT" value="LocalFlavorDebug" /> <option name="SELECTED_BUILD_VARIANT" value="DevFlavorDebug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleLocalFlavorDebug" /> <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileLocalFlavorDebugSources" /> <option name="ASSEMBLE_TASK_NAME" value="assembleDevFlavorDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDevFlavorDebugSources" />
<afterSyncTasks> <afterSyncTasks>
<task>generateLocalFlavorDebugSources</task> <task>generateDevFlavorDebugSources</task>
</afterSyncTasks> </afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" /> <option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" /> <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
...@@ -23,8 +24,8 @@ ...@@ -23,8 +24,8 @@
</facet> </facet>
</component> </component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/LocalFlavor/debug" /> <output url="file://$MODULE_DIR$/build/intermediates/classes/DevFlavor/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/LocalFlavor/debug" /> <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/DevFlavor/debug" />
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/LocalFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/LocalFlavor/debug" isTestSource="false" generated="true" />
...@@ -81,6 +82,7 @@ ...@@ -81,6 +82,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
...@@ -88,6 +90,7 @@ ...@@ -88,6 +90,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
...@@ -95,15 +98,17 @@ ...@@ -95,15 +98,17 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
...@@ -121,6 +126,17 @@ ...@@ -121,6 +126,17 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
...@@ -135,6 +151,7 @@ ...@@ -135,6 +151,7 @@
<orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" /> <orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" /> <orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
<orderEntry type="module" module-name="tabletlibrary" exported="" /> <orderEntry type="module" module-name="tabletlibrary" exported="" />
<orderEntry type="library" exported="" name="android-android-24" level="project" />
<orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" /> <orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="socket.io-client-0.5.0" level="project" /> <orderEntry type="library" exported="" name="socket.io-client-0.5.0" level="project" />
...@@ -161,4 +178,4 @@ ...@@ -161,4 +178,4 @@
<orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" /> <orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
</component> </component>
</module> </module>
\ No newline at end of file
#!/bin/bash #!/bin/bash
cd /vagrant/
echo "--Descargando coleccion de pictogramas" echo "--Descargando coleccion de pictogramas"
wget http://dev.yottacode.com/symbolstx.tgz.gpg /vagrant/ wget http://dev.yottacode.com/symbolstx.tgz.gpg
wget http://dev.yottacode.com/upload.tgz.gpg /vagrant/ wget http://dev.yottacode.com/upload.tgz.gpg
echo "--Desencriptando coleccion" echo "--Desencriptando coleccion"
echo r\"YjtnB+a4$.M*nJ | gpg --batch --no-tty --yes --passphrase-fd 0 symbolstx.tgz.gpg echo r\"YjtnB+a4$.M*nJ | gpg --batch --no-tty --yes --passphrase-fd 0 symbolstx.tgz.gpg
echo r\"YjtnB+a4$.M*nJ | gpg --batch --no-tty --yes --passphrase-fd 0 upload.tgz.gpg echo r\"YjtnB+a4$.M*nJ | gpg --batch --no-tty --yes --passphrase-fd 0 upload.tgz.gpg
echo "--Descomprimiendo coleccion" echo "--Descomprimiendo coleccion"
tar zxvf /vagrant/upload.tgz
tar zxvf /vagrant/symbolstx.tgz tar zxvf /vagrant/symbolstx.tgz
tar zxvf /vagrant/upload.tgz
echo "--Renombrado y borrado de archivos" echo "--Renombrado y borrado de archivos"
rm upload.tgz rm upload.tgz
rm upload.tgz.gpg rm upload.tgz.gpg
rm symbolstx.tgz rm symbolstx.tgz
rm symbolstx.tgz.gpg rm symbolstx.tgz.gpg
mv /vagrant/symbolstx_96x82 /vagrant/symbolstx mv symbolstx_96x82 symbolstx
...@@ -11,7 +11,9 @@ module.exports = { ...@@ -11,7 +11,9 @@ module.exports = {
* @param {response} res {} * @param {response} res {}
*/ */
ping: function (req, res) { ping: function (req, res) {
res.ok(); res.ok({
version: sails.config.pictogram.version
});
}, },
/** /**
...@@ -21,6 +23,8 @@ module.exports = { ...@@ -21,6 +23,8 @@ module.exports = {
* @param {response} res {} * @param {response} res {}
*/ */
ping_session: function (req, res) { ping_session: function (req, res) {
res.ok(); res.ok({
version: sails.config.pictogram.version
});
} }
}; };
...@@ -182,6 +182,7 @@ ...@@ -182,6 +182,7 @@
"man": "Man", "man": "Man",
"March": "March", "March": "March",
"mark": "Mark", "mark": "Mark",
"max_expression": "Expression must be a maximun of 11-12 characters.",
"max_licenses_reached": "Maximum number of licenses reached by the office", "max_licenses_reached": "Maximum number of licenses reached by the office",
"May": "May", "May": "May",
"method_name_duplicated": "Template '{{method_name}}' already exists", "method_name_duplicated": "Template '{{method_name}}' already exists",
...@@ -224,9 +225,11 @@ ...@@ -224,9 +225,11 @@
"office_not_updated": "Office not updated", "office_not_updated": "Office not updated",
"office_updated": "Office updated", "office_updated": "Office updated",
"offices": "Offices", "offices": "Offices",
"options": "Options",
"own_instructions": "Own method templates", "own_instructions": "Own method templates",
"own_labels": "Your labels", "own_labels": "Your labels",
"own_pictos": "Your pictograms", "own_pictos": "Your pictograms",
"tos": "Your pictograms",
"pages": "Pages", "pages": "Pages",
"password": "Password", "password": "Password",
"password_changed": "Password changed sucessfully", "password_changed": "Password changed sucessfully",
......
...@@ -182,6 +182,7 @@ ...@@ -182,6 +182,7 @@
"man": "Hombre", "man": "Hombre",
"March": "Marzo", "March": "Marzo",
"mark": "Marcar", "mark": "Marcar",
"max_expression": "La expresión debe tener un máximo de 11-12 caracteres.",
"max_licenses_reached": "Número de licencias máximo alcanzado por la oficina", "max_licenses_reached": "Número de licencias máximo alcanzado por la oficina",
"May": "Mayo", "May": "Mayo",
"method_name_duplicated": "La plantilla '{{method_name}}' ya existe", "method_name_duplicated": "La plantilla '{{method_name}}' ya existe",
...@@ -225,9 +226,10 @@ ...@@ -225,9 +226,10 @@
"office_not_updated": "El gabinete no se ha podido actualizar", "office_not_updated": "El gabinete no se ha podido actualizar",
"office_updated": "Gabinete actualizado", "office_updated": "Gabinete actualizado",
"offices": "Gabinetes", "offices": "Gabinetes",
"options": "Opciones",
"own_instructions": "Plantillas de métodos propias", "own_instructions": "Plantillas de métodos propias",
"own_labels": "Propias", "own_labels": "Etiquetas propias",
"own_pictos": "Propios", "own_pictos": "Pictogramas propios",
"pages": "Páginas", "pages": "Páginas",
"password": "Contraseña", "password": "Contraseña",
"password_changed": "La clave ha sido modificada exitosamente.", "password_changed": "La clave ha sido modificada exitosamente.",
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="alert alert-info" style="margin: 0 auto;"> <div class="alert alert-info" style="margin: 0 auto;" translate>
<strong>¡Atención!</strong> La expresión debe tener un máximo de 8-10 caracteres. max_expression
</div> </div>
</div> </div>
</div> </div>
......
...@@ -49,8 +49,18 @@ ...@@ -49,8 +49,18 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label translate>license_number</label> <label translate>license_number</label>
<input type="text" id="setup_license" mask="9999-9999-9999-9999" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formUser.license_number" required> <input type="text" id="setup_license" class="form-control" mask="9999-9999-9999-9999" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formUser.license_number" required>
<br/>
<div ng-show="studentData.license && !studentData.license_expired" class="alert alert-info" role="alert">
<i class="fa fa-info-circle" aria-hidden="true"></i> {{ 'license_expires' | translate }} {{ studentData.expiration_date }}
</div>
<div ng-show="studentData.license && studentData.license_expired" class="alert alert-warning" role="alert">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i> {{ 'license_expired' | translate }} {{ studentData.expiration_date }}
</div>
<div ng-show="!studentData.license" class="alert alert-danger" role="alert">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i> {{ 'license_missing' | translate }}
</div>
<!-- VERSION SOLO TEXTO
<span ng-show="studentData.license && !studentData.license_expired" class="text-info"> <span ng-show="studentData.license && !studentData.license_expired" class="text-info">
({{ 'license_expires' | translate }} {{ studentData.expiration_date }}) ({{ 'license_expires' | translate }} {{ studentData.expiration_date }})
</span> </span>
...@@ -60,6 +70,7 @@ ...@@ -60,6 +70,7 @@
<span ng-show="!studentData.license" class="text-danger"> <span ng-show="!studentData.license" class="text-danger">
({{ 'license_missing' | translate }}) ({{ 'license_missing' | translate }})
</span> </span>
-->
</div> </div>
</fieldset> </fieldset>
</div> </div>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
//----------------------- //-----------------------
// Supervisor Controller // Supervisor Controller
//----------------------- //-----------------------
dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl($scope, $window, $location, IOService) { dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl($scope, $window, $location, IOService, $modal) {
// Restore user data from session // Restore user data from session
var user = JSON.parse($window.sessionStorage.user); var user = JSON.parse($window.sessionStorage.user);
...@@ -32,4 +32,62 @@ dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl($scope ...@@ -32,4 +32,62 @@ dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl($scope
id_sup: $scope.user.id id_sup: $scope.user.id
} }
}); });
//
// Own Pictos
//
$scope.own_pictos = function () {
console.log();
var modalInstance = $modal.open({
animation: true,
templateUrl: 'modules/supervisor/views/own_pictos.html',
controller: 'AddPictoCtrl',
size: 'lg',
resolve: {
student: function () {
return $scope.studentData;
},
supervisor: function () {
return $scope.user;
}
}
});
// Returned data from the modal window
modalInstance.result.then(function (pictoId) {
// Send the picto to the server
$http.post(config.backend + '/stu/' + $scope.studentData.id + '/picto/' + pictoId, {
attributes: {
id_cat: $scope.showFreeCategory ? null : $scope.getCategoryId($scope.selectedCategory),
coord_x: $scope.showFreeCategory ? null : col,
coord_y: $scope.showFreeCategory ? null : row,
status: 'enabled',
free_category_coord_x: $scope.showFreeCategory ? col : null,
free_category_coord_y: $scope.showFreeCategory ? row : null
}
})
.success(function (studentPicto) {
console.log(studentPicto);
placePicto(studentPicto);
io.socket.post('/stu/vocabulary', {
action: 'add',
attributes: {
id_stu: $scope.studentData.id,
stu_picto: studentPicto
}
}, function () {});
})
.error(function (err) {
if (err.code && err.code == 1) // codes are in sails/config/pictogram.js
ngToast.danger({ content: $translate.instant('error_duplicated_picto') });
else
ngToast.danger({ content: $translate.instant('error_adding_picto') });
});
// not needed
// $scope.loadPictos();
});
};
}); });
...@@ -3,18 +3,33 @@ ...@@ -3,18 +3,33 @@
//-------------------------- //--------------------------
// Admin Supervisors Controller // Admin Supervisors Controller
//-------------------------- //--------------------------
dashboardControllers.controller('AdminSupervisorsCtrl', function AdminSupervisorsCtrl($scope, $window, $http, config, $translate, ngToast) { dashboardControllers.controller('SupervisorsCtrl', function SupervisorsCtrl($scope, $window, $http, config, $translate, ngToast) {
// List of supervisors //Office ID
$http $http
.get(config.backend+'/office/get/:id/supervisors') .get(config.backend+'/office/get_all')
.success(function(data, status, headers, config) { .success(function(data, status, headers, config) {
$scope.supervisors_list = data; // Add to list
$scope.office = data[0];
$scope.supervisors_list();
}) })
.error(function(data, status, headers, config) { .error(function(data, status, headers, config) {
$translate('error_downloading_supervisors').then(function (translation) { console.log("Error from API: " + data.error);
ngToast.danger({ content: translation });
});
}); });
// List of supervisors
$scope.supervisors_list = function(){
$http
.get(config.backend+'/office/get/' + $scope.office.id + '/supervisors')
.success(function(data, status, headers, config) {
$scope.supervisors_list = data;
console.log($scope.supervisors_list);
})
.error(function(data, status, headers, config) {
$translate('error_downloading_supervisors').then(function (translation) {
ngToast.danger({ content: translation });
});
});
};
}); });
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
{{ 'students' | translate }} {{ 'students' | translate }}
</a> </a>
</li> </li>
<li> <li ng-if="user.isSupAdmin == true">
<a class="pointer" role="menuitem" tabindex="0" href="/app/#/supervisors_list"> <a class="pointer" role="menuitem" tabindex="0" href="/app/#/supervisor/list">
<i class="fa fa-users" aria-hidden="true"></i> <i class="fa fa-users" aria-hidden="true"></i>
{{ 'supervisors' | translate }} {{ 'supervisors' | translate }}
</a> </a>
...@@ -44,6 +44,12 @@ ...@@ -44,6 +44,12 @@
</a> </a>
</li> </li>
<li> <li>
<a ng-click="own_pictos()" class="pointer" role="menuitem" tabindex="0" href="">
<i class="glyphicon glyphicon-picture" aria-hidden="true"></i>
{{ 'own_pictos' | translate }}
</a>
</li>
<li>
<a class="pointer" role="menuitem" tabindex="0" href="/app/#/setup"> <a class="pointer" role="menuitem" tabindex="0" href="/app/#/setup">
<i class="glyphicon glyphicon-cog" aria-hidden="true"></i> <i class="glyphicon glyphicon-cog" aria-hidden="true"></i>
{{ 'setup' | translate }} {{ 'setup' | translate }}
......
<!-- Supervisors --> <!-- Supervisors -->
<div class="panel panel-default">
<div class="row"> <div class="panel-heading">
<div ng-class="{'col-md-12':hidesupervisoradd === true && hidesupervisorupdate === true, 'col-md-8':hidesupervisoradd === false || hidesupervisorupdate === false}">
<h3 translate>supervisors</h3>
<div class="row"> <div class="row">
<div class="col-xs-3"> <div class="col-xs-4">
<a ng-click="resetForm(); hidesupervisoradd = false" class="btn btn-success btn-sm" role="button"> <h5 translate>supervisors</h5>
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> {{ 'add_supervisor' | translate }}
</a>
</div> </div>
<div class="col-xs-6 input-group"> <div class="col-xs-4">
<input type="text" ng-model="search_sups" id="search_sups" placeholder="{{ 'filter' | translate }}" class="form-control" aria-describedby="basic-addon2">
<span class="input-group-addon glyphicon glyphicon-search" id="basic-addon2" aria-hidden="true"></span>
</div> </div>
<div class="col-xs-3"> <div class="col-xs-4">
<div class=" input-group">
<input type="text" ng-model="search_sups" id="search_sups" placeholder="{{ 'filter' | translate }}" class="form-control" aria-describedby="basic-addon2">
<span class="input-group-addon glyphicon glyphicon-search" id="basic-addon2" aria-hidden="true"></span>
</div>
</div> </div>
</div> </div>
</div>
<table class="table table-striped"> <div class="table-responsive">
<tr> <table class="table">
<th translate>name</th> <thead class="thead-default">
<th translate>email</th> <tr>
<th>Ops</th> <th translate>supervisors</th>
</tr> <th translate>students</th>
<tr ng-repeat="supervisor in supervisors | filter:search_sups | orderBy: 'name'"> </tr>
<td class="color_blue">{{supervisor.name}} {{supervisor.surname}}</td> </thead>
<td>{{supervisor.email}}</td> <tbody>
<td class="ops"> <tr class="active" ng-repeat="supervisor in supervisors_list | filter:search_sups | orderBy: 'name'">
<a ng-click="update_supervisor(supervisor)" title="{{'edit'|translate}}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a> <td>
<div>
<a ng-click="delete_supervisor(supervisor)" title="{{'delete'|translate}}"><span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span></a> <div class="col-xs-2">
</td> <div class="thumbnail">
</tr> <img ng-src="/upload/supervisorAvatar/{{supervisor.pic}}" alt="Supervisor" title="Supervisor" />
</div>
</div>
<div class="col-xs-10">
<h4>{{supervisor.name}} {{supervisor.surname}}</h4>
<p><i class="fa fa-envelope" aria-hidden="true">&nbsp</i><a href="mailto:{{supervisor.email}}">{{supervisor.email}}</a></p>
<p><i class="fa fa-phone-square" aria-hidden="true"></i>&nbsp<a href="tel:{{supervisor.phone}}">{{supervisor.phone}}</a></p>
</div>
</div>
</td>
<td>
<div class="list-group">
<a ng-repeat="student in supervisor.students" href="/app/#/student/{{student.id}}/setup" class="list-group-item">
<img class="thumbnail img_profile_small" ng-src="{{student.pic}}" alt="" title="" />
{{ student.name }} {{ student.surname }}
</a>
</div>
</td>
</tr>
</tbody>
</table> </table>
</div> </div>
<!-- Add Supervisor Form -->
<div ng-include="'modules/admin/views/supervisors_add.html'" class="col-md-4" ng-init="hidesupervisoradd = true" ng-hide="hidesupervisoradd"></div>
<!-- Update Supervisor Form -->
<div ng-include="'modules/admin/views/supervisors_update.html'" class="col-md-4" ng-init="hidesupervisorupdate = true" ng-hide="hidesupervisorupdate"></div>
</div> </div>
...@@ -77,6 +77,12 @@ img.preview{ ...@@ -77,6 +77,12 @@ img.preview{
max-height: 200px; max-height: 200px;
margin-top: 10px; margin-top: 10px;
} }
.thumbnail.img_profile_small{
width: 50px;
height: 50px;
margin-bottom: 0;
display: inline-block;
}
.checkbox{ /* Para todos los checkbox toggle */ .checkbox{ /* Para todos los checkbox toggle */
margin-top: 0; margin-top: 0;
...@@ -960,10 +966,6 @@ input[type=range]:focus::-ms-fill-upper { ...@@ -960,10 +966,6 @@ input[type=range]:focus::-ms-fill-upper {
font: 32px Arial, sans-serif; font: 32px Arial, sans-serif;
} }
.input-group-addon:first-child{
top: 0px;
}
/* /*
ng-file-upload and ngImgCrop ng-file-upload and ngImgCrop
*/ */
......
...@@ -5,6 +5,7 @@ var ASSETS_PATH = path.join(__dirname, '..', 'assets'); ...@@ -5,6 +5,7 @@ var ASSETS_PATH = path.join(__dirname, '..', 'assets');
var UPLOAD_PATH = path.join(__dirname, '..', '..', 'upload'); var UPLOAD_PATH = path.join(__dirname, '..', '..', 'upload');
module.exports.pictogram = { module.exports.pictogram = {
version: "0.1", // actual version of the server, to be checked by the client
admin: { admin: {
email: 'amontejo@ujaen.es', email: 'amontejo@ujaen.es',
password: '$2a$06$flEEOc15SerMeYWARrN9w.KSpJuM.jDsaTgrtD0ESzbxKHPl0f/zq' //y00ttaa!! password: '$2a$06$flEEOc15SerMeYWARrN9w.KSpJuM.jDsaTgrtD0ESzbxKHPl0f/zq' //y00ttaa!!
......
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