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

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