Commit a3974107 by Arturo Montejo Ráez

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

parents 700e75a0 4378e15d
Showing with 1022 additions and 758 deletions
...@@ -66,6 +66,9 @@ android/Pictogram/supervisor_tablet/supervisor_tablet.iml ...@@ -66,6 +66,9 @@ android/Pictogram/supervisor_tablet/supervisor_tablet.iml
android/Pictogram/tabletlibrary/tabletlibrary.iml android/Pictogram/tabletlibrary/tabletlibrary.iml
android/Pictogram/yotta_tablet/yotta_tablet.iml android/Pictogram/yotta_tablet/yotta_tablet.iml
android/Pictogram/watch/watch.iml android/Pictogram/watch/watch.iml
android/Pictogram/yotta_tablet.iml
android/Pictogram/tabletlibrary.iml
android/Pictogram/supervisor_tablet.iml
# OS generated files # # OS generated files #
###################### ######################
......
...@@ -10,7 +10,7 @@ android { ...@@ -10,7 +10,7 @@ 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 "integer", "db_version", "3"
resValue "string", "app_version", "0.1" resValue "string", "app_version", "0.1"
resValue "string", "core_vocabulary", "core_vocabulary" resValue "string", "core_vocabulary", "core_vocabulary"
resValue "string", "apk", "to_be_set_in_subproject" resValue "string", "apk", "to_be_set_in_subproject"
......
...@@ -181,7 +181,6 @@ public class Device extends SQLiteOpenHelper { ...@@ -181,7 +181,6 @@ public class Device extends SQLiteOpenHelper {
SQLiteDatabase db = this.getReadableDatabase(); SQLiteDatabase db = this.getReadableDatabase();
Vector<User> users = new Vector<>(); Vector<User> users = new Vector<>();
Cursor cursor = db.query("users_detail", null, null, null, null, null, null, null); Cursor cursor = db.query("users_detail", null, null, null, null, null, null, null);
while (cursor.moveToNext()) while (cursor.moveToNext())
if (cursor.getInt(9) == id_sup) if (cursor.getInt(9) == id_sup)
users.add(new User(cursor.getInt(0), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), cursor.getString(5), cursor.getString(6), cursor.getString(7), cursor.getString(8), users.add(new User(cursor.getInt(0), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), cursor.getString(5), cursor.getString(6), cursor.getString(7), cursor.getString(8),
......
...@@ -153,10 +153,10 @@ public class PCBDBHelper extends SQLiteOpenHelper { ...@@ -153,10 +153,10 @@ public class PCBDBHelper extends SQLiteOpenHelper {
Cursor cursor = db.query("collection_detail", null, "id_stu=?", new String[]{String.valueOf(id_stu)}, null, null, null, null); Cursor cursor = db.query("collection_detail", null, "id_stu=?", new String[]{String.valueOf(id_stu)}, null, null, null, null);
Log.i(LOG_TAG, "Local recovering " + cursor.getCount() + " pictos for student " + id_stu + " from local DB"); Log.i(LOG_TAG, "Local recovering " + cursor.getCount() + " pictos for student " + id_stu + " from local DB");
cursor.moveToFirst(); cursor.moveToFirst();
while (cursor.moveToNext()) { if (cursor.getCount()>0) do{
Picto picto = new Picto(cursor.getInt(1), cursor.getString(2), cursor.getString(3), cursor.getString(4)); Picto picto = new Picto(cursor.getInt(1), cursor.getString(2), cursor.getString(3), cursor.getString(4));
vocabulary.loadPicto(picto); vocabulary.loadPicto(picto);
} }while (cursor.moveToNext());
cursor.close(); cursor.close();
db.close(); db.close();
......
...@@ -2,6 +2,8 @@ package com.yottacode.pictogram.dao; ...@@ -2,6 +2,8 @@ package com.yottacode.pictogram.dao;
import android.graphics.Color; import android.graphics.Color;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log; import android.util.Log;
import com.yottacode.pictogram.action.VocabularyAction; import com.yottacode.pictogram.action.VocabularyAction;
...@@ -12,6 +14,8 @@ import com.yottacode.pictogram.tools.PCBcontext; ...@@ -12,6 +14,8 @@ 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.Serializable;
/** /**
* A object which represents a pictogram * A object which represents a pictogram
...@@ -19,9 +23,7 @@ import org.json.JSONObject; ...@@ -19,9 +23,7 @@ import org.json.JSONObject;
* @author Fernando Martinez Santiago * @author Fernando Martinez Santiago
* @version 1.0 * @version 1.0
*/ */
public class public class Picto extends Img {
Picto extends Img {
public final static class JSON_ATTTRS { public final static class JSON_ATTTRS {
public static String CATEGORY = "id_cat"; public static String CATEGORY = "id_cat";
......
...@@ -131,7 +131,7 @@ public class UserLogin { ...@@ -131,7 +131,7 @@ public class UserLogin {
Class PictogramActivity, Class LoginActivity) { Class PictogramActivity, Class LoginActivity) {
try { try {
Vector<User> localUsers = PCBcontext.getDevice().findUser(email, password); Vector<User> localUsers = PCBcontext.getDevice().findUser(email, password);
Log.i(this.getClass().getCanonicalName(), "Offline login request for supervisor "+email); Log.i(this.getClass().getCanonicalName(), "Offline login request for supervisor "+email+localUsers.elementAt(0).get_email_sup()+localUsers.elementAt(0).is_supervisor());
if (localUsers.size() == 1) { if (localUsers.size() == 1) {
PCBcontext.set_user(localUsers.elementAt(0), null, null); PCBcontext.set_user(localUsers.elementAt(0), null, null);
......
...@@ -36,7 +36,8 @@ import java.util.Vector; ...@@ -36,7 +36,8 @@ import java.util.Vector;
public class Vocabulary implements Iterable<Picto> { public class Vocabulary implements Iterable<Picto> {
Hashtable<Integer,LinkedList<Picto>> pictos; private static final String LOG_TAG = Vocabulary.class.getName();
Hashtable<Integer,LinkedList<Picto>> pictos;
static int DEFAULT_VOCABULARY_SIZE=200; static int DEFAULT_VOCABULARY_SIZE=200;
ImgDownloader.iImgDownloaderListener imgListener; ImgDownloader.iImgDownloaderListener imgListener;
private ActionTalk actionTalk; private ActionTalk actionTalk;
...@@ -138,7 +139,7 @@ public class Vocabulary implements Iterable<Picto> { ...@@ -138,7 +139,7 @@ public class Vocabulary implements Iterable<Picto> {
try { try {
Log.i(this.getClass().getCanonicalName(), "Picto added while offline. Picto translation: '" + Log.i(this.getClass().getCanonicalName(), "Picto added while offline. Picto translation: '" +
picto.get_translation() + "', id:" + picto.get_id() + " Local status?" + picto.local_status()); picto.get_translation() + "', id:" + picto.get_id() + " Local status?" + picto.local_status());
new PictoUploader(picto).upload(PCBcontext.getContext()); new PictoUploader(picto).upload();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
Log.e(this.getClass().getName(), " Picto json error from server: " + picto.toString()); Log.e(this.getClass().getName(), " Picto json error from server: " + picto.toString());
...@@ -335,7 +336,7 @@ public class Vocabulary implements Iterable<Picto> { ...@@ -335,7 +336,7 @@ public class Vocabulary implements Iterable<Picto> {
* @seealso com.yottacode.pictogram.dao.PCBDBHelper.getStudentVocabulary * @seealso com.yottacode.pictogram.dao.PCBDBHelper.getStudentVocabulary
*/ */
public void loadPicto(Picto picto) { public void loadPicto(Picto picto) {
Log.i(LOG_TAG, "load picto "+picto.get_translation());
LinkedList<Picto> pictos_cat; LinkedList<Picto> pictos_cat;
if (this.pictos.containsKey(picto.get_category())) if (this.pictos.containsKey(picto.get_category()))
pictos_cat = pictos.get(picto.get_category()); pictos_cat = pictos.get(picto.get_category());
......
...@@ -17,7 +17,6 @@ import com.yottacode.pictogram.dao.DeviceHelper; ...@@ -17,7 +17,6 @@ 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;
import com.yottacode.tools.GUITools;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -214,10 +213,9 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -214,10 +213,9 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
} }
}); });
notifyStatus(); notifyStatus();
Log.e(LOG_TAG, "working");
}catch(Exception e) { }catch(Exception e) {
Log.e(LOG_TAG,"NOT WORKING BECAUSE:"+e.getMessage()); Log.e(LOG_TAG,"THREAD NOT WORKING BECAUSE:"+e.getMessage());
this.restart_app(true); this.restart_app(true);
} }
} }
......
package com.yottacode.pictogram.net; package com.yottacode.pictogram.net;
import android.content.Context;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.util.Log; import android.util.Log;
...@@ -22,7 +21,6 @@ import org.json.JSONObject; ...@@ -22,7 +21,6 @@ import org.json.JSONObject;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.HttpRetryException;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
...@@ -135,13 +133,13 @@ public class PictoUploader { ...@@ -135,13 +133,13 @@ public class PictoUploader {
@Override @Override
public void result(JSONObject result) { public void result(JSONObject result) {
Log.i(this.getClass().getCanonicalName(), " Attributes uploaded: " + result.toString()); Log.i(this.getClass().getCanonicalName(), " Attributes uploaded: " + result.toString());
listener.success(true); listener.success(true,result.toString());
} }
@Override @Override
public void error(RestapiWrapper.HTTPException e) { public void error(RestapiWrapper.HTTPException e) {
Log.e(this.getClass().getCanonicalName(), " Error uploading attributes: " + e.getLocalizedMessage()); Log.e(this.getClass().getCanonicalName(), " Error uploading attributes: " + e.getLocalizedMessage());
listener.success(false); listener.success(false,e.getLocalizedMessage());
} }
}); });
...@@ -170,13 +168,13 @@ public class PictoUploader { ...@@ -170,13 +168,13 @@ public class PictoUploader {
@Override @Override
public void result(JSONObject result) { public void result(JSONObject result) {
Log.i(this.getClass().getCanonicalName(), "Uploaded translation result: " + result.toString()); Log.i(this.getClass().getCanonicalName(), "Uploaded translation result: " + result.toString());
listener.success(true); listener.success(true,result.toString());
} }
@Override @Override
public void error(RestapiWrapper.HTTPException e) { public void error(RestapiWrapper.HTTPException e) {
Log.e(this.getClass().getCanonicalName(), "Error uploading translation: " + e.getLocalizedMessage()+" Picto:"+params.get("picto")+" Lang:"+params.get("lang")+" Text:"+params.get("text")); Log.e(this.getClass().getCanonicalName(), "Error uploading translation: " + e.getLocalizedMessage()+" Picto:"+params.get("picto")+" Lang:"+params.get("lang")+" Text:"+params.get("text"));
listener.success(false); listener.success(false,e.getMessage());
} }
}); });
} }
...@@ -188,23 +186,28 @@ public class PictoUploader { ...@@ -188,23 +186,28 @@ public class PictoUploader {
* iii) to upload the expression * iii) to upload the expression
* *
**/ **/
public void upload(final Context context) throws IOException { public void upload() throws IOException {
final int local_img_id = this.picto.get_id(); final int local_img_id = this.picto.get_id();
final boolean imgUpload_success = uploadImg(this.picto); final boolean imgUpload_success = uploadImg(this.picto);
iPictoUploaderListener listener = new iPictoUploaderListener() { iPictoUploaderListener listener = new iPictoUploaderListener() {
int elements_uploaded = 0; int elements_uploaded = 0;
@Override @Override
public void success(boolean success) { public void success(boolean success, String msg) {
if (success) elements_uploaded++; if (success) elements_uploaded++;
else else {
GUITools.show_alert(context, R.string.upload_error,PictoUploader.this.picto.get_translation()); int errmsg =
msg.contains("Error: Picto already in student's vocabulary")
? R.string.upload_duplicated
: R.string.upload_error;
GUITools.show_alert(PCBcontext.getActivityContext(), errmsg, PictoUploader.this.picto.get_translation());
}
if (elements_uploaded == 2) { if (elements_uploaded == 2) {
PCBcontext.getPcbdb().deletePicto(local_img_id); PCBcontext.getPcbdb().deletePicto(local_img_id);
PictoUploader.this.picto.delete_bitmap(PCBcontext.getContext()); PictoUploader.this.picto.delete_bitmap(PCBcontext.getContext());
PCBcontext.getRoom().emit(new VocabularyAction(VocabularyAction.ADD, PictoUploader.this.picto)); PCBcontext.getRoom().emit(new VocabularyAction(VocabularyAction.ADD, PictoUploader.this.picto));
GUITools.show_alert(context, R.string.upload_ok,PictoUploader.this.picto.get_translation()); GUITools.show_alert(PCBcontext.getContext(), R.string.upload_ok,PictoUploader.this.picto.get_translation());
} }
} }
}; };
...@@ -213,7 +216,7 @@ public class PictoUploader { ...@@ -213,7 +216,7 @@ public class PictoUploader {
uploadTranslation(picto.get_id(), listener); uploadTranslation(picto.get_id(), listener);
} }
else { else {
GUITools.show_alert(context, R.string.upload_error, PictoUploader.this.picto.get_translation()); GUITools.show_alert(PCBcontext.getActivityContext(), R.string.upload_error, PictoUploader.this.picto.get_translation());
} }
} }
...@@ -262,6 +265,6 @@ public class PictoUploader { ...@@ -262,6 +265,6 @@ public class PictoUploader {
* Created by Fernando on 28/07/2016. * Created by Fernando on 28/07/2016.
*/ */
public static interface iPictoUploaderListener { public static interface iPictoUploaderListener {
void success(boolean success); void success(boolean success, String s);
} }
} }
...@@ -39,13 +39,14 @@ public class StudentTalk implements Emitter.Listener { ...@@ -39,13 +39,14 @@ public class StudentTalk implements Emitter.Listener {
Log.i(this.getClass().getName(), "raw Received message " +msg.toString()); Log.i(this.getClass().getName(), "raw Received message " +msg.toString());
int id=msg.getInt("id"); int id=msg.getInt("id");
String username=msg.getString("username"); String username=msg.getString("username");
String name=msg.getString("name");
String surname=msg.getString("surname"); String surname=msg.getString("surname");
String gender=msg.getString("gender"); String gender=msg.getString("gender");
String pic=msg.getString("pic"); String pic=msg.getString("pic");
String lang=msg.getString("lang"); String lang=msg.getString("lang");
String attributes=msg.getString("attributes"); String attributes=msg.getString("attributes");
User user=PCBcontext.getPcbdb().getCurrentUser(); User user=PCBcontext.getPcbdb().getCurrentUser();
User updatedUser=new User(id, username, user.get_pwd_stu(), username, surname, pic, gender, lang, attributes, User updatedUser=new User(id, username, user.get_pwd_stu(), name, 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_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(), user.get_office()); user.get_lang_sup(), user.get_tts_engine_sup(), user.get_office());
Log.i(this.getClass().getName(), "Attributes" +attributes+" listeners:"+listeners.length); Log.i(this.getClass().getName(), "Attributes" +attributes+" listeners:"+listeners.length);
......
...@@ -64,7 +64,7 @@ public final class PCBcontext { ...@@ -64,7 +64,7 @@ public final class PCBcontext {
throw new java.lang.AssertionError("init must be called once previously "); throw new java.lang.AssertionError("init must be called once previously ");
} }
Log.i(PCBcontext.class.getCanonicalName(), "User set at student " + student.get_name_stu()); Log.i(PCBcontext.class.getCanonicalName(), "User set at student " + student.get_name_stu()+ (student.is_supervisor() ? " with supervisor "+student.get_name_sup():"."));
wrapper.setToken(token); wrapper.setToken(token);
pcbdb = new PCBDBHelper(null, 2, student); pcbdb = new PCBDBHelper(null, 2, student);
pcbdb.user_online(token!=null); pcbdb.user_online(token!=null);
......
package com.yottacode.tools; package com.yottacode.tools;
import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Point;
import android.util.Log; import android.util.Log;
import android.view.Display;
/** /**
* Created by Fernando on 01/04/2016. * Created by Fernando on 01/04/2016.
...@@ -35,4 +38,10 @@ public class GUITools { ...@@ -35,4 +38,10 @@ public class GUITools {
public static void show_alert(Context context, int resource_msg, String additional_msg) { public static void show_alert(Context context, int resource_msg, String additional_msg) {
show_alert(context, resource_msg, additional_msg,null); show_alert(context, resource_msg, additional_msg,null);
} }
public static Point getScreenSize(Activity context){
Display display = context.getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
return size;
}
} }
...@@ -301,6 +301,17 @@ BEGIN ...@@ -301,6 +301,17 @@ BEGIN
END END
;-- ;--
CREATE TRIGGER trg_update_supervisor
BEFORE UPDATE ON supervisor
FOR EACH ROW
WHEN NEW.id=-1
BEGIN
SELECT RAISE( ABORT,
'Null supervisor -1 is not updatable'
);
END
;--
DROP TRIGGER IF EXISTS trg_delete_collection DROP TRIGGER IF EXISTS trg_delete_collection
;-- ;--
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<string name="notNewCats">Including new categories is not allowed</string> <string name="notNewCats">Including new categories is not allowed</string>
<string name="upload_error">It cannot be uploaded. It will be tried again later</string> <string name="upload_error">It cannot be uploaded. It will be tried again later</string>
<string name="upload_ok">It was correctly uploaded</string> <string name="upload_ok">It was correctly uploaded</string>
<string name="upload_duplicated">Pictogram is part of the collecion. Please, select a different one</string>
<!--online/offline status--> <!--online/offline status-->
<string name="pictogram_offline">Pictogram offline</string> <string name="pictogram_offline">Pictogram offline</string>
<string name="pictogram_online">Pictogram online</string> <string name="pictogram_online">Pictogram online</string>
...@@ -73,4 +74,9 @@ ...@@ -73,4 +74,9 @@
<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>
<string name="default_tts_voice_female">en-gb-x-fis#female_1-local</string> <string name="default_tts_voice_female">en-gb-x-fis#female_1-local</string>
<string name="crop_TextRequired">Please, introduce a message for the pictogram</string>
<string name="crop">Crop</string>
<string name="titleCropper">New pictogram</string>
<string name="uploadingImage">Uploading image</string>
</resources> </resources>
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<string name="notNewCats">No puede añadir nuevas categorias</string> <string name="notNewCats">No puede añadir nuevas categorias</string>
<string name="upload_error">Pictograma local no pudo subirse al servidor. Se intentará más tarde</string> <string name="upload_error">Pictograma local no pudo subirse al servidor. Se intentará más tarde</string>
<string name="upload_ok">Pictograma local se subió correctamente al servidor</string> <string name="upload_ok">Pictograma local se subió correctamente al servidor</string>
<string name="upload_duplicated">Pictograma ya presente en la colección. Utilice otra imagen</string>
<!--online/offline status--> <!--online/offline status-->
<string name="pictogram_offline">Pictogram offline</string> <string name="pictogram_offline">Pictogram offline</string>
<string name="pictogram_online">Pictogram online</string> <string name="pictogram_online">Pictogram online</string>
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
<string name="notNewCats">No puede añadir nuevas categorias</string> <string name="notNewCats">No puede añadir nuevas categorias</string>
<string name="upload_error">No pudo subirse al servidor. Se intentará más adelante</string> <string name="upload_error">No pudo subirse al servidor. Se intentará más adelante</string>
<string name="upload_ok">Se subió correctamente al servidor</string> <string name="upload_ok">Se subió correctamente al servidor</string>
<string name="upload_duplicated">Pictograma ya presente en la colección. Utilice otra imagen</string>
<string name="title_activity_img_label">img_label</string> <string name="title_activity_img_label">img_label</string>
......
/build /build
/supervisor_tablet.iml supervisor_tablet.iml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":supervisor_tablet" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Pictogram" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> <module external.linked.project.id=":supervisor_tablet" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" version="4">
<component name="FacetManager"> <component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle"> <facet type="android-gradle" name="Android-Gradle">
<configuration> <configuration>
...@@ -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="DevFlavorDebug" /> <option name="SELECTED_BUILD_VARIANT" value="CIFlavorDebug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDevFlavorDebug" /> <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDevFlavorDebugSources" /> <option name="ASSEMBLE_TASK_NAME" value="assembleCIFlavorDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileCIFlavorDebugSources" />
<afterSyncTasks> <afterSyncTasks>
<task>generateDevFlavorDebugSources</task> <task>generateCIFlavorDebugSources</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,64 +24,69 @@ ...@@ -23,64 +24,69 @@
</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/DevFlavor/debug" /> <output url="file://$MODULE_DIR$/build/intermediates/classes/CIFlavor/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/DevFlavor/debug" /> <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/CIFlavor/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/DevFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/CIFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/DevFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/CIFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/DevFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/CIFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/DevFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/CIFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/DevFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/CIFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/DevFlavor/debug" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/CIFlavor/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/DevFlavor/debug" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/CIFlavor/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/aidl" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug" isTestSource="true" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug" isTestSource="true" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug" isTestSource="true" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DevFlavor/debug" isTestSource="true" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug" isTestSource="true" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/aidl" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/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" />
<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 +94,7 @@ ...@@ -88,6 +94,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" />
...@@ -114,19 +121,7 @@ ...@@ -114,19 +121,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" 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" />
<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/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<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/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" 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/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<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" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars" />
...@@ -137,6 +132,11 @@ ...@@ -137,6 +132,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/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
</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" />
...@@ -151,6 +151,7 @@ ...@@ -151,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" />
...@@ -177,4 +178,4 @@ ...@@ -177,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
/build /build
.iml
/tabletlibrary.iml
\ No newline at end of file
package com.yottacode.pictogram.tabletlibrary.cropper;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import com.yottacode.pictogram.tabletlibrary.R;
/**
* Created by German on 06/02/2017.
*/
public class EditPictoActivity extends Activity {
// Private Constants ///////////////////////////////////////////////////////////////////////////
public static final int EDIT_PICTO_REQUEST = 2288;
public static final String TRANSCRIPTION = "textPicto";
public static final String IMAGE_PICTO = "imagePicto";
public static final String IMAGE_ORIGIN = "imageOrigin";
public static final String IMAGE_ORIENTATION = "imageOrientation";
// Activity Methods ////////////////////////////////////////////////////////////////////////////
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.edit_picto_layout);
// Initialize Views.
final CropImageView cropImageView = (CropImageView) findViewById(R.id.CropImageView);
final EditText legend = (EditText) findViewById(R.id.legend);
final Button okButton = (Button) findViewById(R.id.okButton);
final Button cancelButton = (Button) findViewById(R.id.cancelButton);
//final ImageView backgroundImage = (ImageView) findViewById(R.id.backgroundImage);
cropImageView.setFixedAspectRatio(true);
cropImageView.setGuidelines(2);
cropImageView.setAspectRatio(1,1);
final int orientation = getIntent().getExtras().getInt(EditPictoActivity.IMAGE_ORIENTATION);
final int origin = getIntent().getExtras().getInt(EditPictoActivity.IMAGE_ORIGIN);
String legendText = getIntent().getExtras().getString(EditPictoActivity.TRANSCRIPTION);
if(legendText != null) {
Log.i("DETALLES","Llega el intent al layout recortar, con texto: " + legendText);
legend.setText(legendText);
}else{
legend.setTextColor(Color.GRAY);
legend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
legend.setText("");
}
});
}
byte[] byteArray = getIntent().getByteArrayExtra(EditPictoActivity.IMAGE_PICTO);
Bitmap imagePicto = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
cropImageView.setImageBitmap(imagePicto);
/*byteArray = getIntent().getByteArrayExtra("imageBackground");
Bitmap imageBackground = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
backgroundImage.setImageBitmap(imageBackground);*/
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Bitmap croppedImage = cropImageView.getCroppedImage(origin,orientation);
//Escalar y guardarla al server
Bitmap finalImage = null;
finalImage.createScaledBitmap(croppedImage,96,96,true);
Intent intent = getIntent();
intent.putExtra(EditPictoActivity.TRANSCRIPTION,legend.getText().toString());
Log.i("DETALLES","sale el intent al layout recortar, con texto: " + legend.getText().toString());
cropImageView.setImageBitmap(finalImage);
setResult(RESULT_OK,intent);
finish();
}
});
//Si cancela, volver a pictogram activity
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
/**
* To set background image for simulate the pictogramActivity
* @param bm
*/
/*public void setBackgroundImage(Bitmap bm){
ImageView backgroundImage = (ImageView) findViewById(R.id.backgroundImage);
backgroundImage.setImageBitmap(bm);
}*/
/**
* To set the image to crop
* @param bm
*/
public void setCropImage(Bitmap bm){
ImageView cropImage = (ImageView) findViewById(R.id.CropImageView);
cropImage.setImageBitmap(bm);
}
/**
* To set the image to crop
* @param text
*/
public void setLegendImage(String text){
EditText legend = (EditText) findViewById(R.id.legend);
legend.setText(text.toString());
}
}
...@@ -7,23 +7,16 @@ import android.content.Intent; ...@@ -7,23 +7,16 @@ import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.text.InputType;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.Toast;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.grammar.iLocalPicto;
import com.yottacode.pictogram.net.PictoUploader;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -34,6 +27,7 @@ import static android.graphics.Color.argb; ...@@ -34,6 +27,7 @@ import static android.graphics.Color.argb;
public class PictoMenu { public class PictoMenu {
private static final String LOG_TAG = PictoMenu.class.getName();
PictogramActivity activity; PictogramActivity activity;
//Variables used on the picto menu (only supervisors) //Variables used on the picto menu (only supervisors)
...@@ -57,99 +51,102 @@ public class PictoMenu { ...@@ -57,99 +51,102 @@ public class PictoMenu {
* *
* @param row * @param row
* @param col * @param col
* @param expression
*/ */
public void addPicto(int row, int col) { public void createMenuForNewPicto(final int row, final int col, final int cat, final String expression, boolean is_picto_big) {
final String [] items = new String [] {activity.getString(R.string.dialogCamera), activity.getString(R.string.dialogGallery)}; ll = new RelativeLayout(PCBcontext.getContext());
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
activity.addContentView(ll, params);
ll.setBackgroundColor(argb(180,0,0,0));
detail = new ImageView(PCBcontext.getContext());
int centerX = activity.getResources().getDisplayMetrics().widthPixels/2;
int centerY = activity.getResources().getDisplayMetrics().heightPixels/2;
if(!is_picto_big){
centerY += 100;
detail.setMaxWidth(90);
}else{
centerY += 135;
detail.setMaxWidth(115);
}
PieMenu = new RadialMenuWidget(PCBcontext.getContext());
PieMenu.setAnimationSpeed(0L);
PieMenu.setCenterLocation(centerX - (PieMenu.getcRadius()*2) - 50, centerY-(PieMenu.getcRadius()*2));
PieMenu.setIconSize(20,35); //Tamaño del icono
Picto picto = null;
PieMenu.setCenterCircle(new Close());
PieMenu.addMenuEntry(new newPickFromCamera(row,col,cat,expression));
PieMenu.addMenuEntry(new newPickFromGallery(row,col,cat,expression));
ll.addView(PieMenu);
detail.setImageResource(R.color.black);
detail.setMaxWidth(96);
detail.setMaxHeight(96);
detail.setX(centerX+10);
detail.setY(centerY - 96);
ll.addView(detail);
/*final String[] items = new String[]{activity.getString(R.string.dialogCamera), activity.getString(R.string.dialogGallery)};
ArrayAdapter<String> adapter = new ArrayAdapter<>(activity, android.R.layout.select_dialog_item, items); ArrayAdapter<String> adapter = new ArrayAdapter<>(activity, android.R.layout.select_dialog_item, items);
AlertDialog.Builder builder = new AlertDialog.Builder(activity); AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(activity.getString(R.string.dialogTitle)); builder.setTitle(activity.getString(R.string.dialogTitle));
builder.setAdapter( adapter, new DialogInterface.OnClickListener() { builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dialog, int item ) { public void onClick(DialogInterface dialog, int item) {
if (item == 0) { //Pick from camera addPicto(row,col,cat,expression,item);
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
activity.startActivityForResult(cameraIntent,CAMERA_PIC_REQUEST);
} else { //Pick from file
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
activity.startActivityForResult(intent,GALLERY_PIC_REQUEST);
}
} }
} ); });
builder.setNegativeButton(activity.getString(R.string.dialogCancel),new DialogInterface.OnClickListener() { builder.setNegativeButton(activity.getString(R.string.dialogCancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) { public void onClick(DialogInterface dialog, int id) {
// if this button is clicked, just close // if this button is clicked, just close
// the dialog box and do nothing // the dialog box and do nothing
dialog.cancel(); dialog.cancel();
} }
}); });
final AlertDialog dialog = builder.create(); final AlertDialog dialog = builder.create();
dialog.show(); dialog.show();*/
}
public void addPicto(int row, int col, int cat, String expression, int source) {
/*Intent intent = new Intent(Intent.ACTION_PICK); activity.getIntent().putExtra(Picto.JSON_ATTTRS.EXPRESSION, expression);
intent.setType("image*//*"); //Enviar al PictogramActivity los datos necesarios para crear el picto despues
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) { if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
activity.getIntent().putExtra("cat", cat);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row); activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col); activity.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col);
} else { } else {
activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_ROW, row); activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_COLUMN, col); activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_COLUMN, col);
} }
activity.startActivityForResult(intent,CAMERA_PIC_REQUEST);*/
} if (source== 0) { //Pick from camera
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
/** activity.startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
* función para la edición de un texto asociado a una nueva imagen y guardar el nuevo picto } else { //Pick from file
*/ Intent intent = new Intent();
public void chooseTextAndSavePicto(final String selectedImagePath, final int row, final int col, final int freeRow, final int freeColumn) { intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
activity.startActivityForResult(intent, GALLERY_PIC_REQUEST);
}
AlertDialog.Builder builder = new AlertDialog.Builder(activity); }
builder.setTitle(activity.getResources().getString(R.string.enterImgLabel));
// Set up the input
final EditText input = new EditText(activity);
input.setInputType(InputType.TYPE_CLASS_TEXT);
builder.setView(input);
// Set up the buttons
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int cat = activity.currentCategory != null
? activity.currentCategory.get_id()
: Picto.NO_CATEGORY;
PCBcontext.getVocabulary().saveLocalPicto(
selectedImagePath,
input.getText().toString(),
cat,
row,
col,
freeRow,
freeColumn,
new iLocalPicto() {
@Override
public void saved(Picto localPicto) {
activity.refresh();
try {
if (PCBcontext.is_user_online())
new PictoUploader(localPicto).upload(activity);
} catch (IOException e) {
Log.e(Vocabulary.class.getCanonicalName(), e.getMessage());
}
}
});
}
});
builder.show();
}
/** /**
* Función para la selección de una foto del carrete * Función para la selección de una foto del carrete
...@@ -158,7 +155,7 @@ public class PictoMenu { ...@@ -158,7 +155,7 @@ public class PictoMenu {
* @param resultCode * @param resultCode
* @param data * @param data
*/ */
public void onActivityResult(int requestCode, int resultCode, Intent data) { /*public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
if (requestCode == SELECT_PICTURE) { if (requestCode == SELECT_PICTURE) {
...@@ -174,10 +171,10 @@ public class PictoMenu { ...@@ -174,10 +171,10 @@ public class PictoMenu {
activity.getIntent().removeExtra(Picto.JSON_ATTTRS.COLUMN); activity.getIntent().removeExtra(Picto.JSON_ATTTRS.COLUMN);
activity.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_ROW); activity.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_ROW);
activity.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_COLUMN); activity.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_COLUMN);
chooseTextAndSavePicto(selectedImagePath, row, col, freeRow, freeColumn); //chooseTextAndSavePicto(selectedImagePath, row, col, freeRow, freeColumn);
} }
} }
} }*/
/** /**
* Función para la selección de una foto del carrete * Función para la selección de una foto del carrete
...@@ -242,7 +239,7 @@ public class PictoMenu { ...@@ -242,7 +239,7 @@ public class PictoMenu {
PieMenu.setCenterLocation(centerX - (PieMenu.getcRadius()*2) - 50, centerY-(PieMenu.getcRadius()*2)); PieMenu.setCenterLocation(centerX - (PieMenu.getcRadius()*2) - 50, centerY-(PieMenu.getcRadius()*2));
PieMenu.setIconSize(20,35); //Tamaño del icono PieMenu.setIconSize(20,35); //Tamaño del icono
PieMenu.setCenterCircle(new Close(picto)); PieMenu.setCenterCircle(new Close());
PieMenu.addMenuEntry(new UnlockPictoMenu(picto)); PieMenu.addMenuEntry(new UnlockPictoMenu(picto));
PieMenu.addMenuEntry(new DisablePictoMenu(picto)); PieMenu.addMenuEntry(new DisablePictoMenu(picto));
PieMenu.addMenuEntry(new SetInvisibleMenu(picto)); PieMenu.addMenuEntry(new SetInvisibleMenu(picto));
...@@ -265,9 +262,7 @@ public class PictoMenu { ...@@ -265,9 +262,7 @@ public class PictoMenu {
//Close menu button //Close menu button
public class Close implements RadialMenuWidget.RadialMenuEntry public class Close implements RadialMenuWidget.RadialMenuEntry
{ {
Picto p; public Close(){
public Close(Picto picto){
p = picto;
} }
public String getName() { return "Close"; } public String getName() { return "Close"; }
public String getLabel() { return null; } public String getLabel() { return null; }
...@@ -291,7 +286,7 @@ public class PictoMenu { ...@@ -291,7 +286,7 @@ public class PictoMenu {
} }
public String getName() { return "disable"; } public String getName() { return "disable"; }
public String getLabel() { return null; } public String getLabel() { return null; }
public int getIcon() { return R.drawable.disabled_picto; } public int getIcon() { return android.R.drawable.ic_delete; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; } public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated() public void menuActiviated()
{ {
...@@ -370,7 +365,6 @@ public class PictoMenu { ...@@ -370,7 +365,6 @@ public class PictoMenu {
} }
} }
//Edit legend text of picto button
public class PickFromCamera implements RadialMenuWidget.RadialMenuEntry public class PickFromCamera implements RadialMenuWidget.RadialMenuEntry
{ {
Picto p; Picto p;
...@@ -386,13 +380,7 @@ public class PictoMenu { ...@@ -386,13 +380,7 @@ public class PictoMenu {
ll.setVisibility(View.GONE); ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout(); ll.removeAllViewsInLayout();
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); addPicto(p.get_row(),p.get_column(),p.get_category(),p.get_translation(),0);
if(p!=null) {
//cameraIntent.putExtra("pictoLegend", p.get_translation());
activity.setPicto(p);
}
activity.startActivityForResult(cameraIntent,CAMERA_PIC_REQUEST);
} }
public void menuDisabled(){} public void menuDisabled(){}
} }
...@@ -411,15 +399,54 @@ public class PictoMenu { ...@@ -411,15 +399,54 @@ public class PictoMenu {
{ {
ll.setVisibility(View.GONE); ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout(); ll.removeAllViewsInLayout();
if(p!=null) { addPicto(p.get_row(),p.get_column(),p.get_category(),p.get_translation(),1);
//cameraIntent.putExtra("pictoLegend", p.get_translation()); }
activity.setPicto(p); public void menuDisabled(){}
} }
Intent intent = new Intent();
intent.setType("image/*"); public class newPickFromCamera implements RadialMenuWidget.RadialMenuEntry
intent.setAction(Intent.ACTION_GET_CONTENT); {
activity.startActivityForResult(intent,GALLERY_PIC_REQUEST); int row,col,cat;
//addPicto(p.get_row(),p.get_column()); String expression;
public newPickFromCamera(int row, int col,int cat,String expression){
this.row = row;
this.col = col;
this.cat = cat;
this.expression = expression;
}
public String getName() { return ""; }
public String getLabel() { return null; }
public int getIcon() { return android.R.drawable.ic_menu_camera; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout();
addPicto(row,col,cat,expression,0);
}
public void menuDisabled(){}
}
public class newPickFromGallery implements RadialMenuWidget.RadialMenuEntry
{
int row,col,cat;
String expression;
public newPickFromGallery(int row, int col,int cat,String expression){
this.row = row;
this.col = col;
this.cat = cat;
this.expression = expression;
}
public String getName() { return ""; }
public String getLabel() { return null; }
public int getIcon() { return android.R.drawable.ic_menu_gallery; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout();
addPicto(row,col,cat,expression,1);
} }
public void menuDisabled(){} public void menuDisabled(){}
} }
......
...@@ -12,6 +12,7 @@ import android.database.Cursor; ...@@ -12,6 +12,7 @@ import android.database.Cursor;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.PixelFormat; import android.graphics.PixelFormat;
import android.graphics.Point;
import android.media.Ringtone; import android.media.Ringtone;
import android.media.RingtoneManager; import android.media.RingtoneManager;
import android.net.Uri; import android.net.Uri;
...@@ -46,11 +47,13 @@ import com.yottacode.pictogram.action.TalkAction; ...@@ -46,11 +47,13 @@ import com.yottacode.pictogram.action.TalkAction;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
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.grammar.iLocalPicto;
import com.yottacode.pictogram.net.ImgDownloader; import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.PictoUploader;
import com.yottacode.pictogram.net.websockets.ActionTalk; import com.yottacode.pictogram.net.websockets.ActionTalk;
import com.yottacode.pictogram.net.websockets.VocabularyTalk; import com.yottacode.pictogram.net.websockets.VocabularyTalk;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.cropper.EditPictoActivity; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.EditPictoActivity;
import com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity; import com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity;
import com.yottacode.pictogram.tabletlibrary.gui.session.SessionActivity; import com.yottacode.pictogram.tabletlibrary.gui.session.SessionActivity;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet; import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
...@@ -63,6 +66,7 @@ import org.json.JSONException; ...@@ -63,6 +66,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedList; import java.util.LinkedList;
...@@ -73,16 +77,10 @@ import java.util.concurrent.TimeUnit; ...@@ -73,16 +77,10 @@ import java.util.concurrent.TimeUnit;
public class PictogramActivity extends Activity implements VocabularyTalk.iVocabularyListener { public class PictogramActivity extends Activity implements VocabularyTalk.iVocabularyListener {
private Picto picto = null;
private static final int CAMERA_PIC_REQUEST = 1; private static final int CAMERA_PIC_REQUEST = 1;
private static final int GALLERY_PIC_REQUEST = 2; private static final int GALLERY_PIC_REQUEST = 2;
private static final int VERTICAL_ORIENTATION = 200;
private static final int HORIZONTAL_ORIENTATION = 300;
private static final int MAX_WIDTH = 700;
private static final int MAX_HEIGHT = 350;
// Main layout for this activity // Main layout for this activity
RelativeLayout mainLayout; RelativeLayout mainLayout;
// Adapter for de grid showing the categories grid (and main pictos) // Adapter for de grid showing the categories grid (and main pictos)
...@@ -98,7 +96,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -98,7 +96,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
// Tape view (list of pictos to send to the server) // Tape view (list of pictos to send to the server)
GridView tapeGridView; GridView tapeGridView;
// Current picto category, if not null the corresponding category grid will be shown // Current picto category, if not null the corresponding category grid will be shown
Picto currentCategory; private Picto currentCategory;
// Object used for reading text // Object used for reading text
TTSHelper tts; TTSHelper tts;
// Element used for loading new pictos (while changing categories) // Element used for loading new pictos (while changing categories)
...@@ -249,7 +247,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -249,7 +247,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
this.generateAnimations(); this.generateAnimations();
if (this.currentCategory != null) { if (this.getCurrentCategory() != null) {
this.hidePictoMainGridView(); this.hidePictoMainGridView();
} else { } else {
this.showPictoMainGridView(); this.showPictoMainGridView();
...@@ -470,11 +468,11 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -470,11 +468,11 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
private void hidePictoMainGridView() { private void hidePictoMainGridView() {
this.pictoCategoryGridAdapter.clear(); this.pictoCategoryGridAdapter.clear();
this.pictoCategoryGridAdapter.addAll(this.sort(this.vocabulary.next(this.currentCategory))); this.pictoCategoryGridAdapter.addAll(this.sort(this.vocabulary.next(this.getCurrentCategory())));
this.pictoCategoryGridAdapter.notifyDataSetChanged(); this.pictoCategoryGridAdapter.notifyDataSetChanged();
if (this.currentCategory.get_color() != -1) if (this.getCurrentCategory().get_color() != -1)
this.pictoCategoryGridView.setBackgroundColor(this.currentCategory.get_color()); this.pictoCategoryGridView.setBackgroundColor(this.getCurrentCategory().get_color());
this.pictoMainGridView.setEnabled(false); this.pictoMainGridView.setEnabled(false);
this.pictoCategoryGridView.setEnabled(true); this.pictoCategoryGridView.setEnabled(true);
...@@ -488,7 +486,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -488,7 +486,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
* Returns pictoCategoryGridAdapter or pictoMainGridAdapter depending on the current View * Returns pictoCategoryGridAdapter or pictoMainGridAdapter depending on the current View
*/ */
protected PictoGridAdapter getCurrentPictoGridAdapter() { protected PictoGridAdapter getCurrentPictoGridAdapter() {
return (currentCategory == null) ? this.pictoMainGridAdapter : this.pictoCategoryGridAdapter; return (getCurrentCategory() == null) ? this.pictoMainGridAdapter : this.pictoCategoryGridAdapter;
} }
/** /**
...@@ -548,7 +546,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -548,7 +546,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
if (currentCategory != null) { if (getCurrentCategory() != null) {
hidePictoMainGridView(); hidePictoMainGridView();
} else { } else {
showPictoMainGridView(); showPictoMainGridView();
...@@ -691,13 +689,10 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -691,13 +689,10 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
} }
} }
public Picto getPicto() { public Picto getCurrentCategory() {
return picto; return currentCategory;
} }
public void setPicto(Picto picto) {
this.picto = picto;
}
/* ********************************************************************************************* /* *********************************************************************************************
* Event listener classes * Event listener classes
...@@ -845,8 +840,8 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -845,8 +840,8 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
Picto p = getCurrentPictoGridAdapter().getItem(position); Picto p = getCurrentPictoGridAdapter().getItem(position);
if (p == null) { if (p == null) {
// No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria // No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria
if (currentCategory != null || !PCBcontext.getPcbdb().getCurrentUser().has_categories()) { if (getCurrentCategory() != null || !PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
new PictoMenu(PictogramActivity.this).addPicto(position % maxColumns, (int) (position / maxColumns)); new PictoMenu(PictogramActivity.this).createMenuForNewPicto(position % maxColumns, (int) (position / maxColumns), currentCategory.get_id(),null,PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big());
} else } else
Toast.makeText(PictogramActivity.this, PictogramActivity.this.getResources().getString(R.string.notNewCats), Toast.LENGTH_SHORT).show(); Toast.makeText(PictogramActivity.this, PictogramActivity.this.getResources().getString(R.string.notNewCats), Toast.LENGTH_SHORT).show();
...@@ -939,8 +934,6 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -939,8 +934,6 @@ protected void showOnlyTape(boolean onlyTape) {
this.showPictoCategoriesViewButton.setAlpha(1f); this.showPictoCategoriesViewButton.setAlpha(1f);
} }
} }
} }
...@@ -980,7 +973,6 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -980,7 +973,6 @@ protected void showOnlyTape(boolean onlyTape) {
//Cojo los id del ultimo estudiante y el ultimo supervisor //Cojo los id del ultimo estudiante y el ultimo supervisor
int lastIdStu = PCBcontext.getDevice().getLastStuId(); int lastIdStu = PCBcontext.getDevice().getLastStuId();
User actual = PCBcontext.getPcbdb().getCurrentUser(); User actual = PCBcontext.getPcbdb().getCurrentUser();
User usuario_anterior; User usuario_anterior;
String lastUserName = null; String lastUserName = null;
...@@ -1101,20 +1093,16 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -1101,20 +1093,16 @@ protected void showOnlyTape(boolean onlyTape) {
*/ */
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
Log.e(LOG_TAG,"CTSA prec (onACR)"+requestCode+" "+resultCode);
Bitmap imagen = null; int cat = getIntent().getIntExtra("cat", -1);
Bitmap imagen = null;
switch(requestCode) { switch(requestCode) {
case CAMERA_PIC_REQUEST: //Captura de foto case CAMERA_PIC_REQUEST: //Captura de foto
if (data != null && resultCode==RESULT_OK) { if (data != null && resultCode==RESULT_OK) {
imagen = (Bitmap) data.getExtras().get("data"); imagen = (Bitmap) data.getExtras().get("data");
this.launchActivity(imagen,CAMERA_PIC_REQUEST); this.launchEditPictoActivity(imagen);
//Log.i("DETALLES", "Llega el intent del menú, con texto: " + legend);
} else {
if(resultCode!=RESULT_OK) //Si no quieres la foto que has echado
startActivityForResult(new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE),CAMERA_PIC_REQUEST);
if(data==null) //Si te sales de la camara dandole al boton atras de android
startActivity(new Intent(this, PictogramActivity.class));
} }
break; break;
case GALLERY_PIC_REQUEST: //Galeria case GALLERY_PIC_REQUEST: //Galeria
...@@ -1130,48 +1118,73 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -1130,48 +1118,73 @@ protected void showOnlyTape(boolean onlyTape) {
cursor.close(); cursor.close();
imagen = BitmapFactory.decodeFile(filePath); imagen = BitmapFactory.decodeFile(filePath);
/** Tras echar foto llamar a la actividad de recortar y le paso la leyenda para si tiene anteriormente o null, y la imagen a recortar */ this.launchEditPictoActivity(imagen);
//-->GERMAN: legend != null ? legend : null es lo mismo que simplemente legend
this.launchActivity(imagen,GALLERY_PIC_REQUEST);
}else{
startActivity(new Intent(this, PictogramActivity.class));
} }
break; break;
case EditPictoActivity.EDIT_PICTO_REQUEST: case EditPictoActivity.EDIT_PICTO_REQUEST:
if (resultCode == RESULT_OK) if (resultCode == RESULT_OK) {
Log.i("DETALLES", "Llega el intent de recorte 2, texto: " + data.getExtras().getString(EditPictoActivity.TRANSCRIPTION)); int row = getIntent().getIntExtra(Picto.JSON_ATTTRS.ROW, -1);
int col = getIntent().getIntExtra(Picto.JSON_ATTTRS.COLUMN, -1);
int freeRow = getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_ROW, -1);
int freeColumn = getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_COLUMN, -1);
String path = data.getExtras().getString(EditPictoActivity.PATH);
String legend = data.getExtras().getString(Picto.JSON_ATTTRS.EXPRESSION);
chooseTextAndSavePicto(path, row, col, freeRow, freeColumn, cat, legend);
}
break;
} }
} }
/**
* función para la edición de un texto asociado a una nueva imagen y guardar el nuevo picto
*/
public void chooseTextAndSavePicto(final String selectedImagePath, final int row, final int col, final int freeRow, final int freeColumn,
final int category, final String legend) {
// Set up the buttons
int cat = category != -1 ? category : Picto.NO_CATEGORY;
Log.i(LOG_TAG,"Uploading "+legend+" at row "+"row"+", col "+col);
PCBcontext.getVocabulary().saveLocalPicto(
selectedImagePath,
legend,
cat,
row,
col,
freeRow,
freeColumn,
new iLocalPicto() {
@Override
public void saved(Picto localPicto) {
refresh();
try {
if (PCBcontext.is_user_online())
new PictoUploader(localPicto).upload();
} catch (IOException e) {
Log.e(Vocabulary.class.getCanonicalName(), e.getMessage());
}
}
});
}
/**Para cambiar la activity de PictogramActivity a EditPictoActivity /**Para cambiar la activity de PictogramActivity a EditPictoActivity
* @param image * @param image
*/ */
public void launchActivity(Bitmap image, int originImage){ public void launchEditPictoActivity(Bitmap image){
Intent intent = new Intent(this, EditPictoActivity.class); Intent intent = new Intent(this, EditPictoActivity.class);
if(image!=null) { if(image!=null) {
float aspectFactor = 1; Point size=GUITools.getScreenSize(this);
float bWidth = image.getWidth(); float bWidth = image.getWidth();
float bHeight = image.getHeight(); float bHeight = image.getHeight();
float factorX=size.x*0.7f/bWidth;
float factorY=size.y*0.7f/bHeight;
float factor= factorY>factorX ? factorX : factorY;
//Reducir la imagen a la mitad de su aspect ratio que viene de galería(Suele ser mayor que el tamaño maximo) bWidth=bWidth*factor;
if(bWidth>MAX_WIDTH || bHeight>MAX_HEIGHT){ bHeight=bHeight*factor;
image = Bitmap.createScaledBitmap(image,(int) bWidth/2,(int) bHeight/2,true);
bWidth = image.getWidth();
bHeight = image.getHeight();
}
//Ir ampliando el alto y ancho hasta lo máximo posible (sin perder el ratio original), sin pasarse de los límites
while(bWidth < MAX_WIDTH && bHeight<MAX_HEIGHT){
bWidth = bWidth * aspectFactor;
bHeight = bHeight * aspectFactor;
aspectFactor += 0.1;
}
Bitmap rescaled = Bitmap.createScaledBitmap(image,(int) bWidth, (int) bHeight, true); Bitmap rescaled = Bitmap.createScaledBitmap(image,(int) bWidth, (int) bHeight, true);
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
...@@ -1179,26 +1192,10 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -1179,26 +1192,10 @@ protected void showOnlyTape(boolean onlyTape) {
byte[] byteArray = stream.toByteArray(); byte[] byteArray = stream.toByteArray();
intent.putExtra(EditPictoActivity.IMAGE_PICTO, byteArray); intent.putExtra(EditPictoActivity.IMAGE_PICTO, byteArray);
intent.putExtra(EditPictoActivity.IMAGE_ORIGIN, originImage == CAMERA_PIC_REQUEST ? CAMERA_PIC_REQUEST : GALLERY_PIC_REQUEST);
intent.putExtra(EditPictoActivity.IMAGE_ORIENTATION, bWidth > bHeight ? HORIZONTAL_ORIENTATION : VERTICAL_ORIENTATION);
if(picto!=null) {
intent.putExtra(EditPictoActivity.TRANSCRIPTION, picto.get_translation()); intent.putExtra(Picto.JSON_ATTTRS.EXPRESSION, getIntent().getStringExtra(Picto.JSON_ATTTRS.EXPRESSION));
picto = null;
}
startActivityForResult(intent, EditPictoActivity.EDIT_PICTO_REQUEST); startActivityForResult(intent, EditPictoActivity.EDIT_PICTO_REQUEST);
} }
} }
/*@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
// Esto es lo que hace mi botón al pulsar ir a atrás
finish();
Intent intent =
return true;
}
return super.onKeyDown(keyCode, event);
}*/
} }
package com.yottacode.pictogram.tabletlibrary.cropper; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper;
import android.content.Context; import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
...@@ -15,18 +15,15 @@ import android.graphics.drawable.Drawable; ...@@ -15,18 +15,15 @@ import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.Edge; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.Edge;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.handle.Handle; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.handle.Handle;
import com.yottacode.pictogram.tabletlibrary.cropper.util.AspectRatioUtil; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util.AspectRatioUtil;
import com.yottacode.pictogram.tabletlibrary.cropper.util.HandleUtil; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util.HandleUtil;
import com.yottacode.pictogram.tabletlibrary.cropper.util.PaintUtil; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util.PaintUtil;
/** /**
...@@ -36,12 +33,7 @@ import com.yottacode.pictogram.tabletlibrary.cropper.util.PaintUtil; ...@@ -36,12 +33,7 @@ import com.yottacode.pictogram.tabletlibrary.cropper.util.PaintUtil;
*/ */
public class CropImageView extends ImageView { public class CropImageView extends ImageView {
// Private Constants ///////////////////////////////////////////////////////////////////////////
private static final int CAMERA_PIC_REQUEST = 1;
private static final int GALLERY_PIC_REQUEST = 2;
private static final int VERTICAL_ORIENTATION = 200;
private static final int HORIZONTAL_ORIENTATION = 300;
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static final String TAG = CropImageView.class.getName(); private static final String TAG = CropImageView.class.getName();
...@@ -253,10 +245,8 @@ public class CropImageView extends ImageView { ...@@ -253,10 +245,8 @@ public class CropImageView extends ImageView {
* Gets the cropped image based on the current crop window. * Gets the cropped image based on the current crop window.
* *
* @return a new Bitmap representing the cropped image * @return a new Bitmap representing the cropped image
* @param origin
* @param orientation
*/ */
public Bitmap getCroppedImage(int origin, int orientation) { public Bitmap getCroppedImage() {
final Drawable drawable = this.getDrawable(); final Drawable drawable = this.getDrawable();
if (drawable == null || !(drawable instanceof BitmapDrawable)) { if (drawable == null || !(drawable instanceof BitmapDrawable)) {
return null; return null;
...@@ -271,8 +261,8 @@ public class CropImageView extends ImageView { ...@@ -271,8 +261,8 @@ public class CropImageView extends ImageView {
final float scaleY = matrixValues[Matrix.MSCALE_Y]; //==1 final float scaleY = matrixValues[Matrix.MSCALE_Y]; //==1
// Extract the translation values. // Extract the translation values.
final float transX = (origin == CAMERA_PIC_REQUEST && orientation== HORIZONTAL_ORIENTATION ) ? matrixValues[Matrix.MTRANS_Y] : matrixValues[Matrix.MTRANS_X]; final float transX = matrixValues[Matrix.MTRANS_X];
final float transY = (origin == CAMERA_PIC_REQUEST && orientation== HORIZONTAL_ORIENTATION ) ? matrixValues[Matrix.MTRANS_X] : matrixValues[Matrix.MTRANS_Y]; final float transY = matrixValues[Matrix.MTRANS_Y];
final Bitmap originalBitmap = ((BitmapDrawable) drawable).getBitmap(); final Bitmap originalBitmap = ((BitmapDrawable) drawable).getBitmap();
/*Log.i("DETALLES","ScaleX: "+scaleX + "- ScaleY: "+scaleY); /*Log.i("DETALLES","ScaleX: "+scaleX + "- ScaleY: "+scaleY);
......
package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper;
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext;
import java.io.ByteArrayOutputStream;
/**
* Created by German on 06/02/2017.
*/
public class EditPictoActivity extends Activity {
// Private Constants ///////////////////////////////////////////////////////////////////////////
public static final int EDIT_PICTO_REQUEST = 2288;
public static final String PATH = "pathImage";
public static final String IMAGE_PICTO = "imagePicto";
private static final String LOG_PATH = EditPictoActivity.class.getName();
// Activity Methods ////////////////////////////////////////////////////////////////////////////
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.edit_picto_layout);
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
LinearLayout ll = (LinearLayout)findViewById(R.id.image_layout);
Log.i("DETALLES", "Tam menu imagen: "+ ll.getLayoutParams().width);
ll.getLayoutParams().width = (int) (metrics.widthPixels * 0.75 ) - (int) getResources().getDimension(R.dimen.activity_vertical_margin) *2;
Log.i("DETALLES", "Tam menu imagen: "+ ll.getLayoutParams().width);
ll.requestLayout();
FrameLayout fl = (FrameLayout)findViewById(R.id.legend_menu);
Log.i("DETALLES", "Tam menu leyenda: "+ fl.getLayoutParams().width);
fl.getLayoutParams().width = (int) (metrics.widthPixels * 0.25) - (int) getResources().getDimension(R.dimen.activity_vertical_margin);
Log.i("DETALLES", "Tam menu leyenda: "+ fl.getLayoutParams().width);
fl.requestLayout();
// Initialize Views.
final CropImageView cropImageView = (CropImageView) findViewById(R.id.CropImageView);
final EditText legend = (EditText) findViewById(R.id.edtLegend);
final Button okButton = (Button) findViewById(R.id.okButton);
final Button cancelButton = (Button) findViewById(R.id.cancelButton);
String transcription=getIntent().getExtras().getString(Picto.JSON_ATTTRS.EXPRESSION);
cropImageView.setFixedAspectRatio(true);
cropImageView.setGuidelines(2);
cropImageView.setAspectRatio(1,1);
if(transcription != null && transcription.length()>0)
legend.setText(transcription);
legend.setHorizontallyScrolling(false);
legend.setMaxLines(1);
legend.setSingleLine(true);
//Obtener imagen del intent
byte[] byteArray = getIntent().getByteArrayExtra(EditPictoActivity.IMAGE_PICTO);
Bitmap imagePicto = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
cropImageView.setImageBitmap(imagePicto);
cropImageView.setMaxWidth(imagePicto.getWidth());
cropImageView.setMaxHeight(imagePicto.getHeight());
if (transcription!=null && transcription.length()>0)
legend.setText(transcription);
//Gestion de botones
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (legend.getText().toString().trim().length()>0) {
final Bitmap croppedImage = cropImageView.getCroppedImage();
//Escalar imagen
Bitmap finalImage = croppedImage.createScaledBitmap(croppedImage, 96, 96, true);
//Guardar imagen en galeria y obtener la ruta
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
finalImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
String title = getResources().getString(R.string.app_name) + ' ' + legend.getText().toString();
String path = MediaStore.Images.Media.insertImage(PCBcontext.getContext().getContentResolver(), finalImage, title, null);
path = getRealPathFromURI(Uri.parse(path));
Log.i(LOG_PATH, " New image " + title + " saved at " + path);
Intent intent = getIntent(); //Mandar a pictogram activity el path y el texto de la imagen
intent.putExtra(PATH, path);
intent.putExtra(Picto.JSON_ATTTRS.EXPRESSION, legend.getText().toString());
cropImageView.setImageBitmap(finalImage);
setResult(RESULT_OK, intent);
finish(); //Termina la actividad de editar
}
else Toast.makeText(getBaseContext(),R.string.crop_TextRequired, Toast.LENGTH_LONG).show();
}
});
//Si cancela, volver a pictogram activity
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
setResult(RESULT_CANCELED,getIntent());
}
});
}
public String getRealPathFromURI(Uri contentUri) {
Cursor cursor = null;
try {
String[] proj = { MediaStore.Images.Media.DATA };
cursor = this.getContentResolver().query(contentUri, proj, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
} finally {
if (cursor != null) {
cursor.close();
}
}
}
}
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
* governing permissions and limitations under the License. * governing permissions and limitations under the License.
*/ */
package com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge;
import android.graphics.RectF; import android.graphics.RectF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.yottacode.pictogram.tabletlibrary.cropper.util.AspectRatioUtil; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util.AspectRatioUtil;
/** /**
* Enum representing an edge in the crop window. * Enum representing an edge in the crop window.
......
package com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge;
/** /**
* Simple class to hold a pair of Edges. * Simple class to hold a pair of Edges.
......
package com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.handle; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.handle;
import android.graphics.RectF; import android.graphics.RectF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.Edge; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.Edge;
/** /**
* HandleHelper class to handle the center handle. * HandleHelper class to handle the center handle.
......
package com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.handle; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.handle;
import android.graphics.RectF; import android.graphics.RectF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.Edge; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.Edge;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.EdgePair; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.EdgePair;
/** /**
* HandleHelper class to handle corner Handles (i.e. top-left, top-right, bottom-left, and * HandleHelper class to handle corner Handles (i.e. top-left, top-right, bottom-left, and
......
package com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.handle; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.handle;
import android.graphics.RectF; import android.graphics.RectF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.Edge; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.Edge;
/** /**
* Enum representing a pressable, draggable Handle on the crop window. * Enum representing a pressable, draggable Handle on the crop window.
......
package com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.handle; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.handle;
import android.graphics.RectF; import android.graphics.RectF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.Edge; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.Edge;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.EdgePair; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.EdgePair;
import com.yottacode.pictogram.tabletlibrary.cropper.util.AspectRatioUtil; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util.AspectRatioUtil;
/** /**
* Abstract helper class to handle operations on a crop window Handle. * Abstract helper class to handle operations on a crop window Handle.
......
package com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.handle; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.handle;
import android.graphics.RectF; import android.graphics.RectF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.Edge; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.Edge;
import com.yottacode.pictogram.tabletlibrary.cropper.util.AspectRatioUtil; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util.AspectRatioUtil;
/** /**
* Handle helper class to handle horizontal handles (i.e. top and bottom handles). * Handle helper class to handle horizontal handles (i.e. top and bottom handles).
......
package com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.handle; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.handle;
import android.graphics.RectF; import android.graphics.RectF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.edge.Edge; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.edge.Edge;
import com.yottacode.pictogram.tabletlibrary.cropper.util.AspectRatioUtil; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util.AspectRatioUtil;
/** /**
* HandleHelper class to handle vertical handles (i.e. left and right handles). * HandleHelper class to handle vertical handles (i.e. left and right handles).
......
package com.yottacode.pictogram.tabletlibrary.cropper.util; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util;
import android.graphics.RectF; import android.graphics.RectF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
......
package com.yottacode.pictogram.tabletlibrary.cropper.util; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util;
import android.graphics.PointF; import android.graphics.PointF;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import com.yottacode.pictogram.tabletlibrary.cropper.cropwindow.handle.Handle; import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.cropwindow.handle.Handle;
/** /**
* Utility class to perform basic operations with Handles. * Utility class to perform basic operations with Handles.
......
package com.yottacode.pictogram.tabletlibrary.cropper.util; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util;
public class MathUtil { public class MathUtil {
......
package com.yottacode.pictogram.tabletlibrary.cropper.util; package com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.util;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Paint; import android.graphics.Paint;
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--<RelativeLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/TotalLayout"
android:background="@android:color/white">
<TextView
android:paddingTop="@dimen/content_padding_half"
android:id="@+id/crop_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:text="@string/titleCropper"
android:textSize="24sp"
android:textColor="@color/black"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:background="@color/gray_blue" />
<LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:id="@+id/TotalLayout" android:layout_height="match_parent"
android:background="#b4000000">--> android:layout_width="match_parent"
android:id="@+id/crop_legend"
<!--<FrameLayout android:layout_gravity="center_horizontal">
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" <LinearLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">-->
<!--<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" android:orientation="horizontal"
android:id="@+id/backgroundImage" android:layout_height="wrap_content"
app:srcCompat="@color/black_translucent" />--> android:layout_width="wrap_content"
android:id="@+id/image_layout"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_vertical_margin"
android:gravity="center">
<com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.CropImageView
android:id="@+id/CropImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:layout_gravity="center"
android:cropToPadding="false"
/>
<RelativeLayout </LinearLayout>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" <View
xmlns:tools="http://schemas.android.com/tools" android:layout_width="1dp"
android:layout_width="match_parent" android:layout_height="match_parent"
android:background="@android:color/darker_gray"
android:layout_marginRight="@dimen/activity_vertical_margin" />
<FrameLayout
android:orientation="vertical"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" android:layout_width="wrap_content"
android:id="@+id/TotalLayout" android:id="@+id/legend_menu"
android:background="@color/black_translucent"> android:layout_gravity="right"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:weightSum="1"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:gravity="center_vertical|center">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/titleCropper"
android:textSize="24sp"
android:textStyle="bold"
android:textColor="@android:color/white"
android:layout_weight="1"
android:layout_gravity="top"
android:textAlignment="center"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_alignStart="@+id/linearLayout2"
android:layout_centerVertical="false"
android:layout_centerHorizontal="true" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="false"
android:layout_centerHorizontal="true">
<com.yottacode.pictogram.tabletlibrary.cropper.CropImageView
android:id="@+id/CropImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:layout_below="@+id/title" <LinearLayout
android:layout_alignParentStart="true" android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="40dp">
android:layout_gravity="center_horizontal" <TextView
android:maxHeight="350px" android:textColor= "@color/gray"
android:maxWidth="700px" /> android:textSize="20sp"
android:text="@string/legendText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textLegend"
android:layout_gravity="center" />
<EditText <EditText
android:layout_width="wrap_content" android:textSize="20sp"
android:imeOptions="actionDone"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="@string/legendText"
android:ems="10" android:ems="10"
android:id="@+id/legend" android:id="@+id/edtLegend"
android:textAlignment="center" android:textColor="@color/black"
android:textColor="@android:color/white" android:layout_below="@+id/textLegend"
android:layout_above="@+id/linearLayout" android:layout_gravity="center"
android:layout_centerHorizontal="true" android:gravity="center"
android:gravity="center_vertical|center_horizontal" android:textColorLink="?android:attr/colorAccent"
android:layout_gravity="center_horizontal" /> android:maxLines="1"
</LinearLayout> android:textCursorDrawable="@null"
/>
<LinearLayout </LinearLayout>
<LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_gravity="bottom"
android:layout_centerHorizontal="true" android:gravity="bottom|center_horizontal"
android:layout_marginBottom="13dp"> android:layout_marginBottom="40dp">
<Button <Button
android:id="@+id/okButton" android:id="@+id/okButton"
android:layout_width="wrap_content" android:layout_width="120dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:minWidth="120dp" android:textColor="?android:attr/textColorPrimary"
android:text="@string/accept" android:textSize="18sp"
android:textColor="#33B5E5"
android:textSize="20sp"
android:textAlignment="center"
android:layout_alignParentBottom="true"
android:layout_toStartOf="@+id/cancelButton"
android:width="70dp"
android:layout_marginRight="10dp" />
<Button
android:id="@+id/cancelButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:minWidth="120dp"
android:text="@string/cancel"
android:textColor="#33B5E5"
android:textSize="20sp"
android:textAlignment="center" android:textAlignment="center"
android:layout_alignBaseline="@+id/okButton" android:text="@string/accept"
android:layout_alignBottom="@+id/okButton" android:gravity="center_horizontal"
android:layout_toEndOf="@+id/CropImageView" android:layout_marginLeft="10dp"
android:width="70dp" android:capitalize="sentences" />
android:layout_marginLeft="10dp" />
</LinearLayout> <Button
android:id="@+id/cancelButton"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorPrimary"
android:textSize="18sp"
android:textAlignment="center"
android:text="@string/cancel"
android:gravity="center_horizontal"
android:layout_marginRight="10dp"
android:capitalize="sentences"
android:layout_width="120dp" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
</RelativeLayout> </LinearLayout>
<!--</FrameLayout>-->
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<string name="session_loading">Downloading instructions</string> <string name="session_loading">Downloading instructions</string>
<string name="session_empty">Student without any method</string> <string name="session_empty">Student without any method</string>
<string name="session_notclosed">Last session was not closed. Please close from </string> <string name="session_notclosed">Last session was not closed. Please close from </string>
<string name="session_closed_ok">Session upload ok</string> <string name="session_closed_ok">Session uploupload ok</string>
<string name="session_closed_fail">Session not uploaded. Please, try it from</string> <string name="session_closed_fail">Session not uploaded. Please, try it from</string>
<string name="session_pause_error">Pause session failed</string> <string name="session_pause_error">Pause session failed</string>
<string name="session_noinet">No server conexion. Internet conexion is available?</string> <string name="session_noinet">No server conexion. Internet conexion is available?</string>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!---session--> <!---session-->
<string name="session_method">Método</string> <string name="session_method">Método</string>
<string name="session_insrtuction">Instrucción</string> <string name="session_instruction">Instrucción</string>
<string name="session_header">Seleccion de método e instrucción</string> <string name="session_header">Seleccion de método e instrucción</string>
<string name="session_error">Error de conexión</string> <string name="session_error">Error de conexión</string>
<string name="session_noinstructions">Alumno sin ninguna instrucción asignada. Por favor, asigne al menos una instrucción al alumno desde Pictogram Web</string> <string name="session_noinstructions">Alumno sin ninguna instrucción asignada. Por favor, asigne al menos una instrucción al alumno desde Pictogram Web</string>
...@@ -35,13 +35,12 @@ ...@@ -35,13 +35,12 @@
<string name="session_eval_notevuated">no evaluado</string> <string name="session_eval_notevuated">no evaluado</string>
<string name="session_eval_discarded">inválido</string> <string name="session_eval_discarded">inválido</string>
<string name="crop">Recortar</string> <string name="crop">Recortar</string>
<string name="titleCropper">Editar Picto</string> <string name="titleCropper">Nuevo Pictograma</string>
<string name="croppedImageDesc">Vista Previa</string> <string name="crop_TextRequired">Por favor, introduzca una leyenda para el pictograma</string>
<string name="cancel">Cancelar</string> <string name="legendText">Leyenda:</string>
<string name="accept">Aceptar</string>
<string name="legendText">Leyenda</string>
<string name="dialogCamera">Hacer Foto</string> <string name="dialogCamera">Hacer Foto</string>
<string name="dialogGallery">Seleccionar de Galería</string> <string name="dialogGallery">Seleccionar de Galería</string>
<string name="dialogTitle">Seleccionar Método</string> <string name="dialogTitle">Seleccionar Método</string>
<string name="dialogCancel">Cancelar</string> <string name="dialogCancel">Cancelar</string>
<string name="uploadingImage">Subiendo imagen al servidor</string>
</resources> </resources>
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
<color name="white_translucent">#AAFFFFFF</color> <color name="white_translucent">#AAFFFFFF</color>
<color name="black_translucent">#b4000000</color> <color name="black_translucent">#b4000000</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="gray_blue">#FF78909C</color>
<color name="blue_light">#FF40C4FF</color>
<color name="gray">#FF727272</color>
<color name="border">@color/white_translucent</color> <color name="border">@color/white_translucent</color>
<color name="guideline">@color/white_translucent</color> <color name="guideline">@color/white_translucent</color>
......
...@@ -44,15 +44,16 @@ ...@@ -44,15 +44,16 @@
<string name="dialogGallery">Seleccionar de Galería</string> <string name="dialogGallery">Seleccionar de Galería</string>
<string name="dialogCancel">Cancelar</string> <string name="dialogCancel">Cancelar</string>
<!-- Cropper --> <!-- Cropper -->
<string name="legendText">Leyenda</string> <string name="legendText">Leyenda:</string>
<string name="titleCropper">Editar Picto</string>
<string name="fixedAspectRatio">fixedAspectRatio =\u0020</string> <string name="fixedAspectRatio">fixedAspectRatio =\u0020</string>
<string name="aspectRatioXHeader">aspectRatioX =\u0020</string> <string name="aspectRatioXHeader">aspectRatioX =\u0020</string>
<string name="aspectRatioYHeader">aspectRatioY =\u0020</string> <string name="aspectRatioYHeader">aspectRatioY =\u0020</string>
<string name="showGuidelines">showGuidelines =\u0020</string> <string name="showGuidelines">showGuidelines =\u0020</string>
<string name="accept">Aceptar</string> <string name="crop">Recortar</string>
<string name="cancel">Cancel</string> <string name="titleCropper">Nuevo Pictograma</string>
<string name="croppedImageDesc">Vista Previa</string> <string name="crop_TextRequired">Por favor, introduzca una leyenda para el pictograma</string>
<string name="uploadingImage">Subiendo imagen al servidor</string>
<string-array name="showGuidelinesArray"> <string-array name="showGuidelinesArray">
<item>Off</item> <item>Off</item>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":tabletlibrary" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4"> <module external.linked.project.id=":tabletlibrary" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" version="4">
<component name="FacetManager"> <component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle"> <facet type="android-gradle" name="Android-Gradle">
<configuration> <configuration>
<option name="GRADLE_PROJECT_PATH" value=":tabletlibrary" /> <option name="GRADLE_PROJECT_PATH" value=":tabletlibrary" />
</configuration> </configuration>
</facet> </facet>
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
<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,14 +20,13 @@ ...@@ -25,14 +20,13 @@
<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>
<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/debug" /> <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" /> <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
...@@ -53,6 +47,7 @@ ...@@ -53,6 +47,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 +55,7 @@ ...@@ -60,6 +55,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 +63,7 @@ ...@@ -67,6 +63,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/androidTest/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
...@@ -74,6 +71,7 @@ ...@@ -74,6 +71,7 @@
<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" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
...@@ -100,10 +98,16 @@ ...@@ -100,10 +98,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" />
...@@ -119,6 +123,7 @@ ...@@ -119,6 +123,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" />
...@@ -145,4 +150,4 @@ ...@@ -145,4 +150,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
/build /build
/watch.iml .iml
\ No newline at end of file
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
android:screenOrientation="landscape" /> android:screenOrientation="landscape" />
<activity <activity
android:name="com.yottacode.pictogram.tabletlibrary.cropper.EditPictoActivity" android:name="com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.EditPictoActivity"
android:exported="true" android:exported="true"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleInstance" android:launchMode="singleInstance"
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":yotta_tablet" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Pictogram" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> <module external.linked.project.id=":yotta_tablet" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" version="4">
<component name="FacetManager"> <component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle"> <facet type="android-gradle" name="Android-Gradle">
<configuration> <configuration>
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<facet type="android" name="Android"> <facet type="android" name="Android">
<configuration> <configuration>
<option name="SELECTED_BUILD_VARIANT" value="DevFlavorDebug" /> <option name="SELECTED_BUILD_VARIANT" value="DevFlavorDebug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDevFlavorDebug" /> <option name="ASSEMBLE_TASK_NAME" value="assembleDevFlavorDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDevFlavorDebugSources" /> <option name="COMPILE_JAVA_TASK_NAME" value="compileDevFlavorDebugSources" />
<afterSyncTasks> <afterSyncTasks>
...@@ -25,7 +26,6 @@ ...@@ -25,7 +26,6 @@
<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/DevFlavor/debug" /> <output url="file://$MODULE_DIR$/build/intermediates/classes/DevFlavor/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/DevFlavor/debug" /> <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/DevFlavor/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/DevFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/DevFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/DevFlavor/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/DevFlavor/debug" isTestSource="false" generated="true" />
...@@ -42,16 +42,6 @@ ...@@ -42,16 +42,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug" isTestSource="true" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug" isTestSource="true" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug" isTestSource="true" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
...@@ -64,6 +54,7 @@ ...@@ -64,6 +54,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/aidl" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" />
...@@ -82,8 +73,6 @@ ...@@ -82,8 +73,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/assets" type="java-test-resource" />
...@@ -92,20 +81,12 @@ ...@@ -92,20 +81,12 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDevFlavor/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" />
<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" />
...@@ -113,6 +94,7 @@ ...@@ -113,6 +94,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" />
...@@ -120,6 +102,7 @@ ...@@ -120,6 +102,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" />
...@@ -140,17 +123,9 @@ ...@@ -140,17 +123,9 @@
<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" />
<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/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/assets" type="java-test-resource" />
<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/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<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" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars" />
...@@ -161,6 +136,23 @@ ...@@ -161,6 +136,23 @@
<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-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/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<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/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" />
...@@ -175,6 +167,7 @@ ...@@ -175,6 +167,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" />
...@@ -201,4 +194,4 @@ ...@@ -201,4 +194,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
...@@ -243,16 +243,107 @@ module.exports = { ...@@ -243,16 +243,107 @@ module.exports = {
}) })
.catch(() => res.serverError()); .catch(() => res.serverError());
function getCategories(id_cat){ // function getCategories(id_cat){
PictoCat // PictoCat
.find({select: ['id'], id_supercat: id_cat }) // .find({select: ['id'], id_supercat: id_cat })
.then(function (categories) { // .then(function (categories) {
console.log(categories); // console.log(categories);
return categories; // return categories;
// })
// .catch(function (err) {
// throw err;
// });
// }
},
/**
* Return own or public pictos using a search string from category
* and subcategories using the language of the specified supervisor.
* @param {request} req {} (with supervisorId and categoryId as url parameters)
* @param {response} res
* [
* {
* expressions: [
* // There should be just one expression per picto
* // with the language being used by the supervisor
* {
* id: 1234,
* lang: 'es-es',
* text: 'nacimiento',
* picto: 23
* }
* ],
* source: 1,
* owner: null,
* id: 23,
* uri: 'picto/uri.jpg',
* category: 41
* }
* ]
*/
fromSearch: function (req, res) {
Supervisor.findOne({ id: req.params.id }).then(function (supervisor) {
if (supervisor) {
if (req.params.id_cat == 0){ //Search in all categories
getPictos(0, supervisor.lang, supervisor.id);
}else{//Get selected category and subcategories
PictoCat
.find({select: ['id'], id_supercat: req.params.id_cat })
.then(function (categories) {
var filtered = [Number(req.params.id_cat)]; //Get returned ID
for(var i =0; i<categories.length;i++){
filtered.push(categories[i].id);
}
getPictos(filtered, supervisor.lang, supervisor.id);
})
.catch(function (err) {
throw err;
});
}
} else {
return res.badRequest();
}
})
.catch(() => res.serverError());
//
// Get pictos within specified categories
//
function getPictos(categories, lang, sup_id){
var l = [];
var fs = require('fs');
//Only fetch owned or public pictos
var params = {or: [{owner: null}, {owner: sup_id}], source: req.params.source};
if(typeof categories == "object" ){ //Is an array
params = { or: [{owner: null}, {owner: sup_id}], category: categories };
}
Picto.find().where(params)
.paginate({page: req.params.page, limit: req.params.limit})
.populate('expressions', {lang: lang, text: { like: '%'+req.params.text+'%'}})
.then(function (pictos) {
async.eachSeries(pictos, function(picto, next_cb) {
// check picto has expressions associated in student language
if (picto.expressions.length == 0 || picto.expressions[0].text.length == 0)
return next_cb();
// check picto image is available
picto.imageFileExists((found) => {
if (found) {
l.push(picto);
next_cb();
}
else
next_cb();
});
},
function (err) { // loop has end
if (err) throw err;
sails.log.debug(pictos.length + " pictos sent for category " + req.params.id_cat + " in language " + lang);
return res.ok(l);
}); // end async.eachSeries
}) })
.catch(function (err) { .catch(() => res.badRequest());
throw err;
});
} }
}, },
......
...@@ -391,7 +391,9 @@ ...@@ -391,7 +391,9 @@
"view": "View", "view": "View",
"voice": "Voice", "voice": "Voice",
"warning_last_session_bad": "Last session was interrupted. Please, you must evaluate last tries and press 'close seesion' button", "warning_last_session_bad": "Last session was interrupted. Please, you must evaluate last tries and press 'close seesion' button",
"warning_no_pictos_found": "No pictograms found with specified keyword",
"warning_no_tablet_online":"No Pictogran Tablet online detected", "warning_no_tablet_online":"No Pictogran Tablet online detected",
"warning_two_characters":"Must type at least two characters",
"woman": "Woman", "woman": "Woman",
"year_totals": "Year totals", "year_totals": "Year totals",
"yes": "Yes", "yes": "Yes",
......
...@@ -392,7 +392,9 @@ ...@@ -392,7 +392,9 @@
"view": "Vista", "view": "Vista",
"voice": "Voz", "voice": "Voz",
"warning_last_session_bad": "La última sesión no se cerró correctamente. Por favor, evalúe los ensayos y pulse 'cerrar sesión' ", "warning_last_session_bad": "La última sesión no se cerró correctamente. Por favor, evalúe los ensayos y pulse 'cerrar sesión' ",
"warning_no_pictos_found": "No se encontraron pictogramas con las palabras introducidas",
"warning_no_tablet_online":"No se detectó ningún usuario de Pictogram Tablet online", "warning_no_tablet_online":"No se detectó ningún usuario de Pictogram Tablet online",
"warning_two_characters":"Debe introducir al menos dos caracteres",
"woman": "Mujer", "woman": "Mujer",
"year_totals": "Totales año", "year_totals": "Totales año",
"yes": "Sí", "yes": "Sí",
......
...@@ -17,7 +17,8 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -17,7 +17,8 @@ dashboardControllers.controller('AddPictoCtrl', function (
ngToast, ngToast,
config, config,
supervisor, supervisor,
student) { student,
onlyOwn) {
$scope.source = 'symbolstx'; $scope.source = 'symbolstx';
$scope.pictos = []; // Pictos to show with infinite sroll $scope.pictos = []; // Pictos to show with infinite sroll
...@@ -26,36 +27,41 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -26,36 +27,41 @@ dashboardControllers.controller('AddPictoCtrl', function (
$scope.symbolstxCats = []; $scope.symbolstxCats = [];
$scope.breadcrumbs = []; $scope.breadcrumbs = [];
$scope.loadingCatPictos = false; $scope.loadingCatPictos = false;
$scope.radioModel = 'Middle'; $scope.radioModel = 'Middle';
$scope.onlyOwn = onlyOwn;
$scope.breadcrumbs.push({ /*
id: 0, * Get data about SymbolStix
exp: 'Inicio', */
glyphicon: 'glyphicon glyphicon-home' if (!onlyOwn) { // only if the modal will allow to select SymbolStix pictos
}); $scope.breadcrumbs.push({
id: 0,
// Request of general pictos categories (symbolstx) exp: 'Inicio',
$http.get(config.backend + '/sup/' + supervisor.id + '/pic_categories/0') glyphicon: 'glyphicon glyphicon-home'
.success(function (data) {
$scope.symbolstxCats = data;
})
.error(function () {
$translate('error_loading_pictos').then(function (translation) {
ngToast.danger({ content: translation });
}); });
});
// Request of general pictos categories (symbolstx)
// Request page 1 pictos (symbolstx) $http.get(config.backend + '/sup/' + supervisor.id + '/pic_categories/0')
$http.get(config.backend + '/sup/' + supervisor.id + '/pic_fromSymbolStx/page/1/limit/'+$scope.limit) .success(function (data) {
.success(function (data) { $scope.symbolstxCats = data;
$scope.pictos = data; })
}) .error(function () {
.error(function () { $translate('error_loading_pictos').then(function (translation) {
$translate('error_loading_pictos').then(function (translation) { ngToast.danger({ content: translation });
ngToast.danger({ content: translation }); });
}); });
});
// Request page 1 pictos (symbolstx)
$http.get(config.backend + '/sup/' + supervisor.id + '/pic_fromSymbolStx/page/1/limit/'+$scope.limit)
.success(function (data) {
$scope.pictos = data;
})
.error(function () {
$translate('error_loading_pictos').then(function (translation) {
ngToast.danger({ content: translation });
});
});
}
// //
// Load pictos from a category // Load pictos from a category
...@@ -88,13 +94,11 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -88,13 +94,11 @@ dashboardControllers.controller('AddPictoCtrl', function (
}; };
// //
// Load pictos from owned by the actual supervisor // Load pictos owned by the actual supervisor
// //
$scope.load_own_pictos = function () { $scope.load_own_pictos = function () {
$scope.source = 'ownpictos'; $scope.source = 'ownpictos';
$('#own_group').fadeIn();
$http.get(config.backend + '/sup/' + supervisor.id + '/pictos') $http.get(config.backend + '/sup/' + supervisor.id + '/pictos')
.success(function (data) { .success(function (data) {
if (data) { if (data) {
...@@ -208,7 +212,7 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -208,7 +212,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
picto.expressions = []; picto.expressions = [];
$scope.open_exp(picto, () => { $scope.open_exp(picto, () => {
$scope.pictos.push(picto); $scope.pictos.push(picto);
$scope.load_own_pictos(); load_own_pictos();
cb(); cb();
}); });
}); });
...@@ -238,14 +242,16 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -238,14 +242,16 @@ dashboardControllers.controller('AddPictoCtrl', function (
} }
} }
// websocket emit vocabulary delete action if (!$scope.onlyOwn) {
io.socket.post('/stu/vocabulary', { // websocket emit vocabulary delete action
action: 'delete', io.socket.post('/stu/vocabulary', {
attributes: { action: 'delete',
id_stu: student.id, attributes: {
stu_picto: pictoId id_stu: student.id,
} stu_picto: pictoId
}, function () {}); }
}, function () {});
}
}) })
.error(function () {}); .error(function () {});
...@@ -288,12 +294,16 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -288,12 +294,16 @@ dashboardControllers.controller('AddPictoCtrl', function (
//Triggered when scrolling to bottom //Triggered when scrolling to bottom
$scope.scroll = function(){ $scope.scroll = function(){
if ($scope.onlyOwn)
return;
$scope.loadingCatPictos = true; $scope.loadingCatPictos = true;
$scope.page += 1; $scope.page += 1;
var request = ""; var request = "";
if($scope.breadcrumbs.length == 1){ if($scope.breadcrumbs.length == 1) {
//Request page X from all pictos (symbolstx) //Request page X from all pictos (symbolstx)
request = config.backend + '/sup/' + supervisor.id + request = config.backend + '/sup/' + supervisor.id +
'/pic_fromSymbolStx/page/'+$scope.page+'/limit/'+$scope.limit; '/pic_fromSymbolStx/page/'+$scope.page+'/limit/'+$scope.limit;
...@@ -313,5 +323,63 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -313,5 +323,63 @@ dashboardControllers.controller('AddPictoCtrl', function (
}); });
$scope.loadingCatPictos = false; $scope.loadingCatPictos = false;
}); });
} };
//
// Search srch_term_picto in owned or public pictos
//
$scope.search = function() {
if ($scope.onlyOwn)
return;
$scope.page=1; // Reset pagination
var length = $scope.srch_term_picto == undefined ? 0 : $scope.srch_term_picto.length;
if(length <2){ //Check the word length
$scope.alert = { type: 'warning', msg: 'warning_two_characters', show: true };
}else{
var request = "";
var source = 1;
$scope.closeAlert();
$scope.loadingCatPictos = true;
//category to look in
var category = $scope.breadcrumbs[$scope.breadcrumbs.length-1].id;
if($scope.source == "ownpictos"){
source = 2;
category = 0;
}
request = config.backend + '/sup/' + supervisor.id +
'/pic_fromSearch/'+$scope.srch_term_picto+'/category/'+category+
'/page/'+$scope.page+'/limit/'+$scope.limit+'/source/'+source;
// Add Search to breadcrumbs
if($scope.breadcrumbs[$scope.breadcrumbs.length-1].id != 999){
$scope.breadcrumbs.push({
id: 999,
exp: "filter",
glyphicon: 'glyphicon glyphicon-chevron-right'
});
}
$scope.symbolstxCats = [];
$http.get(request)
.success(function (data) {
$scope.pictos = data;
if(data.length == 0){
$scope.alert = { type: 'warning', msg: 'warning_no_pictos_found', show: true };
}
$scope.loadingCatPictos = false;
})
.error(function () {
$translate('error_loading_pictos').then(function (translation) {
ngToast.danger({ content: translation });
});
$scope.loadingCatPictos = false;
});
}
};
if (onlyOwn)
$scope.load_own_pictos();
}); });
...@@ -359,9 +359,13 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -359,9 +359,13 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
}, },
supervisor: function () { supervisor: function () {
return $scope.user; return $scope.user;
},
onlyOwn: function () {
return false;
} }
} }
}); });
// Returned data from the modal window // Returned data from the modal window
modalInstance.result.then(function (pictoId) { modalInstance.result.then(function (pictoId) {
......
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
<button type="button" class="close" ng-click="close()"> <button type="button" class="close" ng-click="close()">
<span aria-hidden="true">&times;</span><span class="sr-only" translate>close</span> <span aria-hidden="true">&times;</span><span class="sr-only" translate>close</span>
</button> </button>
<h4 class="modal-title" id="myModalLabel" translate>add_picto</h4> <h4 class="modal-title" id="myModalLabel" translate ng-show="!onlyOwn">add_picto</h4>
<h4 class="modal-title" id="myModalLabel" translate ng-show="onlyOwn">own_pictos</h4>
<hr> <hr ng-show="!onlyOwn">
<div class="btn-group"> <div class="btn-group" ng-show="!onlyOwn">
<button class="btn btn-default" btn-radio="'symbolstx'" ng-model="source" ng-click="open_category_from_bc('0')"> <button class="btn btn-default" btn-radio="'symbolstx'" ng-model="source" ng-click="open_category_from_bc('0')">
<span class="glyphicon glyphicon-th"></span> SymbolStix <span class="glyphicon glyphicon-th"></span> SymbolStix
</button> </button>
...@@ -17,15 +18,15 @@ ...@@ -17,15 +18,15 @@
<span class="glyphicon glyphicon-picture"></span> {{ 'own_pictos' | translate }} <span class="glyphicon glyphicon-picture"></span> {{ 'own_pictos' | translate }}
</button> </button>
</div> </div>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div ng-show="source == 'symbolstx'" class="panel panel-default" id="bread_and_categories">
<div id="bread_and_categories" ng-show="source == 'symbolstx' && !onlyOwn" class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<div class="pull-left" ng-repeat="b in breadcrumbs"> <div class="pull-left" ng-repeat="b in breadcrumbs">
<a ng-click="open_category_from_bc(b.id)"> <a ng-click="open_category_from_bc(b.id)">
<span class="{{b.glyphicon}}"></span> {{ b.exp }} <span class="{{b.glyphicon}}"></span> {{ b.exp | translate}}
</a> </a>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
...@@ -37,89 +38,62 @@ ...@@ -37,89 +38,62 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div><!-- /bread_and_categories -->
<div> <div>
<alert ng-show="alert.show" ng-model="alert" type="{{alert.type}}" close="closeAlert()">{{alert.msg}}</alert> <alert ng-show="alert.show" ng-model="alert" type="{{alert.type}}" close="closeAlert()">{{alert.msg | translate}}</alert>
</div> </div>
<div class="row" ng-show="source != 'newfile'" > <div id="collections" class="col-md-12 category-collection"
<div id="collections" class="col-md-12 category-collection" ng-class="{ 'category-collection-loading': loadingCatPictos }"
ng-class="{ 'category-collection-loading': loadingCatPictos }" data-loading="{{ 'loading_pictos' | translate }}">
data-loading="{{ 'loading_pictos' | translate }}"> <form ng-submit="search()" ng-show="!onlyOwn">
<div class="input-group" id="search_pictos_box"> <div class="input-group" id="search_pictos_box">
<input type="text" class="form-control" placeholder="{{ 'filter' | translate }}" ng-model="srch_term_picto" id="srch_term_picto"> <input type="text" class="form-control" placeholder="{{ 'filter' | translate }}"
<span class="input-group-addon glyphicon glyphicon-search" id="basic-addon2" aria-hidden="true"></span> id="srch_term_picto" name="srch_term_picto" ng-model="srch_term_picto">
</div> <span class="input-group-btn">
<div ng-show="source == 'ownpictos'" class="input-group"> <button type="submit" class="btn btn-primary">
<button class="btn btn-success" ngf-select ng-model="picFile" accept="image/*" ngf-change="addOwnPicto()"> <i class="fa fa-search" aria-hidden="true"></i> {{ 'search' | translate }}
<span class="glyphicon glyphicon-folder-open"></span> {{ 'new_img' | translate }} </button>
</label> </span>
</div> </div>
<!-- Galería de pictos --> </form>
<div id="clearfix-infiniteScroll-parent" infinite-scroll="scroll()" <div ng-show="source == 'ownpictos'" class="input-group">
infinite-scroll-container="'#collections'"> <button class="btn btn-success" ngf-select ng-model="picFile" accept="image/*" ngf-change="addOwnPicto()">
<div <span class="glyphicon glyphicon-folder-open"></span> {{ 'new_img' | translate }}
class="picto_peq pull-left" </button>
ng-repeat="p in pictos | filter:srch_term_picto" > </div>
<img ng-src="{{p.uri}}" popover="{{p.expressions[0].text}}" popover-trigger="mouseenter" /> <!-- Galería de pictos -->
<div id="clearfix-infiniteScroll-parent" infinite-scroll="scroll()"
infinite-scroll-container="'#collections'">
<div
class="picto_peq pull-left"
ng-repeat="p in pictos" >
<img ng-src="{{p.uri}}" popover="{{p.expressions[0].text}}" popover-trigger="mouseenter" />
<div class="picto_options">
<!-- Options to remove picto (Only for own pictos) --> <!-- Options to remove picto (Only for own pictos) -->
<div class="picto_options" ng-show="source == 'ownpictos'"> <a ng-click="remove_own_picto(p.id)" class="picto_remove" title="{{ 'delete' | translate}}" ng-show="source == 'ownpictos'">
<a ng-click="remove_own_picto(p.id)" class="picto_remove" title="{{ 'delete' | translate}}"> <span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span> </a>
</a> <a ng-show="!onlyOwn"
</div> ng-click="close(p.id)"
<div class="picto_options"> class="picto_add"
<a ng-click="remove_own_picto(p.id)" class="picto_remove" title="{{ 'delete' | translate}}"> title="{{ 'add_picto' | translate}}">
<a <span class="color_green glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
ng-click="close(p.id)" </a>
class="picto_add"
title="{{ 'add_picto' | translate}}">
<i class="color_green glyphicon glyphicon-plus-sign" aria-hidden="true"></i>
</a>
</a>
</div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div>
</div>
<!-- crop view --> </div><!-- /collections -->
<div id="crop_area" ng-show="source == 'newfile'">
<div class="row"> </div><!-- /row -->
<div class="col-md-8">
<div ngf-drop ng-model="picFile" ngf-pattern="image/*" class="cropArea">
<img-crop
image="picFile | ngfDataUrl"
result-image="croppedDataUrl" ng-init="croppedDataUrl=''"
area-type="square"
result-image-size="200"
>
</img-crop>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<img ng-src="{{ croppedDataUrl }}" />
</div>
<div class="form-group">
<button class="btn btn-default" ng-click="upload(croppedDataUrl, picFile.name)" ng-model="picFile" accept="image/*">
<span class="glyphicon glyphicon-upload"></span> {{ 'upload_image' | translate }}
</button>
</div>
<div class="form-group">
<span class="progress" ng-show="progress >= 0">
<div style="width:{{progress}}%" ng-bind="progress + '%'"></div>
</span>
</div>
</div>
</div>
</div>
</div> <!-- /modal-body --> </div> <!-- /modal-body -->
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-primary" ng-click="cancel()">{{ 'close' | translate }}</button> <button class="btn btn-primary" ng-click="cancel()">{{ 'close' | translate }}</button>
</div> </div>
</div> </div>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="row"> <div class="row">
<div class="col-xs-6"> <div class="col-xs-6">
<div class="input-group" id="add_label" > <div class="input-group" id="add_label" >
<span class="input-group-addon glyphicon glyphicon-comment" aria-hidden="true"></span> <span class="input-group-addon"><span class="glyphicon glyphicon-comment" aria-hidden="true"></span></span>
<input type="text" class="form-control" ng-model="studentPicto.attributes.expression" /> <input type="text" class="form-control" ng-model="studentPicto.attributes.expression" />
</div> </div>
</div> </div>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<form ng-submit="save()"> <form ng-submit="save()">
<div id="add_label" class="input-group"> <div id="add_label" class="input-group">
<span class="input-group-addon glyphicon glyphicon-comment" aria-hidden="true"></span> <span class="input-group-addon"><span class="glyphicon glyphicon-comment" aria-hidden="true"></span></span>
<input type="text" class="form-control" ng-model="expression" autofocus/> <input type="text" class="form-control" ng-model="expression" autofocus/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-success" type="submit" translate>save</button> <button class="btn btn-success" type="submit" translate>save</button>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<li class="list-group-item clearfix"> <li class="list-group-item clearfix">
<form ng-submit="add()"> <form ng-submit="add()">
<div id="add_label" class="input-group"> <div id="add_label" class="input-group">
<span class="input-group-addon glyphicon glyphicon-tag" aria-hidden="true"></span> <span class="input-group-addon"><span class="glyphicon glyphicon-tag" aria-hidden="true"></span></span>
<input type="text" class="form-control" ng-model="tagToAdd" /> <input type="text" class="form-control" ng-model="tagToAdd" />
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-success" type="submit" translate>add</button> <button class="btn btn-success" type="submit" translate>add</button>
......
...@@ -5,7 +5,16 @@ ...@@ -5,7 +5,16 @@
//----------------------- //-----------------------
// Supervisor Controller // Supervisor Controller
//----------------------- //-----------------------
dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl($scope, $window, $location, IOService, $modal, $translate) { dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl(
$scope,
$http,
config,
$window,
$location,
IOService,
$modal,
$translate
) {
// Restore user data from session // Restore user data from session
var user = JSON.parse($window.sessionStorage.user); var user = JSON.parse($window.sessionStorage.user);
...@@ -35,4 +44,28 @@ dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl($scope ...@@ -35,4 +44,28 @@ dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl($scope
} }
}); });
//
// Own Pictos
//
$scope.own_pictos = function () {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'modules/student/views/addpicto.html',
controller: 'AddPictoCtrl',
size: 'lg',
resolve: {
student: function () {
return null;
},
supervisor: function () {
return $scope.user;
},
onlyOwn: function () {
return true;
}
}
});
}
}); });
...@@ -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 }}
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div class="col-xs-4"> <div class="col-xs-4">
<div class=" input-group"> <div class=" input-group">
<input type="text" ng-model="search_sups" id="search_sups" placeholder="{{ 'filter' | translate }}" class="form-control" aria-describedby="basic-addon2"> <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> <span class="input-group-addon"><span class="glyphicon glyphicon-search" id="basic-addon2" aria-hidden="true"></span></span>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -75,7 +75,8 @@ module.exports.policies = { ...@@ -75,7 +75,8 @@ module.exports.policies = {
categories: ['tokenAuth'], categories: ['tokenAuth'],
fromcategory: ['tokenAuth'], fromcategory: ['tokenAuth'],
fromSymbolStx: ['tokenAuth'], fromSymbolStx: ['tokenAuth'],
fromCatSubcat: ['tokenAuth'] fromCatSubcat: ['tokenAuth'],
fromSearch: ['tokenAuth']
}, },
ServerController: { ServerController: {
......
...@@ -108,6 +108,7 @@ module.exports.routes = { ...@@ -108,6 +108,7 @@ module.exports.routes = {
'GET /sup/:id/pic_fromcategory/:id_cat': 'PictoController.fromcategory', 'GET /sup/:id/pic_fromcategory/:id_cat': 'PictoController.fromcategory',
'GET /sup/:id/pic_fromSymbolStx/page/:page/limit/:limit': 'PictoController.fromSymbolStx', 'GET /sup/:id/pic_fromSymbolStx/page/:page/limit/:limit': 'PictoController.fromSymbolStx',
'GET /sup/:id/pic_fromCatSubcat/category/:id_cat/page/:page/limit/:limit': 'PictoController.fromCatSubcat', 'GET /sup/:id/pic_fromCatSubcat/category/:id_cat/page/:page/limit/:limit': 'PictoController.fromCatSubcat',
'GET /sup/:id/pic_fromSearch/:text/category/:id_cat/page/:page/limit/:limit/source/:source': 'PictoController.fromSearch',
'GET /sup/email/:email': 'SupervisorController.getByEmail', 'GET /sup/email/:email': 'SupervisorController.getByEmail',
'GET /sup/changepass/:email': 'SupervisorController.request_change_password', 'GET /sup/changepass/:email': 'SupervisorController.request_change_password',
'PUT /sup/changepass': 'SupervisorController.change_password', 'PUT /sup/changepass': 'SupervisorController.change_password',
......
...@@ -49,6 +49,7 @@ module.exports = function (grunt) { ...@@ -49,6 +49,7 @@ module.exports = function (grunt) {
'assets/scripts/modules/admin/controllers/licenses.js', 'assets/scripts/modules/admin/controllers/licenses.js',
'assets/scripts/modules/admin/controllers/offices.js', 'assets/scripts/modules/admin/controllers/offices.js',
'assets/scripts/modules/admin/controllers/supervisors.js', 'assets/scripts/modules/admin/controllers/supervisors.js',
'assets/scripts/modules/supervisor/controllers/own_pictos.js',
'assets/scripts/modules/supervisor/controllers/supervisor.js', 'assets/scripts/modules/supervisor/controllers/supervisor.js',
'assets/scripts/modules/supervisor/controllers/supervisors.js', 'assets/scripts/modules/supervisor/controllers/supervisors.js',
'assets/scripts/modules/supervisor/controllers/students.js', 'assets/scripts/modules/supervisor/controllers/students.js',
......
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