Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c7ece8fd
authored
Mar 21, 2017
by
Germán Callejas Alcántara
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Issue
#95
arreglado
parent
ec9e37f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
16 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoMenu.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictogramActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/cropper/EditPictoActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoMenu.java
View file @
c7ece8fd
...
...
@@ -140,11 +140,6 @@ public class PictoMenu {
}
intent
.
putExtra
(
"tipo"
,
true
);
Log
.
i
(
"TAG_PRUEBAS"
,
"---setPicto---"
);
Log
.
i
(
"TAG_PRUEBAS"
,
"row: "
+
row
);
Log
.
i
(
"TAG_PRUEBAS"
,
"col: "
+
col
);
Log
.
i
(
"TAG_PRUEBAS"
,
"expression: "
+
expression
);
activity
.
startActivityForResult
(
intent
,
EditPictoActivity
.
EDIT_PICTO_REQUEST
);
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictogramActivity.java
View file @
c7ece8fd
...
...
@@ -1127,8 +1127,7 @@ protected void showOnlyTape(boolean onlyTape) {
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
int
cat
=
data
.
getIntExtra
(
Picto
.
JSON_ATTTRS
.
CATEGORY
,
-
1
);
// getIntent().getIntExtra("cat", -1);
Log
.
i
(
"TAG_PRUEBAS"
,
"categoria antes de switch: "
+
String
.
valueOf
(
cat
));
boolean
edit
=
data
.
getBooleanExtra
(
"tipo"
,
false
);
Bitmap
imagen
=
null
;
switch
(
requestCode
)
{
...
...
@@ -1152,15 +1151,14 @@ protected void showOnlyTape(boolean onlyTape) {
break
;
case
EditPictoActivity
.
EDIT_PICTO_REQUEST
:
if
(
resultCode
==
RESULT_OK
)
{
Log
.
i
(
"TAG_PRUEBAS"
,
"---REQUEST_OK_EDIT----"
);
int
row
=
data
.
getExtras
().
getInt
(
Picto
.
JSON_ATTTRS
.
ROW
,
-
1
);
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
row
=
edit
?
data
.
getExtras
().
getInt
(
Picto
.
JSON_ATTTRS
.
ROW
)
:
getIntent
().
getIntExtra
(
Picto
.
JSON_ATTTRS
.
ROW
,
-
1
);
int
col
=
edit
?
data
.
getExtras
().
getInt
(
Picto
.
JSON_ATTTRS
.
COLUMN
)
:
getIntent
().
getIntExtra
(
Picto
.
JSON_ATTTRS
.
COLUMN
,
-
1
);
int
freeRow
=
edit
?
data
.
getExtras
().
getInt
(
Picto
.
JSON_ATTTRS
.
FREE_ROW
)
:
getIntent
().
getIntExtra
(
Picto
.
JSON_ATTTRS
.
FREE_ROW
,
-
1
);
int
freeColumn
=
edit
?
data
.
getExtras
().
getInt
(
Picto
.
JSON_ATTTRS
.
FREE_COLUMN
)
:
getIntent
().
getIntExtra
(
Picto
.
JSON_ATTTRS
.
FREE_COLUMN
,
-
1
);
int
cat
=
edit
?
data
.
getIntExtra
(
Picto
.
JSON_ATTTRS
.
CATEGORY
,
-
1
)
:
getIntent
().
getIntExtra
(
Picto
.
JSON_ATTTRS
.
CATEGORY
,
-
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
);
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/cropper/EditPictoActivity.java
View file @
c7ece8fd
...
...
@@ -259,10 +259,12 @@ public class EditPictoActivity extends Activity {
Intent
intent
=
getIntent
();
//Mandar a pictogram activity el path y el texto de la imagen
intent
.
putExtra
(
PATH
,
path
);
intent
.
putExtra
(
Picto
.
JSON_ATTTRS
.
EXPRESSION
,
legend
.
getText
().
toString
());
intent
.
putExtra
(
Picto
.
JSON_ATTTRS
.
CATEGORY
,
getIntent
().
getIntExtra
(
Picto
.
JSON_ATTTRS
.
CATEGORY
,
-
1
));
intent
.
putExtra
(
"tipo"
,
editar
);
//Para saber despues si estas editando o añadiendo nuevo y coger los datos de intent o de data en OnActivityResult
setResult
(
RESULT_OK
,
intent
);
cropImageView
.
setImageBitmap
(
finalImage
);
Log
.
i
(
"TAG_PRUEBAS"
,
"Lanza ok de editar"
);
//
Log.i("TAG_PRUEBAS","Lanza ok de editar");
finish
();
//Termina la actividad de editar
}
else
...
...
@@ -491,7 +493,7 @@ public class EditPictoActivity extends Activity {
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
int
cat
=
getIntent
().
getIntExtra
(
"cat"
,
-
1
);
//
int cat = getIntent().getIntExtra("cat", -1);
Bitmap
imagen
=
null
;
Bitmap
rescaled
=
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment