Commit 1e1e63f3 by Arturo Montejo Ráez

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

parents 6c8dadf0 395dd167
Showing with 95 additions and 63 deletions
......@@ -80,12 +80,16 @@ public class Vocabulary implements Iterable<Picto> {
}
break;
}
case update_category:{
Log.i(this.getClass().getCanonicalName(), "Picto category update "+args.toString());
Vocabulary.this.synchronize();
}
case add:{
try{
String text= args.getJSONObject("expression").getString("text");
String uri=args.getJSONObject("picto").getString("uri");
JSONObject attrs_picto = args.getJSONObject("attributes");
String text= attrs_picto.getString("expression");
addPicto(new Picto(picto_id, uri, text, attrs_picto),ImgDownloader.tsource.remote);
......@@ -177,8 +181,8 @@ public class Vocabulary implements Iterable<Picto> {
for (int i=0; i < result.length(); i++) {
ojpicto=result.getJSONObject(i);
picto = ojpicto.getJSONObject(jpicto);
expression = ojpicto.getString(jexpression);
attributes = ojpicto.getJSONObject(jattributes);
expression = attributes.getString(jexpression);
pictos[i] = new Picto(picto.getInt(jid),
picto.getString(juri),
expression,
......
......@@ -35,6 +35,7 @@ public class VocabularyTalk implements Emitter.Listener {
final String param_picto_id="id";
final String param_picto_cat="id_cat";
final String action_update="update";
final String action_update_category="update_category";
final String action_add="add";
final String action_delete="delete";
......@@ -53,6 +54,7 @@ public class VocabularyTalk implements Emitter.Listener {
"' for picto " + picto_id + " (cat " + picto_cat + ", picto: " + picto_stupicto);
for (iVocabularyListener listener: this.listeners)
listener.change(action.equals(action_update) ? iVocabularyListener.action.update
: action.equals(action_update_category) ? iVocabularyListener.action.update_category
: action.equals(action_add) ? iVocabularyListener.action.add
: iVocabularyListener.action.delete
, picto_cat, picto_id, stu_picto);
......@@ -69,7 +71,7 @@ public class VocabularyTalk implements Emitter.Listener {
* @version 1.0
*/
public static interface iVocabularyListener {
public enum action {delete,add,update}
public enum action {delete,add, update_category, update}
public void change(action action, int picto_cat, int picto_id, JSONObject args);
}
}
......@@ -26,7 +26,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.SplashScreenActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.SplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
......@@ -36,7 +36,7 @@
</intent-filter>
</activity>
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.MainActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" />
<activity
......@@ -44,12 +44,12 @@
android:label="@string/title_activity_serial"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.LoginActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.LoginActivity"
android:exported="true"
android:label="@string/title_activity_login_activity_fragments"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
......
......@@ -3,7 +3,7 @@ package com.yottacode.pictogram.supervisor_tablet.gui;
import android.app.Activity;
import com.yottacode.pictogram.supervisor_tablet.R;
import com.yottacode.pictogram.tabletlibrary.gui.SerialActivity;
import com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity;
import com.yottacode.tools.GUITools;
/**
......
......@@ -8,7 +8,7 @@ android {
targetSdkVersion 22
versionCode 1
versionName "1.0"
resValue "string", "SerialClass", "com.yottacode.pictogram.tabletlibrary.gui.SerialActivity"
resValue "string", "SerialClass", "com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity"
resValue "integer", "rows", "5"
resValue "integer", "columns", "10"
resValue "integer", "rows_big", "4"
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import android.view.View;
import android.view.ViewGroup;
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import android.content.Context;
import android.graphics.Bitmap;
......@@ -180,21 +180,19 @@ public class PictoItemViewGenerator {
pictoImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_image);
redCrossImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_redcross);
}
layoutWrapper.setVisibility(View.GONE);
layoutWrapper.setBackground(null);
layoutWrapper.setAlpha(0.25f);
layoutWrapper.setAlpha(PCBcontext.getPcbdb().getCurrentUser().is_supervisor() ? 0.25f : 0);
layout.setBackgroundColor(convertView.getResources()
.getColor(R.color.picto_default_background));
redCrossImage.setVisibility(View.GONE);
pictoImage.setScaleX(1.0f);
pictoImage.setScaleY(1.0f);
pictoImage.setVisibility(View.GONE);
// pictoImage.setVisibility(View.GONE);
// layoutWrapper.setVisibility(View.GONE);
if (picto == null) {
pictoImage.setImageBitmap(null);
if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
layoutWrapper.setVisibility(View.VISIBLE);
layoutWrapper.setBackground(convertView.getResources()
.getDrawable(R.drawable.picto_grid_item_border));
}
} else {
if (!picto.is_invisible()) {
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import android.annotation.TargetApi;
......@@ -67,10 +67,13 @@ public class TapeAdapter extends BaseAdapter {
// ELIMINAR TODOS LOS ITEMS DEL ADAPTADOR
public void endPlay() {
if (PCBcontext.getPcbdb().getCurrentUser().delete_tape_after_delivery())
pictoLinkedList.clear();
clear();
play = false;
}
public void clear() {
pictoLinkedList.clear();
}
// DEVUELVE TODOS LOS ELEMENTOS
public LinkedList<Picto> getAll() {
return pictoLinkedList;
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.communicator;
import android.content.Context;
import android.util.Log;
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.login;
import android.app.Activity;
import android.graphics.Bitmap;
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.login;
import android.app.Activity;
import android.graphics.Bitmap;
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.login;
import android.annotation.TargetApi;
import android.content.Intent;
......@@ -15,6 +15,7 @@ import android.widget.TextView;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools;
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.login;
import android.app.Activity;
import android.content.Intent;
......@@ -10,6 +10,7 @@ import android.view.Window;
import android.view.WindowManager;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity;
import com.yottacode.pictogram.tools.PCBcontext;
public class MainActivity extends Activity {
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.login;
import android.app.Activity;
import android.content.Context;
......@@ -20,6 +20,9 @@ import android.widget.ListView;
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;
......
package com.yottacode.pictogram.tabletlibrary.gui;
package com.yottacode.pictogram.tabletlibrary.gui.login;
import android.app.Fragment;
import android.app.ProgressDialog;
......@@ -17,6 +17,7 @@ import com.yottacode.net.RestapiWrapper;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools;
......
......@@ -15,7 +15,7 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.net.SessionWrapper;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tools.PCBcontext;
......
......@@ -21,7 +21,7 @@ import android.widget.ToggleButton;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.net.SessionWrapper;
import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.GUITools;
......
......@@ -8,8 +8,8 @@ import android.util.Log;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.net.NetService;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.gui.SerialActivity;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity;
import com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity;
import com.yottacode.pictogram.tools.PCBcontext;
/**
......
......@@ -8,4 +8,3 @@
android:toXDelta="0"
android:interpolator="@android:anim/linear_interpolator" />
</set>
......@@ -3,7 +3,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.LoginActivity">
tools:context="com.yottacode.pictogram.tabletlibrary.gui.login.LoginActivity">
<RelativeLayout
android:layout_width="match_parent"
......@@ -82,7 +82,7 @@
<fragment
android:layout_width="wrap_content"
android:layout_height="wrap_content"
class="com.yottacode.pictogram.tabletlibrary.gui.StudentFragmentGrid"
class="com.yottacode.pictogram.tabletlibrary.gui.login.StudentFragmentGrid"
android:id="@+id/loginStudentGrid"
android:layout_gravity="center"
tools:layout="@layout/fragment_new_student" />
......
......@@ -6,7 +6,7 @@
android:background="#BDBDBD"
android:keepScreenOn="true"
android:id="@+id/pictogramLayout"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity"
android:padding="@dimen/small_padding">
<!-- android:keepScreenOn - To keep the screen bright as long as the app is visible (also forever) -->
......
......@@ -6,7 +6,7 @@
android:background="#BDBDBD"
android:keepScreenOn="true"
android:id="@+id/pictogramLayout"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity"
android:padding="@dimen/small_padding">
<!-- android:keepScreenOn - To keep the screen bright as long as the app is visible (also forever) -->
......
......@@ -5,7 +5,7 @@
android:paddingLeft="10dp"
android:paddingRight="15dp"
android:orientation="vertical"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.SplashScreenActivity" >
tools:context="com.yottacode.pictogram.tabletlibrary.gui.login.SplashScreenActivity" >
<ImageView
android:layout_width="400px"
......
......@@ -15,6 +15,7 @@
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
......@@ -25,7 +26,7 @@
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="PROJECT_TYPE" value="1" />
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
</facet>
</component>
......@@ -53,6 +54,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
......@@ -60,6 +62,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
......@@ -67,6 +70,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
......@@ -74,6 +78,7 @@
<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" />
......@@ -81,6 +86,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/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/annotations" />
......@@ -91,7 +97,6 @@
<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" />
......@@ -127,6 +132,7 @@
<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="socket.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.3.0" level="project" />
......
......@@ -18,7 +18,7 @@ android {
targetSdkVersion 22
versionCode 1
versionName "1.0"
resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.SerialActivity"
resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity"
// signingConfig signingConfigs.config
}
productFlavors {
......
......@@ -27,7 +27,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.SplashScreenActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.SplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
......@@ -37,20 +37,20 @@
</intent-filter>
</activity>
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.MainActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.SerialActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity"
android:label="@string/title_activity_serial"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.LoginActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.login.LoginActivity"
android:exported="true"
android:label="@string/title_activity_login_activity_fragments"
android:screenOrientation="landscape" />
<activity
android:name="com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity"
android:name="com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
......
......@@ -4,6 +4,8 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.yottacode.pictogram.tabletlibrary.gui.login.MainActivity;
/**
* Created by emblanco on 13/10/15.
*
......@@ -16,7 +18,7 @@ public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent myIntent = new Intent(context, com.yottacode.pictogram.tabletlibrary.gui.MainActivity.class);
Intent myIntent = new Intent(context, MainActivity.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(myIntent);
}
......
......@@ -88,7 +88,7 @@ public class KioskService extends Service {
private void restoreApp() {
// Restart activity
Intent i = new Intent(ctx, com.yottacode.pictogram.tabletlibrary.gui.SerialActivity.class);
Intent i = new Intent(ctx, com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ctx.startActivity(i);
}
......
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