Commit f942adcb by Arturo Montejo Ráez

Merge branch 'develop' of http://scm.ujaen.es/softuno/pictogram into develop

parents 687a18b9 2907f452
Showing with 437 additions and 164 deletions
...@@ -13,6 +13,7 @@ sails/upload ...@@ -13,6 +13,7 @@ sails/upload
sails/symbolstx* sails/symbolstx*
sails/src/assets/symbolstx* sails/src/assets/symbolstx*
sails/src/assets/upload sails/src/assets/upload
sails/upload.tgz
# Webapp # # Webapp #
########## ##########
...@@ -53,6 +54,10 @@ android/Pictogram/commonlibrary/gradlew.bat ...@@ -53,6 +54,10 @@ android/Pictogram/commonlibrary/gradlew.bat
android/Pictogram/tablet/tablet.iml android/Pictogram/tablet/tablet.iml
android/Pictogram/watch/watch.iml android/Pictogram/watch/watch.iml
android/Pictogram/Pictogrammar.iml android/Pictogram/Pictogrammar.iml
android/Pictogram/supervisor_tablet.iml
android/Pictogram/yotta_tablet.iml
android/Pictogram/tabletlibrary.iml
android/Pictogram/commonlibrary/build
android/Pictogram/commonlibrary/build android/Pictogram/commonlibrary/build
android/Pictogram/tablet/build android/Pictogram/tablet/build
android/Pictogram/watch/build android/Pictogram/watch/build
......
...@@ -2,16 +2,14 @@ package com.yottacode.pictogram.action; ...@@ -2,16 +2,14 @@ package com.yottacode.pictogram.action;
import android.util.Log; import android.util.Log;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.LinkedList;
/** /**
* User actions that happens when the user is online --> they are sent to the server by websockets (Room class) * User actions that happens when the user is online --> they are sent to the server by websockets (Room class)
...@@ -39,7 +37,7 @@ public abstract class Action { ...@@ -39,7 +37,7 @@ public abstract class Action {
public String get_type() { return this.type;} public String get_type() { return this.type;}
public abstract String get_action(); public abstract String get_action();
protected JSONObject get_json() { public JSONObject get_json() {
final String param_id_stu="id_stu"; final String param_id_stu="id_stu";
final String param_id_sup="id_sup"; final String param_id_sup="id_sup";
final String param_id_dev="id_dev"; final String param_id_dev="id_dev";
......
...@@ -2,6 +2,7 @@ package com.yottacode.pictogram.action; ...@@ -2,6 +2,7 @@ package com.yottacode.pictogram.action;
import android.util.Log; import android.util.Log;
import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
......
...@@ -2,15 +2,13 @@ package com.yottacode.pictogram.action; ...@@ -2,15 +2,13 @@ package com.yottacode.pictogram.action;
import android.util.Log; import android.util.Log;
import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList; import java.util.LinkedList;
/** /**
......
package com.yottacode.pictogram.action; package com.yottacode.pictogram.action;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.net.websockets.Room;
/** /**
* User actions regarding a pictogram that happens when the user is online --> they are sent to the server by websockets (Room class) * User actions regarding a pictogram that happens when the user is online --> they are sent to the server by websockets (Room class)
......
package com.yottacode.pictogram.action; package com.yottacode.pictogram.action;
import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
/** /**
......
package com.yottacode.pictogram.action; package com.yottacode.pictogram.action;
import com.yottacode.pictogram.net.websockets.Room;
/** /**
* User actions regarding a pictogram that happens when the user is online --> they are sent to the server by websockets (Room class) * User actions regarding a pictogram that happens when the user is online --> they are sent to the server by websockets (Room class)
* It is required, inter alia, to support session state diagram such * It is required, inter alia, to support session state diagram such
......
package com.yottacode.pictogram.action; package com.yottacode.pictogram.action;
import android.util.Log; import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONException;
import org.json.JSONObject;
/** /**
* User actions regarding a pictogram that happens when the user is online --> they are sent to the server by websockets (Room class) * User actions regarding a pictogram that happens when the user is online --> they are sent to the server by websockets (Room class)
......
...@@ -83,7 +83,8 @@ public class PCBDBHelper extends SQLiteOpenHelper { ...@@ -83,7 +83,8 @@ public class PCBDBHelper extends SQLiteOpenHelper {
* @param user the current PCB user (Student or Supervisor with a given Student collection) * @param user the current PCB user (Student or Supervisor with a given Student collection)
* @see PCBDBHelper#getCurrentUser() * @see PCBDBHelper#getCurrentUser()
*/ */
private void setCurrentUser(User user) { public void setCurrentUser(User user) {
Log.i(getClass().getCanonicalName(),"user "+user.get_name_stu()+" "+user.get_json_attrs());
this.currentUser = user; this.currentUser = user;
PCBcontext.getDevice().setLastStuId(user.get_id_stu()); PCBcontext.getDevice().setLastStuId(user.get_id_stu());
if (user.is_supervisor()) PCBcontext.getDevice().setLastSupId(user.get_id_sup()); if (user.is_supervisor()) PCBcontext.getDevice().setLastSupId(user.get_id_sup());
......
package com.yottacode.pictogram.dao; package com.yottacode.pictogram.dao;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.util.Log; import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.widget.TextView;
import com.yottacode.pictogram.action.VocabularyAction; import com.yottacode.pictogram.action.VocabularyAction;
import com.yottacode.pictogram.net.PictoUploader; import com.yottacode.pictogram.net.PictoUploader;
...@@ -11,6 +24,10 @@ import com.yottacode.pictogram.tools.PCBcontext; ...@@ -11,6 +24,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.File;
import java.io.FileInputStream;
import java.io.IOException;
/** /**
* A object which represents a pictogram * A object which represents a pictogram
* * * *
...@@ -18,6 +35,8 @@ import org.json.JSONObject; ...@@ -18,6 +35,8 @@ import org.json.JSONObject;
* @version 1.0 * @version 1.0
*/ */
public class Picto extends Img { public class Picto extends Img {
int cont = 0;
Bitmap bitmap;
// String constant for logs // String constant for logs
private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName() private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName()
...@@ -35,6 +54,14 @@ public class Picto extends Img { ...@@ -35,6 +54,14 @@ public class Picto extends Img {
public static String PCB_STATUS_MODIFICATION="pcb_status_modification"; public static String PCB_STATUS_MODIFICATION="pcb_status_modification";
public static String EXPRESSION = "expression"; public static String EXPRESSION = "expression";
public static String MIRROR = "mirror"; public static String MIRROR = "mirror";
public static String LEGEND = "legend";
}
public final static class JSON_ATTTR_LEGEND_VALUES {
static String NONE = "none";
static String NORMAL = "normal";
static String FULL = "full";
} }
public final static class JSON_ATTTR_STATUS_VALUES { public final static class JSON_ATTTR_STATUS_VALUES {
...@@ -62,7 +89,8 @@ public class Picto extends Img { ...@@ -62,7 +89,8 @@ public class Picto extends Img {
.put(JSON_ATTTRS.ROW, row) .put(JSON_ATTTRS.ROW, row)
.put(JSON_ATTTRS.FREE_ROW, freeRow) .put(JSON_ATTTRS.FREE_ROW, freeRow)
.put(JSON_ATTTRS.FREE_COLUMN, freeColumn) .put(JSON_ATTTRS.FREE_COLUMN, freeColumn)
.put(JSON_ATTTRS.STATUS, JSON_ATTTR_STATUS_VALUES.ENABLED)); .put(JSON_ATTTRS.STATUS, JSON_ATTTR_STATUS_VALUES.ENABLED)
.put(JSON_ATTTRS.LEGEND,JSON_ATTTR_LEGEND_VALUES.NONE));
} }
public Picto(int id, String url,String translation, String attributes) throws JSONException { public Picto(int id, String url,String translation, String attributes) throws JSONException {
this(id, url, translation, new JSONObject(attributes)); this(id, url, translation, new JSONObject(attributes));
...@@ -237,6 +265,18 @@ public class Picto extends Img { ...@@ -237,6 +265,18 @@ public class Picto extends Img {
/** /**
* *
* @return the legend of a picto (none | normal | full)
*/
public String get_legend() {
try {
return this.attributes.getString(JSON_ATTTRS.LEGEND);
} catch (JSONException e) {
return "none"; // By default
}
}
/**
*
* @return the row of the picto * @return the row of the picto
*/ */
public int get_row() { public int get_row() {
...@@ -361,4 +401,131 @@ public class Picto extends Img { ...@@ -361,4 +401,131 @@ public class Picto extends Img {
PCBcontext.getPcbdb().modifyPicto(this.get_id(), this.get_json_attrs()); PCBcontext.getPcbdb().modifyPicto(this.get_id(), this.get_json_attrs());
} }
} }
/**
* override method that draw the legend on the picto bitmap
*/
@Override
public Bitmap get_bitmap(Context context) throws IOException {
if (bitmap == null) {
File file = file(context);
if (file.exists()) {
FileInputStream is = new FileInputStream(file);
this.bitmap = BitmapFactory.decodeStream(is);
is.close();
}
}
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
int width = bitmap.getWidth(); //Ancho original
int height = bitmap.getHeight(); //Alto original
int dens = bitmap.getDensity();
if(!get_legend().equals(JSON_ATTTR_LEGEND_VALUES.NONE)){
String texto = this.translation.toUpperCase();
String[] words = texto.split(" ");
StringBuffer txt = new StringBuffer();
if (words.length == 1) {
if (words[0].length() > 10) {
texto = "";
int mitad = (words[0].length() / 2) - 1;
char r = words[0].charAt(mitad);
char r2 = words[0].charAt(mitad + 1);
while ((r2 == 'A' || r2 == 'E' || r2 == 'I' || r2 == 'O' || r2 == 'U') && (r != 'A' || r != 'E' || r != 'I' || r != 'O' || r != 'U')) {
mitad++;
r = words[0].charAt(mitad);
r2 = words[0].charAt(mitad + 1);
}
int i = 0;
while (i <= mitad) {
txt.append(words[0].charAt(i));
i++;
}
int diff = 10 - mitad;
diff -= 1;
txt.append("-");
while (diff != 10) {
txt.append(" ");
diff++;
}
while (i < words[0].length()) {
txt.append(words[0].charAt(i));
i++;
}
texto = txt.toString();
}
}
if(get_legend().equals(JSON_ATTTR_LEGEND_VALUES.NORMAL)) { //Normal legend
android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig();
if (bitmapConfig == null) {
bitmapConfig = android.graphics.Bitmap.Config.ARGB_8888;
}
bitmap = bitmap.copy(bitmapConfig, true);
Canvas canvas = new Canvas(bitmap);
if(cont == 0) {
Bitmap bm = Bitmap.createScaledBitmap(bitmap, width / 2, height / 2, false);
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); //Poner en blanco el bitmap original para dibujar encima
canvas.drawBitmap(bm, 25, 0, paint);
cont++;
TextView textView = new TextView(context);
textView.layout(0, 50, 100, 100);
textView.setPadding(0, 0, 0, 0);
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, 13);
textView.setTextColor(Color.BLACK);
textView.setBackgroundColor(Color.WHITE);
textView.setWidth(100);
textView.setGravity(Gravity.CENTER_HORIZONTAL);
textView.setMaxLines(4);
textView.setText(texto);
textView.setDrawingCacheEnabled(true);
canvas.drawBitmap(textView.getDrawingCache(), 0, 50, null);
}
}else{
//Only legend
android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig();
if (bitmapConfig == null) {
bitmapConfig = android.graphics.Bitmap.Config.ARGB_8888;
}
bitmap = bitmap.copy(bitmapConfig, true);
Canvas canvas = new Canvas(bitmap);
paint.setColor(Color.WHITE);
canvas.drawRect(0,0,100,100,paint);
TextView textView = new TextView(context);
textView.layout(0, 0, 100, 100);
textView.setPadding(0, 0, 0, 0);
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, 13);
textView.setTextColor(Color.BLACK);
textView.setWidth(100);
textView.setGravity(Gravity.CENTER_HORIZONTAL);
textView.setMaxLines(2);
textView.setText(texto);
textView.setDrawingCacheEnabled(true);
canvas.drawBitmap(textView.getDrawingCache(), 0, 25, null);
}
}
return bitmap;
}
} }
...@@ -27,8 +27,8 @@ public class User { ...@@ -27,8 +27,8 @@ public class User {
public final static class JSON_STUDENT_ATTTRS{ public final static class JSON_STUDENT_ATTTRS{
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 ="pictogram 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";
} }
......
...@@ -194,6 +194,7 @@ public class UserLogin { ...@@ -194,6 +194,7 @@ public class UserLogin {
GUITools.show_alert(activity, R.string.serverError, e.getMessage()); GUITools.show_alert(activity, R.string.serverError, e.getMessage());
Log.e(this.getClass().getCanonicalName(), "JSON:"+ e.getLocalizedMessage()); Log.e(this.getClass().getCanonicalName(), "JSON:"+ e.getLocalizedMessage());
if(progressDialog.isShowing()) progressDialog.dismiss(); if(progressDialog.isShowing()) progressDialog.dismiss();
} }
} }
...@@ -225,7 +226,7 @@ public class UserLogin { ...@@ -225,7 +226,7 @@ public class UserLogin {
} }
} //offline student login } //offline student login
} }
private void set_student_oline(final User student, String token, final Intent pictogramActivity, final Activity activity) { public void set_student_oline(final User student, String token, final Intent pictogramActivity, final Activity activity) {
final ProgressDialog progressDialog=ProgressDialog.show(activity, activity.getString(R.string.userLoadingTxt),activity. getString(R.string.loadingGrammar)); final ProgressDialog progressDialog=ProgressDialog.show(activity, activity.getString(R.string.userLoadingTxt),activity. getString(R.string.loadingGrammar));
PCBcontext.set_user(student, token, new iImgDownloaderListener() { PCBcontext.set_user(student, token, new iImgDownloaderListener() {
......
...@@ -5,12 +5,16 @@ import android.util.Log; ...@@ -5,12 +5,16 @@ import android.util.Log;
import com.yottacode.net.iRestapiListener; import com.yottacode.net.iRestapiListener;
import com.yottacode.pictogram.R; import com.yottacode.pictogram.R;
import com.yottacode.pictogram.action.Room;
import com.yottacode.pictogram.action.VocabularyAction; import com.yottacode.pictogram.action.VocabularyAction;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.net.ImgDownloader; import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.PictoUploader; import com.yottacode.pictogram.net.PictoUploader;
import com.yottacode.pictogram.net.iImgDownloaderListener; import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.net.websockets.ActionTalk;
import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.net.websockets.VocabularyTalk;
import com.yottacode.pictogram.net.websockets.iActionListener;
import com.yottacode.pictogram.net.websockets.iVocabularyListener;
import com.yottacode.pictogram.tools.Img; import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools; import com.yottacode.tools.GUITools;
...@@ -61,7 +65,7 @@ public class Vocabulary implements Iterable<Picto> { ...@@ -61,7 +65,7 @@ public class Vocabulary implements Iterable<Picto> {
} }
public void listen(Room room, iVocabularyListener listener, iActionListener action_listener) { public void listen(Room room, iVocabularyListener listener, iActionListener action_listener) {
iVocabularyListener listeners[] = {new iVocabularyListener() { iVocabularyListener vocabulary_listeners[] = {new iVocabularyListener() {
@Override @Override
public void change(action action, int picto_cat, int picto_id, JSONObject args) { public void change(action action, int picto_cat, int picto_id, JSONObject args) {
switch (action) { switch (action) {
...@@ -98,8 +102,9 @@ public class Vocabulary implements Iterable<Picto> { ...@@ -98,8 +102,9 @@ public class Vocabulary implements Iterable<Picto> {
} }
} }
},listener}; },listener};
new VocabularyTalk(room, listeners); new VocabularyTalk(room, vocabulary_listeners);
new ActionTalk(room, new iActionListener[] {action_listener}); new ActionTalk(room, new iActionListener[] {action_listener});
} }
/** /**
......
...@@ -67,7 +67,7 @@ public class NetService implements Runnable { ...@@ -67,7 +67,7 @@ public class NetService implements Runnable {
@Override @Override
public void error(Exception e) { public void error(Exception e) {
Log.e(this.getClass().getSimpleName(), "Error un when server login:" + e.getMessage()); Log.e(this.getClass().getSimpleName(), "Error un when server login:" + e.getMessage());
if (e instanceof LoginException) NetService.this.device.restart_app(); if (e instanceof LoginException) NetService.this.device.restart_app(false);
} }
}); });
else ServerLogin.login_student(user.get_nickname_stu(), user.get_pwd_stu(), new iRestapiListener() { else ServerLogin.login_student(user.get_nickname_stu(), user.get_pwd_stu(), new iRestapiListener() {
...@@ -89,19 +89,19 @@ public class NetService implements Runnable { ...@@ -89,19 +89,19 @@ public class NetService implements Runnable {
@Override @Override
public void error(Exception e) { public void error(Exception e) {
Log.e(this.getClass().getSimpleName(),"Error un when server login:"+e.getMessage()); Log.e(this.getClass().getSimpleName(),"Error un when server login:"+e.getMessage());
if (e instanceof LoginException) NetService.this.device.restart_app(); if (e instanceof LoginException) NetService.this.device.restart_app(false);
} }
}); });
} }
public boolean online() {return updated;} public boolean online() {return updated;}
public void restart_app() { public void restart_app(boolean direct_login) {
PCBcontext.unset_user(); PCBcontext.unset_user();
this.device.restart_app(); this.device.restart_app(direct_login);
} }
public void restart_app(Intent intent) { public void restart_app(Intent intent, boolean direct_login) {
PCBcontext.unset_user(); PCBcontext.unset_user();
this.device.restart_app(intent); this.device.restart_app(intent, direct_login);
} }
/** /**
...@@ -158,4 +158,8 @@ public class NetService implements Runnable { ...@@ -158,4 +158,8 @@ public class NetService implements Runnable {
Log.e(this.getClass().getName(), "PCB offline because exception happens: " + e.getMessage()); Log.e(this.getClass().getName(), "PCB offline because exception happens: " + e.getMessage());
notifyStatus(); notifyStatus();
} }
public iNetServiceDevice getNetServiceDevice() {
return this.device;
}
} }
...@@ -2,6 +2,8 @@ package com.yottacode.pictogram.net; ...@@ -2,6 +2,8 @@ package com.yottacode.pictogram.net;
import android.content.Intent; import android.content.Intent;
import com.yottacode.pictogram.dao.User;
/** /**
* Created by Fernando on 12/08/2016. * Created by Fernando on 12/08/2016.
*/ */
...@@ -10,6 +12,7 @@ public interface iNetServiceDevice { ...@@ -10,6 +12,7 @@ public interface iNetServiceDevice {
public void build(); public void build();
public void notifyStatus(boolean updated); public void notifyStatus(boolean updated);
public void closeNotifyStatus(); public void closeNotifyStatus();
public void restart_app(); public void restart_app(boolean direct_login);
public void restart_app(Intent intent); public void restart_app(Intent intent, boolean direct_login);
public void updateUserConfig(User user);
} }
package com.yottacode.pictogram.grammar; package com.yottacode.pictogram.net.websockets;
import android.util.Log; import android.util.Log;
import com.github.nkzawa.emitter.Emitter; import com.github.nkzawa.emitter.Emitter;
import com.yottacode.pictogram.action.Room;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
......
package com.yottacode.pictogram.action; package com.yottacode.pictogram.net.websockets;
import android.util.Log; import android.util.Log;
import com.github.nkzawa.emitter.Emitter; import com.github.nkzawa.emitter.Emitter;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.nkzawa.socketio.client.Ack; import com.github.nkzawa.socketio.client.Ack;
import com.github.nkzawa.socketio.client.SocketIOException; import com.github.nkzawa.socketio.client.SocketIOException;
import com.yottacode.pictogram.dao.PCBDBHelper;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.net.SailsSocketsIO; import com.yottacode.net.SailsSocketsIO;
import com.yottacode.pictogram.action.Action;
import com.yottacode.pictogram.action.SubscribeAction;
import com.yottacode.pictogram.action.UnsubscribeAction;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import java.io.IOException; import org.json.JSONException;
import java.sql.SQLDataException; import org.json.JSONObject;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.LinkedList;
...@@ -138,4 +129,6 @@ public class Room { ...@@ -138,4 +129,6 @@ public class Room {
super.finalize(); super.finalize();
exit(); exit();
} }
}
}
package com.yottacode.pictogram.net.websockets;
/**
* Created by Fernando on 10/12/2016.
*/
import android.util.Log;
import com.github.nkzawa.emitter.Emitter;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Websocket Vocabulary Room based on Room
* @author Fernando Martinez Santiago
* @version 1.0
*/
public class StudentTalk implements Emitter.Listener {
private static final String URL ="updateStudent";
private Room room;
iStudentListener listeners[];
public StudentTalk(Room room, iStudentListener listeners[]) {
this.room = room;
this.room.listen(URL, this);
this.listeners=listeners;
}
@Override
public void call(Object... args) {
try {
JSONObject msg = ((JSONObject) args[0]).getJSONObject("student");
Log.i(this.getClass().getName(), "raw Received message " +msg.toString());
int id=msg.getInt("id");
String username=msg.getString("username");
String surname=msg.getString("surname");
String gender=msg.getString("gender");
String pic=msg.getString("pic");
String lang=msg.getString("lang");
String attributes=msg.getString("attributes");
User user=PCBcontext.getPcbdb().getCurrentUser();
User updatedUser=new User(id, username, user.get_pwd_stu(), username, surname, pic, gender, lang, attributes,
user.get_id_sup(), user.get_email_sup(), user.get_pwd_sup(), user.get_name_sup(), user.get_surname_sup(), user.get_url_img_sup(), user.get_gender_sup(),
user.get_lang_sup(), user.get_tts_engine_sup());
Log.i(this.getClass().getName(), "Attributes" +attributes+" listeners:"+listeners.length);
for (iStudentListener listener: listeners)
listener.change(updatedUser);
} catch (JSONException e) {
Log.e(this.getClass().getCanonicalName(), e.getClass().getCanonicalName() + "--" + e);
}
}
}
package com.yottacode.pictogram.grammar; package com.yottacode.pictogram.net.websockets;
import android.util.Log; import android.util.Log;
import com.github.nkzawa.emitter.Emitter; import com.github.nkzawa.emitter.Emitter;
import com.yottacode.pictogram.action.Room;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import org.json.JSONException; import org.json.JSONException;
......
package com.yottacode.pictogram.net.websockets;
import com.yottacode.pictogram.dao.User;
/**
* Vocabulary Listener
* @author Fernando Martinez Santiago
* @version 1.0
*/
public interface iStudentListener {
public void change(User updatedStudent);
}
package com.yottacode.pictogram.grammar; package com.yottacode.pictogram.net.websockets;
import com.yottacode.pictogram.dao.Picto;
import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.Hashtable;
import java.util.LinkedList;
/** /**
* Vocabulary Listener * Vocabulary Listener
* @author Fernando Martinez Santiago * @author Fernando Martinez Santiago
......
...@@ -11,10 +11,12 @@ import com.yottacode.pictogram.dao.Device; ...@@ -11,10 +11,12 @@ import com.yottacode.pictogram.dao.Device;
import com.yottacode.pictogram.dao.PCBDBHelper; import com.yottacode.pictogram.dao.PCBDBHelper;
import com.yottacode.pictogram.dao.User; import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.grammar.Vocabulary; import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.action.Room;
import com.yottacode.pictogram.net.NetService; import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.net.iImgDownloaderListener; import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.net.websockets.Room;
import com.yottacode.pictogram.net.websockets.StudentTalk;
import com.yottacode.pictogram.net.websockets.iStudentListener;
public final class PCBcontext { public final class PCBcontext {
private static Context context; private static Context context;
...@@ -68,6 +70,20 @@ public final class PCBcontext { ...@@ -68,6 +70,20 @@ public final class PCBcontext {
actionLog = new ActionLog(); actionLog = new ActionLog();
vocabulary = new Vocabulary(listener); vocabulary = new Vocabulary(listener);
getNetService().notifyStatus(); getNetService().notifyStatus();
if (getNetService().online()) new StudentTalk(room, new iStudentListener[] {new iStudentListener() {
@Override
public void change(User updatedStudent) {
PCBcontext.getDevice().insertUser(updatedStudent);
if (updatedStudent.is_picto_size_big()!=getPcbdb().getCurrentUser().is_picto_size_big())
PCBcontext.getNetService().getNetServiceDevice().restart_app(true);
else {
PCBcontext.getPcbdb().setCurrentUser(updatedStudent);
PCBcontext.getNetService().getNetServiceDevice().updateUserConfig(updatedStudent);
}
}
}});
} }
public static void unset_user() { public static void unset_user() {
......
...@@ -43,13 +43,6 @@ ...@@ -43,13 +43,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/assets" type="java-test-resource" />
...@@ -58,6 +51,13 @@ ...@@ -58,6 +51,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/assets" type="java-resource" />
...@@ -124,7 +124,6 @@ ...@@ -124,7 +124,6 @@
<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/assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" />
...@@ -137,17 +136,11 @@ ...@@ -137,17 +136,11 @@
<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-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
<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/incremental-verifier" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
<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/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
......
package com.yottacode.pictogram.tabletlibrary.gui; package com.yottacode.pictogram.tabletlibrary.gui;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
...@@ -50,13 +46,4 @@ public class PictoGridAdapter extends ArrayAdapter { ...@@ -50,13 +46,4 @@ public class PictoGridAdapter extends ArrayAdapter {
); );
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void ttsPicto(Picto p, TextToSpeech tts) {
if (p.is_enabled()) {
String input = p.get_translation();
Bundle params = new Bundle();
params.putString(TextToSpeech.Engine.KEY_PARAM_VOLUME, "1");
tts.speak(input, TextToSpeech.QUEUE_FLUSH, params, null);
}
}
} }
...@@ -164,10 +164,10 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -164,10 +164,10 @@ public class StudentFragmentGrid extends Fragment{
progressDialog= ProgressDialog.show(getActivity(), getString(R.string.imguserLoadingMsg), progressDialog= ProgressDialog.show(getActivity(), getString(R.string.imguserLoadingMsg),
getString(R.string.userLoadingTxt), false, false); getString(R.string.userLoadingTxt), false, false);
ImgDownloader downloader = new ImgDownloader(getActivity(), new iImgDownloaderListener() { ImgDownloader downloader = new ImgDownloader(getActivity(), new iImgDownloaderListener() {
@Override
public void loadComplete() { private void loaded() {
if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss(); if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
if (downloaded_students.size() > 1) { if (downloaded_students.size() >= 1) {
for (int i = 0; i < imgs.size(); i++) for (int i = 0; i < imgs.size(); i++)
try { try {
imageStudents.add(imgs.get(i).get_bitmap(getActivity().getBaseContext())); imageStudents.add(imgs.get(i).get_bitmap(getActivity().getBaseContext()));
...@@ -181,9 +181,14 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -181,9 +181,14 @@ public class StudentFragmentGrid extends Fragment{
else else
onlineStudentsOK=true; onlineStudentsOK=true;
} }
@Override
public void loadComplete() {
loaded();
}
@Override @Override
public void loadImg(Img image) { public void loadImg(Img image) {
loaded();
} }
public void error(Exception e) { public void error(Exception e) {
if (progressDialog.isShowing()) progressDialog.dismiss(); if (progressDialog.isShowing()) progressDialog.dismiss();
...@@ -211,7 +216,7 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -211,7 +216,7 @@ public class StudentFragmentGrid extends Fragment{
GUITools.show_alert(getActivity(), R.string.loginErrorTxt, getString(R.string.serverError), new GUITools.iOKListener() { GUITools.show_alert(getActivity(), R.string.loginErrorTxt, getString(R.string.serverError), new GUITools.iOKListener() {
@Override @Override
public void ok() { public void ok() {
PCBcontext.getNetService().restart_app(); PCBcontext.getNetService().restart_app(false);
} }
}); });
} }
...@@ -237,7 +242,7 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -237,7 +242,7 @@ public class StudentFragmentGrid extends Fragment{
GUITools.show_alert(getActivity(), R.string.loginErrorTxt,getString(R.string.noStudentsError), new GUITools.iOKListener() { GUITools.show_alert(getActivity(), R.string.loginErrorTxt,getString(R.string.noStudentsError), new GUITools.iOKListener() {
@Override @Override
public void ok() { public void ok() {
PCBcontext.getNetService().restart_app(); PCBcontext.getNetService().restart_app(false);
} }
}); });
......
...@@ -5,8 +5,10 @@ import android.content.Intent; ...@@ -5,8 +5,10 @@ import android.content.Intent;
import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.util.Log; import android.util.Log;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.iNetServiceDevice; import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.gui.SerialActivity; import com.yottacode.pictogram.tabletlibrary.gui.SerialActivity;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
...@@ -19,6 +21,7 @@ import com.yottacode.pictogram.tools.PCBcontext; ...@@ -19,6 +21,7 @@ import com.yottacode.pictogram.tools.PCBcontext;
public class NetServiceTablet implements iNetServiceDevice { public class NetServiceTablet implements iNetServiceDevice {
private static NotificationCompat.Builder builder; private static NotificationCompat.Builder builder;
private PictogramActivity pictogramActivity;
public void build() { public void build() {
...@@ -66,7 +69,7 @@ public class NetServiceTablet implements iNetServiceDevice { ...@@ -66,7 +69,7 @@ public class NetServiceTablet implements iNetServiceDevice {
* the app. The most frequent reason is a password change while the user have been logged * the app. The most frequent reason is a password change while the user have been logged
* offline * offline
*/ */
public void restart_app(Intent serialActivity) { public void restart_app(Intent serialActivity, boolean direct_login) {
Log.i(this.getClass().getCanonicalName(),"App restarting"); Log.i(this.getClass().getCanonicalName(),"App restarting");
if (serialActivity==null) { if (serialActivity==null) {
...@@ -79,10 +82,14 @@ public class NetServiceTablet implements iNetServiceDevice { ...@@ -79,10 +82,14 @@ public class NetServiceTablet implements iNetServiceDevice {
} }
serialActivity = new Intent(PCBcontext.getContext(), serialClass); serialActivity = new Intent(PCBcontext.getContext(), serialClass);
} }
serialActivity.putExtra("resetPrevUser", true); serialActivity.putExtra("resetPrevUser", !direct_login);
Log.e(this.getClass().getCanonicalName(),"resetPrevUser:"+serialActivity.getBooleanExtra("resetPrevUser", true));
PCBcontext.getContext().startActivity(serialActivity); PCBcontext.getContext().startActivity(serialActivity);
} }
public void restart_app() {restart_app(null);} public void restart_app(boolean direct_login) {restart_app(null, direct_login);}
public void setPictogramActivity(PictogramActivity pictogramActivity) {this.pictogramActivity=pictogramActivity;}
public void updateUserConfig(User user) {
this.pictogramActivity.setConfig();
}
} }
package com.yottacode.pictogram.watch.net; package com.yottacode.pictogram.watch.net;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.util.Log; import android.util.Log;
import android.widget.TextView; import android.widget.TextView;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.iNetServiceDevice; import com.yottacode.pictogram.net.iNetServiceDevice;
import com.yottacode.pictogram.watch.R;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.pictogram.watch.R;
/** /**
...@@ -42,16 +42,21 @@ public class NetServiceWatch implements iNetServiceDevice { ...@@ -42,16 +42,21 @@ public class NetServiceWatch implements iNetServiceDevice {
* the app. The most frequent reason is a password change while the user have been logged * the app. The most frequent reason is a password change while the user have been logged
* offline * offline
*/ */
public void restart_app() { public void restart_app(boolean direct_login) {
restart_app(new Intent(PCBcontext.getContext(), Activity)); restart_app(new Intent(PCBcontext.getContext(), Activity), direct_login);
} }
@Override @Override
public void restart_app(Intent intent) { public void restart_app(Intent intent, boolean direct_login) {
intent.putExtra("resetPrevUser", true); intent.putExtra("resetPrevUser", !direct_login);
PCBcontext.getContext().startActivity(intent); PCBcontext.getContext().startActivity(intent);
} }
@Override
public void updateUserConfig(User user) {
}
public void set_notifyTextView(TextView _notifyTextView) { public void set_notifyTextView(TextView _notifyTextView) {
this.status = _notifyTextView; this.status = _notifyTextView;
......
...@@ -66,14 +66,6 @@ ...@@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/assets" type="java-test-resource" />
...@@ -82,6 +74,14 @@ ...@@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
......
...@@ -9,14 +9,7 @@ android { ...@@ -9,14 +9,7 @@ android {
storePassword 'danoia' storePassword 'danoia'
} }
}*/ }*/
signingConfigs {
config {
keyAlias 'config_key'
keyPassword 'config_pwd'
storeFile file('config_file')
storePassword 'config_pwd'
}
}
compileSdkVersion 24 compileSdkVersion 24
buildToolsVersion "23.0.2" buildToolsVersion "23.0.2"
defaultConfig { defaultConfig {
...@@ -25,6 +18,7 @@ android { ...@@ -25,6 +18,7 @@ android {
targetSdkVersion 22 targetSdkVersion 22
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.SerialActivity"
// signingConfig signingConfigs.config // signingConfig signingConfigs.config
} }
productFlavors { productFlavors {
...@@ -39,7 +33,6 @@ android { ...@@ -39,7 +33,6 @@ android {
PreFlavor { PreFlavor {
resValue "string", "server", "https://pre.yottacode.com" resValue "string", "server", "https://pre.yottacode.com"
resValue "bool", "ssl_connect", "true" resValue "bool", "ssl_connect", "true"
signingConfig signingConfigs.config
} }
} }
} }
......
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