Cambios de parametros en los intents para editar pictos (Falta arreglar añadir uno nuevo)

parent 643e1501
...@@ -31,4 +31,5 @@ dependencies { ...@@ -31,4 +31,5 @@ dependencies {
compile project(':commonlibrary') compile project(':commonlibrary')
compile 'com.android.support:appcompat-v7:24.2.1' compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:support-v4:24.2.1' compile 'com.android.support:support-v4:24.2.1'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
} }
...@@ -87,7 +87,7 @@ public class PictoMenu { ...@@ -87,7 +87,7 @@ public class PictoMenu {
activity.getIntent().putExtra(Picto.JSON_ATTTRS.EXPRESSION, expression); activity.getIntent().putExtra(Picto.JSON_ATTTRS.EXPRESSION, expression);
//Enviar al PictogramActivity los datos necesarios para crear el picto despues //Enviar al PictogramActivity los datos necesarios para crear el picto despues
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) { if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
activity.getIntent().putExtra("cat", cat); activity.getIntent().putExtra(Picto.JSON_ATTTRS.CATEGORY, cat);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row); activity.getIntent().putExtra(Picto.JSON_ATTTRS.ROW, row);
activity.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col); activity.getIntent().putExtra(Picto.JSON_ATTTRS.COLUMN, col);
} else { } else {
...@@ -113,7 +113,7 @@ public class PictoMenu { ...@@ -113,7 +113,7 @@ public class PictoMenu {
intent.putExtra(Picto.JSON_ATTTRS.EXPRESSION, expression); intent.putExtra(Picto.JSON_ATTTRS.EXPRESSION, expression);
//Enviar al PictogramActivity los datos necesarios para editar el picto despues //Enviar al PictogramActivity los datos necesarios para editar el picto despues
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) { if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
intent.putExtra("cat", cat); intent.putExtra(Picto.JSON_ATTTRS.CATEGORY, cat);
intent.putExtra(Picto.JSON_ATTTRS.ROW, row); intent.putExtra(Picto.JSON_ATTTRS.ROW, row);
intent.putExtra(Picto.JSON_ATTTRS.COLUMN, col); intent.putExtra(Picto.JSON_ATTTRS.COLUMN, col);
} else { } else {
......
...@@ -1127,7 +1127,8 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -1127,7 +1127,8 @@ protected void showOnlyTape(boolean onlyTape) {
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
int cat = getIntent().getIntExtra("cat", -1); int cat = data.getIntExtra(Picto.JSON_ATTTRS.CATEGORY, -1);// getIntent().getIntExtra("cat", -1);
Log.i("TAG_PRUEBAS","categoria antes de switch: "+String.valueOf(cat));
Bitmap imagen = null; Bitmap imagen = null;
switch(requestCode) { switch(requestCode) {
...@@ -1156,7 +1157,10 @@ protected void showOnlyTape(boolean onlyTape) { ...@@ -1156,7 +1157,10 @@ protected void showOnlyTape(boolean onlyTape) {
int col = data.getExtras().getInt(Picto.JSON_ATTTRS.COLUMN); int col = data.getExtras().getInt(Picto.JSON_ATTTRS.COLUMN);
int freeRow = data.getExtras().getInt(Picto.JSON_ATTTRS.FREE_ROW, -1); int freeRow = data.getExtras().getInt(Picto.JSON_ATTTRS.FREE_ROW, -1);
int freeColumn = data.getExtras().getInt(Picto.JSON_ATTTRS.FREE_COLUMN, -1); int freeColumn = data.getExtras().getInt(Picto.JSON_ATTTRS.FREE_COLUMN, -1);
//int category = data.getExtras().getInt("cat");
//Log.i("TAG_PRUEBAS","categoria: "+String.valueOf(category));
String path = data.getExtras().getString(EditPictoActivity.PATH); String path = data.getExtras().getString(EditPictoActivity.PATH);
String legend = data.getExtras().getString(Picto.JSON_ATTTRS.EXPRESSION); String legend = data.getExtras().getString(Picto.JSON_ATTTRS.EXPRESSION);
......
...@@ -45,6 +45,8 @@ import com.yottacode.tools.GUITools; ...@@ -45,6 +45,8 @@ import com.yottacode.tools.GUITools;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import pl.droidsonroids.gif.GifTextView;
import static java.lang.Thread.sleep; import static java.lang.Thread.sleep;
/** /**
...@@ -92,6 +94,8 @@ public class EditPictoActivity extends Activity { ...@@ -92,6 +94,8 @@ public class EditPictoActivity extends Activity {
BotonCircular botonReproducir; BotonCircular botonReproducir;
BotonCircular botonBorrar; BotonCircular botonBorrar;
GifTextView gifRecord;
SeekBar barraReproducir; SeekBar barraReproducir;
TextView textoTTotal; TextView textoTTotal;
TextView textoTGrabacion; TextView textoTGrabacion;
...@@ -290,8 +294,10 @@ public class EditPictoActivity extends Activity { ...@@ -290,8 +294,10 @@ public class EditPictoActivity extends Activity {
botonBorrar = (BotonCircular) findViewById(R.id.botonBorrar); botonBorrar = (BotonCircular) findViewById(R.id.botonBorrar);
camara = (BotonCircular) findViewById(R.id.camara); camara = (BotonCircular) findViewById(R.id.camara);
galeria = (BotonCircular) findViewById(R.id.galeria); galeria = (BotonCircular) findViewById(R.id.galeria);
gifRecord = (GifTextView) findViewById(R.id.recordImage);
barraReproducir = (SeekBar) findViewById(R.id.barraReproducir); barraReproducir = (SeekBar) findViewById(R.id.barraReproducir);
textoTTotal = (TextView) findViewById(R.id.tiempoTotal); textoTTotal = (TextView) findViewById(R.id.tiempoTotal);
textoTGrabacion = (TextView) findViewById(R.id.tiempoActual); textoTGrabacion = (TextView) findViewById(R.id.tiempoActual);
layoutPreview = (LinearLayout) findViewById(R.id.layoutPreview); layoutPreview = (LinearLayout) findViewById(R.id.layoutPreview);
layoutGrabacion = (LinearLayout) findViewById(R.id.layout_record); layoutGrabacion = (LinearLayout) findViewById(R.id.layout_record);
...@@ -320,9 +326,11 @@ public class EditPictoActivity extends Activity { ...@@ -320,9 +326,11 @@ public class EditPictoActivity extends Activity {
case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_DOWN:
tareaGrabacion = (RecordTask) new RecordTask().execute(tiempoGrabado); tareaGrabacion = (RecordTask) new RecordTask().execute(tiempoGrabado);
startRecording(); startRecording();
gifRecord.setBackgroundResource(R.drawable.record_animation);
Log.i(DEBUG_MESSAGE,"Grabando.."); Log.i(DEBUG_MESSAGE,"Grabando..");
return true; return true;
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
gifRecord.setBackgroundResource(R.color.white);
tareaGrabacion.cancel(true); tareaGrabacion.cancel(true);
return true; return true;
} }
......
...@@ -147,28 +147,27 @@ ...@@ -147,28 +147,27 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="5dp" android:paddingTop="5dp"
android:visibility="visible" android:visibility="visible"
android:weightSum="1"> android:weightSum="1">
<com.yottacode.pictogram.tabletlibrary.gui.communicator.BotonCircular
android:id="@+id/gifGrabar" <pl.droidsonroids.gif.GifTextView
android:layout_width="48dp" android:id="@+id/recordImage"
android:layout_height="48dp" android:layout_width="14dp"
android:layout_alignParentBottom="false" android:layout_height="20dp"
android:layout_centerHorizontal="false"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.38" android:layout_weight="0.36"
android:background="#00ffffff" android:background="@color/white" />
android:src="@android:drawable/ic_menu_delete" />
<TextView <TextView
android:id="@+id/tiempoActual" android:id="@+id/tiempoActual"
android:layout_width="125dp" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:paddingLeft="16dp" android:paddingLeft="5dp"
android:paddingRight="16dp" android:paddingRight="16dp"
android:text="00:00 | 00:10" android:text="00:00 | 00:10"
android:textColor="@color/VerdeApp" /> android:textColor="@color/VerdeApp" />
......
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