working on PCB issues

parent 212b8d32
......@@ -23,15 +23,15 @@ import org.json.JSONObject;
public class Picto extends Img {
int cont = 0;
Bitmap bitmap;
boolean _disvanish=false;
boolean lighten=false;
// String constant for logs
private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName()
public void set_disvanish(boolean _disvanish) {
this._disvanish = _disvanish;
public void set_ligthen(boolean lighten) {
this.lighten = lighten;
}
public boolean disvanish() {
return _disvanish;
public boolean lighten() {
return lighten;
}
public final static class JSON_ATTTRS {
......
......@@ -43,13 +43,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/assets" type="java-test-resource" />
......@@ -58,6 +51,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/CIFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/CIFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/assets" type="java-resource" />
......@@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CIFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/assets" type="java-test-resource" />
......@@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestCIFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testCIFlavor/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" />
......
......@@ -4,6 +4,7 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LightingColorFilter;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.util.TypedValue;
......@@ -30,7 +31,7 @@ public class PictoItemViewGenerator {
public static final int LAYOUT = R.layout.picto_grid_item;
public static final int LAYOUT_BIG = R.layout.picto_grid_item_big;
public static int mirror_color=0;
public static double scale=1.0;
public static int lighten=1;
/**
*
......@@ -237,8 +238,16 @@ public class PictoItemViewGenerator {
if (picto.is_highlight_background()) layout.setBackgroundColor(color[mirror_color%color.length]);
}
scale = picto.disvanish() ? scale-0.1 : 1.0;
pictoImage.set
if (picto.lighten()) {
PictoItemViewGenerator.lighten++;
int light[]={0xE0,0xC8,0xAF,0x64,0x4B,32,16,0};
int lighten=light[(PictoItemViewGenerator.lighten>=light.length) ? 0 : PictoItemViewGenerator.lighten];
int color=lighten*0x10000+lighten*0x100+lighten;
LightingColorFilter lcf = new LightingColorFilter(color,0);
pictoImage.setColorFilter(lcf);
}
}
} catch (IOException e) {
e.printStackTrace();
......
......@@ -203,8 +203,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Log.i(this.getClass().getCanonicalName(), " Delete item " + position + "(" + PictogramActivity.this.tapeAdapter.getItem(position).get_translation() + ")");
PCBcontext.getActionLog().log(new TalkAction(TalkAction.DELETE, PictogramActivity.this.tapeAdapter.getItem(position)));
PictogramActivity.this.tapeAdapter.disvanishItem(position);
PictogramActivity.this.tapeAdapter.getItem(position).set_ligthen(true);
execDeletePicto(PictogramActivity.this.tapeAdapter,position);
Log.i(this.getClass().getCanonicalName(),"DELETE PICTO");
}
});
......@@ -766,19 +767,22 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
}
private void execDeletePicto(final TapeAdapter tapeAdapter, final int position) {
final ScheduledThreadPoolExecutor exec_delete = new ScheduledThreadPoolExecutor(1);
Log.e(this.getClass().getCanonicalName(),"deleting");
exec_delete.scheduleAtFixedRate(new Runnable() {
int repeating = 0;
@Override
public void run() {
tapeAdapter.notifyDataSetChanged();
if (repeating++ == 10) {
if (repeating++ == 4) {
Log.e(this.getClass().getCanonicalName(),"deleting "+repeating);
exec_delete.shutdown();
tapeAdapter.getItem(position).set_disvanish(false);
tapeAdapter.getItem(position).set_ligthen(false);
tapeAdapter.deleteItem(position);
tapeAdapter.notifyDataSetChanged();
Log.e(this.getClass().getCanonicalName(),"deleted ");
}
}
}, 0, 100, TimeUnit.MILLISECONDS);
}, 0, 500, TimeUnit.MILLISECONDS);
}
private void execHighligthFeeback(final Picto picto, boolean highlight_background) {
boolean same_picto = false;
......@@ -801,7 +805,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
int repeating = 0;
@Override
public void run() {
public void run() { Log.e(this.getClass().getCanonicalName(),"highdele "+repeating);
refresh();
if (repeating++ == 20) {
picto.set_mirror(false, false);
......@@ -811,7 +815,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
}
}
}
}, 0, 500, TimeUnit.MILLISECONDS);
}, 0, 250, TimeUnit.MILLISECONDS);
}
}
......
......@@ -52,10 +52,6 @@ public class TapeAdapter extends BaseAdapter {
pictoLinkedList.remove(position);
}
// ELIMINAR ITEM DEL ADAPTADOR
public void disvanishItem(int position){
pictoLinkedList.get(position).set_disvanish(true);
}
// ELIMINAR el último ITEM DEL ADAPTADOR
public void deleteLastView(){
......
......@@ -51,13 +51,14 @@
<Button
android:id="@+id/entrar_button" style="?android:textAppearanceSmall"
android:layout_width="400px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="11dp"
android:text="@string/action_entrar"
android:textStyle="bold"
android:layout_below="@+id/serialpass"
android:layout_alignStart="@+id/serialpass" />
android:layout_alignStart="@+id/serialpass"
android:layout_alignParentEnd="true" />
<View
android:layout_width="match_parent"
......@@ -68,12 +69,13 @@
android:layout_marginEnd="18dp" />
<LinearLayout
android:layout_below="@+id/entrar_button"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_marginStart="67dp"
android:layout_marginTop="20dp"
android:background="@color/common_plus_signin_btn_text_dark_pressed"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
android:layout_width="200dp"
android:layout_alignParentStart="true"
android:id="@+id/stuLay">
......@@ -100,8 +102,9 @@
android:orientation="vertical"
android:background="@color/common_google_signin_btn_text_dark_default"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
android:layout_width="200dp"
android:layout_marginStart="10dp"
android:layout_alignTop="@id/stuLay"
android:layout_toEndOf="@id/stuLay"
android:id="@+id/supLay"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_plus_signin_btn_text_dark_disabled">
android:orientation="vertical" android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:text="Nombre"
......@@ -14,12 +14,12 @@
android:textColor="@android:color/black"
android:layout_alignTop="@+id/photo"
android:layout_toEndOf="@+id/photo"
android:layout_width="250dp"
android:layout_width="wrap_content"
android:layout_marginStart="15dp" />
<TextView
android:text="Apellidos"
android:layout_width="250dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/label_surname"
android:textSize="18sp"
......@@ -33,8 +33,8 @@
app:srcCompat="@drawable/anonymous_student"
android:id="@+id/photo"
android:layout_weight="0.15"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
......@@ -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,6 +81,14 @@
<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" />
......
......@@ -43,6 +43,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/assets" type="java-test-resource" />
......@@ -51,13 +58,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/assets" type="java-resource" />
......
......@@ -106,14 +106,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/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/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" />
......@@ -122,6 +114,14 @@
<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" />
<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/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
......
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