Commit bcd3c8d4 by Arturo Montejo Ráez

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

parents a2a34744 9f88bfa7
Showing with 936 additions and 776 deletions
......@@ -52,8 +52,11 @@ src/main/assets/core_vocabulary/57236.png
src/main/assets/core_vocabulary/57384.png
src/main/createdoc.bat
src/main/resources/
tablet/tablet.iml
yotta_tablet/yotta_tablet.iml
commonlibrary/commonlibrary.iml
supervisor_tablet/supervisor_tablet.iml
commonlibrary/commonlibrary.iml
watch/watch.iml
app
......
......@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha3'
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
......@@ -39,7 +39,7 @@ public class RestapiWrapper {
iSilentLogin silentLogin;
public static final int TIME_OUT=20000;
private static final String SERVER_RESULT="result";
private static final String SERVER_ERROR="error";
public static final String SERVER_ERROR="error";
// String constant for logs
private final static String LOG_TAG = RestapiWrapper.class.getSimpleName(); // Or .getCanonicalName()
......
......@@ -58,6 +58,7 @@ class DeviceHelper {
*/
public class PCBDBHelper extends SQLiteOpenHelper {
final String LOG_TAG=this.getClass().getCanonicalName();
User currentUser;
boolean user_online; //true if the given user logged into the server
......@@ -84,7 +85,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
* @see PCBDBHelper#getCurrentUser()
*/
public void setCurrentUser(User user) {
Log.i(getClass().getCanonicalName(),"user "+user.get_name_stu()+" "+user.get_json_attrs());
Log.i(LOG_TAG,"user "+user.get_name_stu()+" "+user.get_json_attrs());
this.currentUser = user;
PCBcontext.getDevice().setLastStuId(user.get_id_stu());
if (user.is_supervisor()) PCBcontext.getDevice().setLastSupId(user.get_id_sup());
......@@ -106,7 +107,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
last_user = 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),
cursor.getInt(9), cursor.getString(10), cursor.getString(11), cursor.getString(12), cursor.getString(13), cursor.getString(14), cursor.getString(15), cursor.getString(16), cursor.getString(17));
} catch (JSONException e) {
Log.e(this.getClass().getName(), e.getMessage() + " BAD FORMED JSON: " + cursor.getString(5));
Log.e(LOG_TAG, e.getMessage() + " BAD FORMED JSON: " + cursor.getString(5));
System.exit(-1);
}
}
......@@ -149,13 +150,13 @@ public class PCBDBHelper extends SQLiteOpenHelper {
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.query("action", null, null, null, null, null, null, null);
Vector<JSONObject> actions= new Vector(cursor.getCount());
Log.i(this.getClass().getName(), "Local action recovering " + cursor.getCount() + " actions from local DB");
Log.i(LOG_TAG, "Local action recovering " + cursor.getCount() + " actions from local DB");
cursor.moveToFirst();
while (cursor.moveToNext())
try {
actions.add(new JSONObject(cursor.getString(0)));
} catch (JSONException e) {
Log.e(this.getClass().getName(), "Recovering batch actions:"+e.getMessage());
Log.e(LOG_TAG, "Recovering batch actions:"+e.getMessage());
}
cursor.close();
db.close();
......@@ -179,7 +180,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
int id_stu = this.getCurrentUser().get_id_stu();
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.query("collection_detail", null, "id_stu=?", new String[]{String.valueOf(id_stu)}, null, null, null, null);
Log.i(this.getClass().getName(), "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();
while (cursor.moveToNext()) {
Picto picto = new Picto(cursor.getInt(1), cursor.getString(2), cursor.getString(3), cursor.getString(4));
......@@ -211,6 +212,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
ContentValues values=new ContentValues(5);
values.put("id_stu", id_stu);
for (Picto picto : vocabulary) {
Log.e(LOG_TAG,"inserting "+picto.get_id()+":"+picto.get_translation()+":"+picto.get_json_attrs());
newsize++;
values.put("id_picto", picto.get_id());
values.put("url", picto.get_url());
......@@ -220,7 +222,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
}
int seconds2 = Calendar.getInstance().get(Calendar.SECOND);
Log.i(this.getClass().getName(), " Local student vocabulary updated, id:" + id_stu + ", cats: " + vocabulary.size() + " time:" + (seconds2 - seconds1) + " secs. Size: " + newsize + " read only?" + db.isReadOnly());
Log.i(LOG_TAG, " Local student vocabulary updated, id:" + id_stu + ", cats: " + vocabulary.size() + " time:" + (seconds2 - seconds1) + " secs. Size: " + newsize + " read only?" + db.isReadOnly());
db.close();
}
......@@ -241,7 +243,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
values.put("translation",picto.get_translation());
values.put("attributes",picto.get_json_attrs());
db.insert("collection_detail", null, values);
Log.i(this.getClass().getCanonicalName(),"Picto added:"+picto.get_translation());
Log.i(LOG_TAG,"Picto added:"+picto.get_translation());
db.close();
}
......
......@@ -113,8 +113,11 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
@Override
public boolean isValidToken(RestapiWrapper.HTTPException error, Object result) {
try {
return error.getCode()!=401 || (((JSONObject)result).getString("err").equalsIgnoreCase("Invalid token undefined"));
try { Log.e(LOG_TAG,"Token valid? "+error.getCode()+":"+result.toString());
return error.getCode()!=401
|| !(result instanceof JSONObject)
|| !((JSONObject)result).has("err")
|| !((JSONObject)result).getString("err").equalsIgnoreCase("Invalid token undefined");
} catch (JSONException e) {
Log.e(LOG_TAG,e.getMessage());
return true;
......
......@@ -43,13 +43,6 @@
<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/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/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/rs/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" />
<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" />
......@@ -58,6 +51,13 @@
<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$/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/buildConfig/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/assets" type="java-resource" />
......@@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/jni" isTestSource="false" />
<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/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/jni" 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/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/assets" type="java-test-resource" />
......@@ -82,6 +74,14 @@
<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/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/jni" 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/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
......@@ -122,57 +122,70 @@
<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/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/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/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-core-ui/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-media-compat/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/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-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="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
<orderEntry type="module" module-name="commonlibrary" 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="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="okhttp-2.3.0" level="project" />
<orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="engine.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" 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" />
</component>
</module>
\ No newline at end of file
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext;
import static android.graphics.Color.argb;
/**
* Created by Fernando on 25/01/2017.
*/
public class PictoAnimation {
private final String LOG_TAG = this.getClass().getCanonicalName();
public void animateTapeView(final int position, final ViewGroup view) {
final GridView gridview = (GridView) view.getChildAt(1);
final TapeAdapter tapeAdapter=(TapeAdapter)gridview.getAdapter();
RelativeLayout relativeLayout = (RelativeLayout) (gridview.getChildAt(position));
FrameLayout layout = (FrameLayout) (relativeLayout.getChildAt(0));
final ImageView v = (ImageView) (layout.getChildAt(0));
final int orange = ContextCompat.getColor(PCBcontext.getContext(), R.color.red);
final ValueAnimator colorAnim = ObjectAnimator.ofFloat(0f, 1f, 0f);
colorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float mul = (Float) animation.getAnimatedValue();
int alphaOrange = adjustAlpha(orange, mul);
v.setColorFilter(alphaOrange, PorterDuff.Mode.SRC_ATOP);
v.setBackgroundColor(alphaOrange);
v.setPadding(0, 0, 0, 0);
if (mul == 0.0) {
v.setColorFilter(0);
}
}
});
colorAnim.addListener(new ValueAnimator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) { Log.e(LOG_TAG,"animating"+position);
v.setColorFilter(0);
v.setBackgroundColor(ContextCompat.getColor(PCBcontext.getContext(), R.color.picto_default_background));
if (position < (tapeAdapter.getCount() - 1))
animateTapeView(position + 1, view);
else {
((Activity)view.getContext()).runOnUiThread(new Runnable() {
@Override
public void run() {
if (tapeAdapter.play())
tapeAdapter.endPlay();
}
});
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
colorAnim.setDuration(tapeAdapter.getItem(position).get_translation().length()*100);
colorAnim.start();
}
public static int adjustAlpha(int color, float factor) {
int alpha = Math.round(Color.alpha(color) * factor);
int red = Color.red(color);
int green = Color.green(color);
int blue = Color.blue(color);
return argb(alpha, red, green, blue);
}
public void animateTapeViewVertical(final PictogramActivity activity, final boolean up) {
final View v = activity.findViewById(R.id.pictogramLayout);
int y=v.getHeight()/2-activity.tapeGridView.getHeight()/2;
final ValueAnimator moveAnim = up
? ObjectAnimator.ofInt(y,0)
: ObjectAnimator.ofInt(0, y);
moveAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int i=(int)animation.getAnimatedValue();
v.setTranslationY(i);
if (i<=255) activity.ttsButton.setImageAlpha(255-i);
}
});
moveAnim.setDuration(500);
moveAnim.start();
}
public void animateImageView(final PictogramActivity activity, View view, final int position) {
if (activity.deleting) return;
View borderlayout=((RelativeLayout)view).getChildAt(0);
final ImageView v=((ImageView)((FrameLayout)borderlayout).getChildAt(0));
final int orange = ContextCompat.getColor(PCBcontext.getContext(),R.color.red);
final ValueAnimator colorAnim = ObjectAnimator.ofFloat(0f, 1f);
colorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float mul = (Float) animation.getAnimatedValue();
int alphaOrange = PictoAnimation.adjustAlpha(orange, mul);
v.setColorFilter(alphaOrange, PorterDuff.Mode.SRC_ATOP);
v.setBackgroundColor(alphaOrange);
v.setPadding(0,0,0,0);
if (mul == 0.0) {
v.setColorFilter(0);
}
}
});
colorAnim.addListener(new ValueAnimator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
activity.deleting=true;
}
@Override
public void onAnimationEnd(Animator animation) {
activity.tapeAdapter.deleteItem(position);
activity.tapeAdapter.notifyDataSetChanged();
v.setColorFilter(0);
v.setBackgroundColor(ContextCompat.getColor(PCBcontext.getContext(),R.color.picto_default_background));
activity.deleting=false;
if (activity.tapeAdapter.getCount()==0 && activity.tape_delivered) {
activity.showOnlyTape(false);
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
colorAnim.setDuration(750);
colorAnim.start();
}
}
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.text.InputType;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.yottacode.pictogram.action.VocabularyAction;
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.tools.PCBcontext;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static android.graphics.Color.BLACK;
import static android.graphics.Color.argb;
import static android.graphics.Color.rgb;
public class PictoMenu {
PictogramActivity activity;
//Variables used on the picto menu (only supervisors)
private RadialMenuWidget PieMenu;
private ImageView detail;
private RelativeLayout ll;
// TODO describe this variable
static final int SELECT_PICTURE = 1;
public PictoMenu(PictogramActivity activity) {
this.activity=activity;
}
/**
* add a local picto from pcb
*
* @param row
* @param col
*/
public void addPicto(int row, int col) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col);
} else {
activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_COLUMN, col);
}
activity.startActivityForResult(intent, SELECT_PICTURE);
}
/**
* 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) {
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
*
* @param requestCode
* @param resultCode
* @param data
*/
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
if (requestCode == SELECT_PICTURE) {
String selectedImagePath;
Uri selectedImageUri = data.getData();
selectedImagePath = getPath(selectedImageUri);
int row = activity.getIntent().getIntExtra(Picto.JSON_ATTTRS.ROW, -1);
int col = activity.getIntent().getIntExtra(Picto.JSON_ATTTRS.COLUMN, -1);
int freeRow = activity.getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_ROW, -1);
int freeColumn = activity.getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_COLUMN, -1);
Log.i(activity.getClass().getCanonicalName(), "0 Picto x y " + " " + row + " " + col);
activity.getIntent().removeExtra(Picto.JSON_ATTTRS.ROW);
activity.getIntent().removeExtra(Picto.JSON_ATTTRS.COLUMN);
activity.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_ROW);
activity.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_COLUMN);
chooseTextAndSavePicto(selectedImagePath, row, col, freeRow, freeColumn);
}
}
}
/**
* Función para la selección de una foto del carrete
*
* @param uri
* @return
*/
static public String getPath(Uri uri) {
if (uri == null) {
return null;
}
// this will only work for images selected from gallery
String[] projection = {MediaStore.Images.Media.DATA};
Cursor cursor = PCBcontext.getContext().getContentResolver().query(uri, projection, null, null, null);
if (cursor != null) {
int column_index = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
return uri.getPath();
}
/**Function for open a new View for change the expression of a picto
*
* @param picto
*/
public void createViewForExpression(final Picto picto){
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));
ll.setClickable(false);
//Parameters for hide navigation bar when u save or cancel
final View decorView = activity.getWindow().getDecorView();
final int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
/*| View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE*/;
final EditText leyenda = new EditText(PCBcontext.getContext());
leyenda.setBackgroundColor(rgb(221, 221, 211));
leyenda.setWidth(400);
leyenda.setMaxLines(1);
leyenda.setClickable(true);
leyenda.setTextSize(25);
leyenda.setX(activity.getResources().getDisplayMetrics().widthPixels/2 - 300);
leyenda.setY(activity.getResources().getDisplayMetrics().heightPixels/2 - 50);
leyenda.setTextColor(BLACK);
if(picto.get_translation()!= null && picto != null){
leyenda.setText(picto.get_translation());
}else{
leyenda.setText("Sin Descripción");
}
//Mostrar teclado automaticamente
final InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
ImageButton botonOk = new ImageButton(PCBcontext.getContext());
botonOk.setImageResource(android.R.drawable.ic_menu_save);
botonOk.setX(activity.getResources().getDisplayMetrics().widthPixels/2 + 110);
botonOk.setY(activity.getResources().getDisplayMetrics().heightPixels/2 - 50);
botonOk.setBackgroundColor(rgb(221,221,221));
botonOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
picto.set_translation(leyenda.getText().toString());
imm.hideSoftInputFromWindow(leyenda.getWindowToken(), 0);
picto.set_local_status(true);
if (!picto.is_local()) {
new PictoUploader(picto).uploadState();
PCBcontext.getActionLog().log(new VocabularyAction(VocabularyAction.ALTERATTRS, picto));
}
activity.getCurrentPictoGridAdapter().notifyDataSetChanged();
ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout();
//Hide navigation bar
//activity.refresh();
decorView.setSystemUiVisibility(uiOptions);
}
});
ImageButton botonSalir = new ImageButton(PCBcontext.getContext());
botonSalir.setImageResource(android.R.drawable.ic_menu_close_clear_cancel);
botonSalir.setX(activity.getResources().getDisplayMetrics().widthPixels/2 + 150);
botonSalir.setY(activity.getResources().getDisplayMetrics().heightPixels/2 - 50);
botonSalir.setBackgroundColor(rgb(221,221,221));
botonSalir.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imm.hideSoftInputFromWindow(leyenda.getWindowToken(), 0);
ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout();
//Hide navigation bar
//activity.refresh();
decorView.setSystemUiVisibility(uiOptions);
}
});
ll.addView(leyenda);
ll.addView(botonOk);
ll.addView(botonSalir);
leyenda.requestFocus();
imm.showSoftInput(leyenda, InputMethodManager.SHOW_FORCED);
}
/**Function for build a radial menu
*
* @param is_picto_big
* @param picto
*/
public void createMenuForPicto(boolean is_picto_big, Picto picto){
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
PieMenu.setCenterCircle(new Close(picto));
PieMenu.addMenuEntry(new UnlockPictoMenu(picto));
PieMenu.addMenuEntry(new DisablePictoMenu(picto));
PieMenu.addMenuEntry(new SetInvisibleMenu(picto));
//PieMenu.addMenuEntry(new EditMenu(picto));
ll.addView(PieMenu);
try {
detail.setImageBitmap(picto.get_bitmap(PCBcontext.getContext()));
detail.setBackgroundColor(picto.get_color());
detail.setX(centerX+10);
detail.setY(centerY - (picto.get_bitmap(PCBcontext.getContext()).getHeight()));
} catch (IOException e) {
e.printStackTrace();
}
ll.addView(detail);
}
/** Menu of picto classes */
//Close menu button
public class Close implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public Close(Picto picto){
p = picto;
}
public String getName() { return "Close"; }
public String getLabel() { return null; }
public int getIcon() { return android.R.drawable.ic_menu_close_clear_cancel; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
//Metodo para realizar acciones si se pulsa
public void menuActiviated()
{
ll.setVisibility(View.GONE);
((RelativeLayout)PieMenu.getParent()).removeView(PieMenu);
}
public void menuDisabled(){}
}
//Disable menu button
public class DisablePictoMenu implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public DisablePictoMenu(Picto picto){
p = picto;
}
public String getName() { return "disable"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.disabled_picto; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
p.alter_status("disabled");
activity.getCurrentPictoGridAdapter().notifyDataSetChanged();
ll.setVisibility(View.GONE);
((RelativeLayout)PieMenu.getParent()).removeView(PieMenu);
}
public void menuDisabled(){}
}
//Change image of picto menu button
public class SetInvisibleMenu implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public SetInvisibleMenu(Picto picto){
p = picto;
}
public String getName() { return "invisible"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.eye_blocked; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
p.alter_status("invisible");
activity.getCurrentPictoGridAdapter().notifyDataSetChanged();
ll.setVisibility(View.GONE);
((RelativeLayout)PieMenu.getParent()).removeView(PieMenu);
}
public void menuDisabled(){}
}
//Activate/enable picto on vocabulary menu button
public class UnlockPictoMenu implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public UnlockPictoMenu(Picto picto){
p = picto;
}
public String getName() { return "enable"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.unlock; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
p.alter_status("enabled");
activity.getCurrentPictoGridAdapter().notifyDataSetChanged();
ll.setVisibility(View.GONE);
((RelativeLayout)PieMenu.getParent()).removeView(PieMenu);
}
public void menuDisabled(){}
}
//Edit menu button
public class EditMenu implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public EditMenu(Picto picto){
p = picto;
}
public String getName() { return "edit"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.edit; }
private List<RadialMenuWidget.RadialMenuEntry> children;
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return children; }
public void menuActiviated()
{
ll.getChildAt(1).setX(ll.getChildAt(1).getX() + 30);
children = new ArrayList<>(Arrays.asList(new EditTextPicto(p),new EditImage(p)));
}
public void menuDisabled(){
ll.getChildAt(1).setX(ll.getChildAt(1).getX() - 30);
}
}
//Edit legend text of picto button
public class EditTextPicto implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public EditTextPicto(Picto picto){
p = picto;
}
public String getName() { return "editText"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.edit_text; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout();
createViewForExpression(p);
}
public void menuDisabled(){}
}
public class EditImage implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public EditImage(Picto picto){
p = picto;
}
public String getName() { return "editImage"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.edit_picture; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
/**TODO: Llamar a la interfaz de editar foto*/
Toast.makeText(PCBcontext.getContext(),"Editar Imagen", Toast.LENGTH_SHORT).show();
}
public void menuDisabled(){}
}
}
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
......@@ -11,19 +8,13 @@ import android.content.ClipDescription;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.MediaStore;
import android.speech.tts.UtteranceProgressListener;
import android.support.v4.content.ContextCompat;
import android.text.InputType;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.DragEvent;
......@@ -38,26 +29,20 @@ import android.view.WindowManager;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.yottacode.pictogram.action.PictosAction;
import com.yottacode.pictogram.action.TalkAction;
import com.yottacode.pictogram.action.VocabularyAction;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.grammar.iLocalPicto;
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.VocabularyTalk;
import com.yottacode.pictogram.tabletlibrary.R;
......@@ -71,7 +56,6 @@ import com.yottacode.pictogram.tts.TTSHelper;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
......@@ -80,13 +64,9 @@ import java.util.Locale;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import static android.graphics.Color.BLACK;
import static android.graphics.Color.argb;
import static android.graphics.Color.rgb;
public class PictogramActivity extends Activity implements VocabularyTalk.iVocabularyListener {
float firstTouchX = -1;
// Main layout for this activity
RelativeLayout mainLayout;
// Adapter for de grid showing the categories grid (and main pictos)
......@@ -107,8 +87,6 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
TTSHelper tts;
// Element used for loading new pictos (while changing categories)
Vocabulary vocabulary;
// TODO describe this variable
static final int SELECT_PICTURE = 1;
// For disabling volume button (See method at the end of the class)
private final List blockedKeys = new ArrayList(Arrays.asList(KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_VOLUME_UP));
// String constant for logs
......@@ -129,14 +107,11 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
Picto prev_picto = null;
private boolean feedback_read;
private boolean feedback_highlight;
private boolean deleting;
protected boolean deleting;
//Variables used on the picto menu (only supervisors)
private RadialMenuWidget PieMenu;
private ImageView detail;
private RelativeLayout ll;
private boolean tape_delivered=false;
protected boolean tape_delivered=false;
float firstTouchX = -1;
@TargetApi(Build.VERSION_CODES.M)
@Override
......@@ -237,7 +212,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (!deleting) {
Log.i(PictogramActivity.class.getCanonicalName(), " Deleting item " + position + "-" + id + "(" + PictogramActivity.this.tapeAdapter.getItem(position).get_translation() + ")");
animateImageView(view, position);
new PictoAnimation().animateImageView(PictogramActivity.this,view, position);
PictogramActivity.this.tapeAdapter.notifyDataSetChanged();
PCBcontext.getActionLog().log(new TalkAction(TalkAction.DELETE, PictogramActivity.this.tapeAdapter.getItem(position)));
}
......@@ -374,13 +349,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
}
private void finishSpeech() {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (tapeAdapter.play())
tapeAdapter.endPlay();
}
});
}
});
}
......@@ -475,15 +444,13 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
*/
private void hidePictoMainGridView() {
if (!tape_delivered) {
this.pictoCategoryGridAdapter.clear();
this.pictoCategoryGridAdapter.addAll(this.sort(this.vocabulary.next(this.currentCategory)));
this.pictoCategoryGridAdapter.notifyDataSetChanged();
if (this.currentCategory.get_color() != -1) {
if (this.currentCategory.get_color() != -1)
this.pictoCategoryGridView.setBackgroundColor(this.currentCategory.get_color());
}
}
this.pictoMainGridView.setEnabled(false);
this.pictoCategoryGridView.setEnabled(true);
......@@ -495,7 +462,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
/**
* Returns pictoCategoryGridAdapter or pictoMainGridAdapter depending on the current View
*/
private PictoGridAdapter getCurrentPictoGridAdapter() {
protected PictoGridAdapter getCurrentPictoGridAdapter() {
return (currentCategory == null) ? this.pictoMainGridAdapter : this.pictoCategoryGridAdapter;
}
......@@ -773,7 +740,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Picto p = getCurrentPictoGridAdapter().getItem(position);
Log.e("clicklistener",p+(p==null ? "NULL" : p.toString()+" "+p.get_row()));
if (p != null && p.get_id() != 0 && !p.is_invisible() && p.is_enabled()) {
p.set_mirror(false, false);
......@@ -787,10 +754,7 @@ Log.e("clicklistener",p+(p==null ? "NULL" : p.toString()+" "+p.get_row()));
addPictoWord(p);
}
}
if (tape_delivered) {
tapeAdapter.clear();
showOnlyTape(false);
}
}
}
......@@ -853,19 +817,13 @@ Log.e("clicklistener",p+(p==null ? "NULL" : p.toString()+" "+p.get_row()));
if (currentCategory != null || !PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
Log.d(LOG_TAG, "No tengo pictograma. Abro carrete...");
addPicto(position % maxColumns, (int) (position / maxColumns));
new PictoMenu(PictogramActivity.this).addPicto(position % maxColumns, (int) (position / maxColumns));
} else
Toast.makeText(PictogramActivity.this, PictogramActivity.this.getResources().getString(R.string.notNewCats), Toast.LENGTH_SHORT).show();
} else {
//Si es supervisor hacer aparecer el menú de opciones del picto
View pictoSquare = getCurrentPictoGridAdapter().getView(position,view,parent);
if(pictoSquare.getWidth() == 100){ //Si esta en formato de pictos normal
createMenuForPicto(0,p);
}else{
createMenuForPicto(1,p);
}
//p.alter_status();
new PictoMenu(PictogramActivity.this).createMenuForPicto(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big(),p);
getCurrentPictoGridAdapter().notifyDataSetChanged();
}
} else {
......@@ -906,27 +864,51 @@ Log.e("clicklistener",p+(p==null ? "NULL" : p.toString()+" "+p.get_row()));
if (lp.size()>0 && !PictogramActivity.this.tapeAdapter.play()) {
PCBcontext.getActionLog().log(new PictosAction(lp));
tapeAdapter.ttsAllNew(tts);
new PictoAnimation().animateTapeView(0,(ViewGroup)arg0.getParent());
if (!PCBcontext.getPcbdb().getCurrentUser().delete_tape_after_delivery()) {
showOnlyTape(true);
animateTapeView(0,(ViewGroup)arg0.getParent());
}
}
}
}
private void showOnlyTape(boolean onlyTape) { Log.e("EEEE","e"+onlyTape);
protected void showOnlyTape(boolean onlyTape) {
this.tape_delivered=onlyTape;
if (onlyTape) {
hidePictoMainGridView();
this.pictoCategoryGridAdapter.clear();
this.pictoCategoryGridAdapter.addAll(this.sort(null));
this.pictoCategoryGridAdapter.notifyDataSetChanged();
this.pictoCategoryGridView.setBackgroundColor(Color.GRAY);
this.showPictoCategoriesViewButton.setVisibility(View.GONE);
ttsButton.setEnabled(false);
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.showPictoCategoriesViewButton.setVisibility(View.INVISIBLE);
this.pictoCategoryGridView.setVisibility(View.INVISIBLE);
this.pictoMainGridView.setAlpha(0.25f);
this.pictoMainGridView.setEnabled(false);
}
else {
this.pictoCategoryGridView.setAlpha(0.25f);
this.pictoCategoryGridView.setEnabled(false);
this.showPictoCategoriesViewButton.setAlpha(0f);
}
new PictoAnimation().animateTapeViewVertical(this,false);
}
else {
ttsButton.setEnabled(true);
new PictoAnimation().animateTapeViewVertical(this,true);
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.showPictoCategoriesViewButton.setVisibility(View.VISIBLE);
showPictoMainGridView();
this.pictoCategoryGridView.setVisibility(View.VISIBLE);
this.pictoMainGridView.setAlpha(1f);
this.pictoMainGridView.setEnabled(true);
this.showPictoCategoriesViewButton.setAlpha(1f);
}
else {
this.pictoCategoryGridView.setAlpha(1f);
this.pictoCategoryGridView.setEnabled(true);
this.showPictoCategoriesViewButton.setAlpha(1f);
}
}
}
......@@ -1026,147 +1008,18 @@ private void showOnlyTape(boolean onlyTape) { Log.e("EEEE","e"+onlyTape);
}
}
/* *********************************************************************************************
* Methods for adding a new picto from pcb
* ********************************************************************************************/
/**
* add a local picto from pcb
*
* @param row
* @param col
*/
public void addPicto(int row, int col) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
this.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row);
this.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col);
} else {
this.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_ROW, row);
this.getIntent().putExtra(Picto.JSON_ATTTRS.FREE_COLUMN, col);
}
startActivityForResult(intent, SELECT_PICTURE);
}
/**
* 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) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getResources().getString(R.string.enterImgLabel));
// Set up the input
final EditText input = new EditText(this);
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 = PictogramActivity.this.currentCategory != null
? PictogramActivity.this.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) {
PictogramActivity.this.refresh();
try {
if (PCBcontext.is_user_online())
new PictoUploader(localPicto).upload(PictogramActivity.this);
} catch (IOException e) {
Log.e(Vocabulary.class.getCanonicalName(), e.getMessage());
}
}
});
}
});
builder.show();
}
/**
* Función para la selección de una foto del carrete
*
* @param requestCode
* @param resultCode
* @param data
*/
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
if (requestCode == SELECT_PICTURE) {
String selectedImagePath;
Uri selectedImageUri = data.getData();
selectedImagePath = getPath(selectedImageUri);
int row = this.getIntent().getIntExtra(Picto.JSON_ATTTRS.ROW, -1);
int col = this.getIntent().getIntExtra(Picto.JSON_ATTTRS.COLUMN, -1);
int freeRow = this.getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_ROW, -1);
int freeColumn = this.getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_COLUMN, -1);
Log.i(this.getClass().getCanonicalName(), "0 Picto x y " + " " + row + " " + col);
this.getIntent().removeExtra(Picto.JSON_ATTTRS.ROW);
this.getIntent().removeExtra(Picto.JSON_ATTTRS.COLUMN);
this.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_ROW);
this.getIntent().removeExtra(Picto.JSON_ATTTRS.FREE_COLUMN);
chooseTextAndSavePicto(selectedImagePath, row, col, freeRow, freeColumn);
}
}
}
/**
* Función para la selección de una foto del carrete
*
* @param uri
* @return
*/
static public String getPath(Uri uri) {
if (uri == null) {
return null;
}
// this will only work for images selected from gallery
String[] projection = {MediaStore.Images.Media.DATA};
Cursor cursor = PCBcontext.getContext().getContentResolver().query(uri, projection, null, null, null);
if (cursor != null) {
int column_index = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
return uri.getPath();
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
int in=0,out=0;
Intent nextActivity=null;
Intent intent =getIntent();
Intent intent = getIntent();
boolean student_view=intent.getBooleanExtra("student_view",false);
if (PCBcontext.getPcbdb()!=null && (PCBcontext.getPcbdb().getCurrentUser().is_supervisor() || student_view)) {
if (PCBcontext.getPcbdb()!=null && (PCBcontext.getPcbdb().getCurrentUser().is_supervisor() || student_view) ) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
firstTouchX = event.getX();
break;
case MotionEvent.ACTION_UP:
if (event.getX() > firstTouchX + 100) { //izquierda a derecha
if (!student_view) {
PCBcontext.getPcbdb().getCurrentUser().get_Img_sup().update_id(User.NO_SUPERVISOR);
......@@ -1189,6 +1042,7 @@ private void showOnlyTape(boolean onlyTape) { Log.e("EEEE","e"+onlyTape);
out = R.anim.leftout;
}
if (nextActivity != null) {
tape_delivered=false;
intent.putExtra("student_view", !PCBcontext.getPcbdb().getCurrentUser().is_supervisor());
finish();
startActivity(nextActivity);
......@@ -1201,413 +1055,4 @@ private void showOnlyTape(boolean onlyTape) { Log.e("EEEE","e"+onlyTape);
return super.dispatchTouchEvent(event);
}
public void animateImageView(View view, final int position) {
if (PictogramActivity.this.deleting) return;
View borderlayout=((RelativeLayout)view).getChildAt(0);
final ImageView v=((ImageView)((FrameLayout)borderlayout).getChildAt(0));
final int orange = ContextCompat.getColor(PCBcontext.getContext(),R.color.red);
final ValueAnimator colorAnim = ObjectAnimator.ofFloat(0f, 1f);
colorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float mul = (Float) animation.getAnimatedValue();
int alphaOrange = adjustAlpha(orange, mul);
v.setColorFilter(alphaOrange, PorterDuff.Mode.SRC_ATOP);
v.setBackgroundColor(alphaOrange);
v.setPadding(0,0,0,0);
if (mul == 0.0) {
v.setColorFilter(0);
}
}
});
colorAnim.addListener(new ValueAnimator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
PictogramActivity.this.deleting=true;
}
@Override
public void onAnimationEnd(Animator animation) {
Log.i(this.getClass().getCanonicalName(),"DELETING "+position);
tapeAdapter.deleteItem(position);
tapeAdapter.notifyDataSetChanged();
v.setColorFilter(0);
v.setBackgroundColor(ContextCompat.getColor(PCBcontext.getContext(),R.color.picto_default_background));
PictogramActivity.this.deleting=false;
if (tapeAdapter.getCount()==0) {
showOnlyTape(false);
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
colorAnim.setDuration(750);
colorAnim.start();
}
public void animateTapeView(final int position, final ViewGroup view) {
GridView gridview = (GridView)view.getChildAt(1);
RelativeLayout relativeLayout=(RelativeLayout)(gridview.getChildAt(position));
FrameLayout layout=(FrameLayout)(relativeLayout.getChildAt(0));
final ImageView v=(ImageView)(layout.getChildAt(0));
final int orange = ContextCompat.getColor(PCBcontext.getContext(), R.color.red);
final ValueAnimator colorAnim = ObjectAnimator.ofFloat(0f, 1f, 0f);
colorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float mul = (Float) animation.getAnimatedValue();
int alphaOrange = adjustAlpha(orange, mul);
v.setColorFilter(alphaOrange, PorterDuff.Mode.SRC_ATOP);
v.setBackgroundColor(alphaOrange);
v.setPadding(0, 0, 0, 0);
if (mul == 0.0) {
v.setColorFilter(0);
}
}
});
colorAnim.addListener(new ValueAnimator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
v.setColorFilter(0);
v.setBackgroundColor(ContextCompat.getColor(PCBcontext.getContext(), R.color.picto_default_background));
if (position <(tapeAdapter.getCount()-1)) animateTapeView(position + 1, view);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
colorAnim.setDuration(tapeAdapter.getItem(position).get_translation().length()*100);
colorAnim.start();
}
public static int adjustAlpha(int color, float factor) {
int alpha = Math.round(Color.alpha(color) * factor);
int red = Color.red(color);
int green = Color.green(color);
int blue = Color.blue(color);
return argb(alpha, red, green, blue);
}
/**Function for open a new View for change the expression of a picto
*
* @param picto
*/
public void createViewForExpression(final Picto picto){
ll = new RelativeLayout(PCBcontext.getContext());
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
addContentView(ll, params);
ll.setBackgroundColor(argb(180,0,0,0));
ll.setClickable(false);
//Parameters for hide navigation bar when u save or cancel
final View decorView = getWindow().getDecorView();
final int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
/*| View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE*/;
final EditText leyenda = new EditText(PCBcontext.getContext());
leyenda.setBackgroundColor(rgb(221, 221, 211));
leyenda.setWidth(400);
leyenda.setMaxLines(1);
leyenda.setClickable(true);
leyenda.setTextSize(25);
leyenda.setX(PictogramActivity.this.getResources().getDisplayMetrics().widthPixels/2 - 300);
leyenda.setY(PictogramActivity.this.getResources().getDisplayMetrics().heightPixels/2 - 50);
leyenda.setTextColor(BLACK);
if(picto.get_translation()!= null && picto != null){
leyenda.setText(picto.get_translation());
}else{
leyenda.setText("Sin Descripción");
}
//Mostrar teclado automaticamente
final InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
ImageButton botonOk = new ImageButton(PCBcontext.getContext());
botonOk.setImageResource(android.R.drawable.ic_menu_save);
botonOk.setX(PictogramActivity.this.getResources().getDisplayMetrics().widthPixels/2 + 110);
botonOk.setY(PictogramActivity.this.getResources().getDisplayMetrics().heightPixels/2 - 50);
botonOk.setBackgroundColor(rgb(221,221,221));
botonOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
picto.set_translation(leyenda.getText().toString());
imm.hideSoftInputFromWindow(leyenda.getWindowToken(), 0);
picto.set_local_status(true);
if (!picto.is_local()) {
new PictoUploader(picto).uploadState();
PCBcontext.getActionLog().log(new VocabularyAction(VocabularyAction.ALTERATTRS, picto));
}
getCurrentPictoGridAdapter().notifyDataSetChanged();
ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout();
//Hide navigation bar
//PictogramActivity.this.refresh();
decorView.setSystemUiVisibility(uiOptions);
}
});
ImageButton botonSalir = new ImageButton(PCBcontext.getContext());
botonSalir.setImageResource(android.R.drawable.ic_menu_close_clear_cancel);
botonSalir.setX(PictogramActivity.this.getResources().getDisplayMetrics().widthPixels/2 + 150);
botonSalir.setY(PictogramActivity.this.getResources().getDisplayMetrics().heightPixels/2 - 50);
botonSalir.setBackgroundColor(rgb(221,221,221));
botonSalir.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imm.hideSoftInputFromWindow(leyenda.getWindowToken(), 0);
ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout();
//Hide navigation bar
//PictogramActivity.this.refresh();
decorView.setSystemUiVisibility(uiOptions);
}
});
ll.addView(leyenda);
ll.addView(botonOk);
ll.addView(botonSalir);
leyenda.requestFocus();
imm.showSoftInput(leyenda, InputMethodManager.SHOW_FORCED);
}
/**Function for build a radial menu
*
* @param tamPicto
* @param picto
*/
private void createMenuForPicto(int tamPicto, Picto picto){
ll = new RelativeLayout(PCBcontext.getContext());
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
addContentView(ll, params);
ll.setBackgroundColor(argb(180,0,0,0));
detail = new ImageView(PCBcontext.getContext());
int centerX = PictogramActivity.this.getResources().getDisplayMetrics().widthPixels/2;
int centerY = PictogramActivity.this.getResources().getDisplayMetrics().heightPixels/2;
if(tamPicto==0){
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
PieMenu.setCenterCircle(new Close(picto));
PieMenu.addMenuEntry(new UnlockPictoMenu(picto));
PieMenu.addMenuEntry(new DisablePictoMenu(picto));
PieMenu.addMenuEntry(new SetInvisibleMenu(picto));
//PieMenu.addMenuEntry(new EditMenu(picto));
ll.addView(PieMenu);
try {
detail.setImageBitmap(picto.get_bitmap(PCBcontext.getContext()));
detail.setBackgroundColor(picto.get_color());
detail.setX(centerX+10);
detail.setY(centerY - (picto.get_bitmap(PCBcontext.getContext()).getHeight()));
} catch (IOException e) {
e.printStackTrace();
}
ll.addView(detail);
}
/** Menu of picto classes */
//Close menu button
public class Close implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public Close(Picto picto){
this.p = picto;
}
public String getName() { return "Close"; }
public String getLabel() { return null; }
public int getIcon() { return android.R.drawable.ic_menu_close_clear_cancel; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
//Metodo para realizar acciones si se pulsa
public void menuActiviated()
{
ll.setVisibility(View.GONE);
((RelativeLayout)PieMenu.getParent()).removeView(PieMenu);
}
public void menuDisabled(){}
}
//Disable menu button
public class DisablePictoMenu implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public DisablePictoMenu(Picto picto){
this.p = picto;
}
public String getName() { return "disable"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.disabled_picto; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
p.alter_status("disabled");
getCurrentPictoGridAdapter().notifyDataSetChanged();
ll.setVisibility(View.GONE);
((RelativeLayout)PieMenu.getParent()).removeView(PieMenu);
}
public void menuDisabled(){}
}
//Change image of picto menu button
public class SetInvisibleMenu implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public SetInvisibleMenu(Picto picto){
this.p = picto;
}
public String getName() { return "invisible"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.eye_blocked; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
p.alter_status("invisible");
getCurrentPictoGridAdapter().notifyDataSetChanged();
ll.setVisibility(View.GONE);
((RelativeLayout)PieMenu.getParent()).removeView(PieMenu);
}
public void menuDisabled(){}
}
//Activate/enable picto on vocabulary menu button
public class UnlockPictoMenu implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public UnlockPictoMenu(Picto picto){
this.p = picto;
}
public String getName() { return "enable"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.unlock; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
p.alter_status("enabled");
getCurrentPictoGridAdapter().notifyDataSetChanged();
ll.setVisibility(View.GONE);
((RelativeLayout)PieMenu.getParent()).removeView(PieMenu);
}
public void menuDisabled(){}
}
//Edit menu button
public class EditMenu implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public EditMenu(Picto picto){
this.p = picto;
}
public String getName() { return "edit"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.edit; }
private List<RadialMenuWidget.RadialMenuEntry> children;
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return children; }
public void menuActiviated()
{
ll.getChildAt(1).setX(ll.getChildAt(1).getX() + 30);
children = new ArrayList<>(Arrays.asList(new EditTextPicto(p),new EditImage(p)));
}
public void menuDisabled(){
ll.getChildAt(1).setX(ll.getChildAt(1).getX() - 30);
}
}
//Edit legend text of picto button
public class EditTextPicto implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public EditTextPicto(Picto picto){
this.p = picto;
}
public String getName() { return "editText"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.edit_text; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
ll.setVisibility(View.GONE);
ll.removeAllViewsInLayout();
createViewForExpression(this.p);
}
public void menuDisabled(){}
}
public class EditImage implements RadialMenuWidget.RadialMenuEntry
{
Picto p;
public EditImage(Picto picto){
this.p = picto;
}
public String getName() { return "editImage"; }
public String getLabel() { return null; }
public int getIcon() { return R.drawable.edit_picture; }
public List<RadialMenuWidget.RadialMenuEntry> getChildren() { return null; }
public void menuActiviated()
{
/**TODO: Llamar a la interfaz de editar foto*/
Toast.makeText(PCBcontext.getContext(),"Editar Imagen", Toast.LENGTH_SHORT).show();
}
public void menuDisabled(){}
}
}
......@@ -72,6 +72,7 @@ public class TapeAdapter extends BaseAdapter {
}
public void clear() {
pictoLinkedList.clear();
notifyDataSetChanged();
}
// DEVUELVE TODOS LOS ELEMENTOS
......
......@@ -21,8 +21,6 @@ import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.dao.UserLogin;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.gui.login.CustomListLogin;
import com.yottacode.pictogram.tabletlibrary.gui.login.LoginActivity;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.PCBcontext;
......
......@@ -82,7 +82,7 @@ public class ListInstructionsFragment extends Fragment{
GUITools.show_alert(ListInstructionsFragment.this.getContext(), R.string.session_empty, getString(R.string.server), new GUITools.iOKListener() {
@Override
public void ok() {
ListInstructionsFragment.this.getActivity().finish();
close();
}
});
}
......@@ -114,12 +114,13 @@ public class ListInstructionsFragment extends Fragment{
instructionPosition=-1;
return view;
}
private void checkStudent() {
SessionWrapper.validateStudent(new SessionWrapper.iValidateStudent() {
void close() {
ListInstructionsFragment.this.getActivity().finish();
startActivity(new Intent(getActivity(), PictogramActivity.class));
}
private void checkStudent() {
SessionWrapper.validateStudent(new SessionWrapper.iValidateStudent() {
@Override
public void validLicense(boolean valid_license, String sexpiration) {
if (!valid_license) {
......
......@@ -73,14 +73,6 @@
<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/shaders" isTestSource="false" />
<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/jni" 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/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" />
......@@ -89,61 +81,80 @@
<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/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/jni" 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/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/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-core-ui/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-media-compat/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/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<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/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" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-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="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
<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="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="okhttp-2.3.0" level="project" />
<orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="engine.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" 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" />
</component>
</module>
\ No newline at end of file
......@@ -123,59 +123,53 @@
<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/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-tasks/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.support/wearable/2.0.0-alpha2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<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" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="wearable-2.0.0-alpha2" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-wearable-9.2.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-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="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<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="socket.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.3.0" level="project" />
<orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="engine.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" 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" />
</component>
</module>
\ No newline at end of file
......@@ -8,12 +8,12 @@
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="DevFlavorDebug" />
<option name="SELECTED_BUILD_VARIANT" value="PreFlavorDebug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDevFlavorDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDevFlavorDebugSources" />
<option name="ASSEMBLE_TASK_NAME" value="assemblePreFlavorDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compilePreFlavorDebugSources" />
<afterSyncTasks>
<task>generateDevFlavorDebugSources</task>
<task>generatePreFlavorDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
......@@ -24,64 +24,64 @@
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/DevFlavor/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/DevFlavor/debug" />
<output url="file://$MODULE_DIR$/build/intermediates/classes/PreFlavor/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/PreFlavor/debug" />
<exclude-output />
<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/aidl/DevFlavor/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/rs/DevFlavor/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/res/rs/DevFlavor/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/DevFlavor/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavorDebug/java" 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/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/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/rs/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug" type="java-test-resource" />
<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/DevFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DevFlavor/jni" isTestSource="false" />
<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/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDevFlavor/java" 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/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/jni" 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$/build/generated/source/r/PreFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/PreFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/PreFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/PreFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/PreFlavor/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/PreFlavor/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/PreFlavor/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavorDebug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavorDebug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavorDebug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavorDebug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavorDebug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/PreFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/PreFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/PreFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/PreFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/PreFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/PreFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/PreFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavorDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavorDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavorDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavor/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavor/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavor/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavor/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/PreFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestPreFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestPreFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestPreFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestPreFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestPreFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestPreFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestPreFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestPreFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testPreFlavor/shaders" isTestSource="true" />
<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/assets" type="java-resource" />
......@@ -126,6 +126,15 @@
<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" />
<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/support-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-media-compat/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/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
......@@ -141,43 +150,42 @@
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-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="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
<orderEntry type="module" module-name="commonlibrary" 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="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="okhttp-2.3.0" level="project" />
<orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.3.0" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="engine.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" 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" />
</component>
</module>
\ No newline at end of file
#!/bin/bash
#
# This script backups actual sails server (code and database), pulls new MASTER version and relaunches server
# by amontejo - 23.01.2017
#
TIMESTAMP=`date +"%Y%m%d"`
tar zcf /home/ubuntu/backup/${TIMESTAMP}-sails_src.tgz /home/ubuntu/pictogram/sails/src
mysqldump -u root -p'r00...Tt' pictodb |gzip > /ho:::me/ubuntu/backup/${TIMESTAMP}-mysql.sql.gz
git pull
sudo forever stopall
(cd src; sudo forever start app.js)
......@@ -95,6 +95,8 @@ CREATE TABLE IF NOT EXISTS `instruction` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="An instruction is a 'phase' in a method for learning AAC";
-- CREATE INDEX ix_instruction_begin ON instruction (`begin`);
-- --------------------------------------------------------
......@@ -396,6 +398,7 @@ CREATE TABLE IF NOT EXISTS `try` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="This table contains tries information (they belong to a working session)";
-- CREATE INDEX ix_try_begin ON try (`begin`);
-- --------------------------------------------------------
--
......@@ -427,6 +430,7 @@ CREATE TABLE IF NOT EXISTS `working_session` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="This table stores working session information. Every working session is related to one instruction and one supervisor (and the instruction is related to one method which is related to one student)";
-- CREATE INDEX ix_ws_begin ON working_session (`begin`);
--
-- Restricciones para tablas volcadas
--
......
......@@ -430,6 +430,7 @@ module.exports = {
function (instruction, next_ins) {
Instruction.findOne(instruction.id)
.sort('begin DESC')
.populate('workingSessions')
.then((populated_ins) => {
if (!populated_ins || !populated_ins.workingSessions || populated_ins.workingSessions.length == 0)
......@@ -441,6 +442,7 @@ module.exports = {
function(ws, next_ws) {
WorkingSession.findOne(ws.id)
.sort('begin DESC')
.populate('tries')
.then((populated_ws) => {
if (!populated_ws || !populated_ws.tries || populated_ws.tries.length == 0)
......@@ -452,6 +454,7 @@ module.exports = {
function(t, next_t) {
Try.findOne(t.id)
.sort('begin DESC')
.populate('actions')
.then((populated_try) => {
if (!populated_try || !populated_try.actions || populated_try.actions.length == 0)
......
......@@ -80,7 +80,9 @@ module.exports = {
})
},
afterCreate: function (attrs, next) {
// stu_opentry table is updated when a new try is inserted in try table
// (which is, itself, fired by a new session insertion)
// see triggers-sessions-integrity-constraints.sql
StuOpenTry.findOne({id_ws: attrs.id}).exec(function(err, stuopentry) {
if (err || !stuopentry)
throw new Error("No try found at"+attrs.id+"("+err+")");
......
......@@ -188,7 +188,7 @@
"no": "No",
"no_method": "Método sin definir",
"no_instruction": "Instrucción sin definir",
"no_students_for_user": "Su cuenta no está asociada a ningún estudiante. Por favor, contacto con su gabinete para enlazar su cuenta a un estudiante.",
"no_students_for_user": "Su cuenta no está asociada a ningún estudiante. Por favor, contacte con su gabinete para enlazar su cuenta a un estudiante.",
"no_space_in_category": "No queda espacio en la categoría",
"no_subscribed": "Sin conexión a la cuenta del estudiante",
"nobegin": "Sin iniciar",
......
......@@ -32,7 +32,12 @@
</a>
</div>
<div class="col-md-2" style="text-align: right">
<button ng-click="showSessions = !showSessions" class="btn btn-success btn-sm" style="font-size: 10pt">{{ 'sessions' | translate}} <span class="badge" style="font-size: 10pt">{{wsessions.length}}</span> <span class="glyphicon glyphicon-menu-down" ng-show="!showSessions"></span></button>
<button ng-click="showSessions = !showSessions" class="btn btn-success btn-sm" style="font-size: 10pt">
<i class="fa fa-caret-down" aria-hidden="true" ng-show="!showSessions"></i>
<i class="fa fa-caret-up" aria-hidden="true" ng-show="showSessions"></i>
<span translate> sessions </span>
<span class="badge" style="font-size: 10pt"> {{wsessions.length} }</span>
</button>
</div>
</p>
</div>
......
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