issue #905 closed

parent d7dfd909
/build
/supervisor_tablet.iml
supervisor_tablet.iml
/build
/tabletlibrary.iml
\ No newline at end of file
.iml
package com.yottacode.pictogram.tabletlibrary.cropper;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.media.effect.Effect;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.text.InputType;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
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.tabletlibrary.gui.communicator.PictogramActivity;
import com.yottacode.pictogram.tools.PCBcontext;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
/**
* Created by German on 06/02/2017.
......@@ -39,8 +28,6 @@ public class EditPictoActivity extends Activity {
public static final int EDIT_PICTO_REQUEST = 2288;
public static final int UPLOAD_NEW_PICTO = 200;
public static final String TRANSCRIPTION = "textPicto";
public static final String PATH = "pathImage";
public static final String IMAGE_PICTO = "imagePicto";
......@@ -98,16 +85,13 @@ public class EditPictoActivity extends Activity {
String path = MediaStore.Images.Media.insertImage(PCBcontext.getContext().getContentResolver(), finalImage, legend.getText()+"-recorte", null);
Uri pathImage = Uri.parse(path);
Intent intent = new Intent(EditPictoActivity.this,PictogramActivity.class); //Mandar a pictogram activity el path y el texto de la imagen
Intent intent = getIntent(); //Mandar a pictogram activity el path y el texto de la imagen
intent.putExtra(PATH,pathImage.toString());
intent.putExtra(TRANSCRIPTION,legend.getText().toString());
cropImageView.setImageBitmap(finalImage);
setResult(RESULT_OK,intent);
finish(); //Termina la actividad de editar
startActivityForResult(intent,UPLOAD_NEW_PICTO); //Llama a pictogramActivity de nuevo
//setResult(RESULT_OK,intent);
}
});
......@@ -116,9 +100,8 @@ public class EditPictoActivity extends Activity {
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(EditPictoActivity.this,PictogramActivity.class);
setResult(RESULT_CANCELED,getIntent());
finish();
startActivity(intent);
}
});
}
......
......@@ -1109,7 +1109,7 @@ protected void showOnlyTape(boolean onlyTape) {
int freeColumn = getIntent().getIntExtra(Picto.JSON_ATTTRS.FREE_COLUMN, -1);
int cat = getIntent().getIntExtra("cat", -1);
Log.i("DETALLES", "Picto nuevo en: " + " fila: " + row + " col: " + col + " cat: "+cat);
Log.i(LOG_TAG, "Picto nuevo en: " + " fila: " + row + " col: " + col + " cat: "+cat);
Bitmap imagen = null;
switch(requestCode) {
......@@ -1143,17 +1143,14 @@ protected void showOnlyTape(boolean onlyTape) {
}
break;
case EditPictoActivity.EDIT_PICTO_REQUEST:
if (resultCode == RESULT_OK)
Log.i("DETALLES", "Llega el intent de recorte 2, texto: " + data.getExtras().getString(EditPictoActivity.TRANSCRIPTION));
break;
case EditPictoActivity.UPLOAD_NEW_PICTO:
String path = getIntent().getExtras().getString(EditPictoActivity.PATH);
Log.i("DETALLES","Path de la imagen tras llamar a gestionarlo: "+ path);
String legend = getIntent().getExtras().getString(EditPictoActivity.TRANSCRIPTION);
chooseTextAndSavePicto(path,row,col,freeRow,freeColumn,cat,legend);
Log.i(LOG_TAG, "Llega el intent de recorte->" + data.getExtras().getString(EditPictoActivity.TRANSCRIPTION));
if (resultCode == RESULT_OK) {
Log.i(LOG_TAG, "Llega el intent de recorte 2, texto: " + data.getExtras().getString(EditPictoActivity.TRANSCRIPTION));
String path = data.getExtras().getString(EditPictoActivity.PATH);
Log.i(LOG_TAG, "Path de la imagen tras llamar a gestionarlo: " + path);
String legend = data.getExtras().getString(EditPictoActivity.TRANSCRIPTION);
chooseTextAndSavePicto(path, row, col, freeRow, freeColumn, cat, legend);
}
break;
}
......
/build
/watch.iml
\ No newline at end of file
.iml
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