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
1a140216
authored
Mar 20, 2017
by
Germán Callejas Alcántara
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Cambios de parametros en los intents para editar pictos (Falta arreglar añadir uno nuevo)
parent
643e1501
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
15 deletions
android/Pictogram/tabletlibrary/build.gradle
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/res/drawable-hdpi/record_animation.gif
android/Pictogram/tabletlibrary/src/main/res/layout/edit_picto_layout.xml
android/Pictogram/tabletlibrary/build.gradle
View file @
1a140216
...
@@ -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.+'
}
}
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoMenu.java
View file @
1a140216
...
@@ -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
{
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictogramActivity.java
View file @
1a140216
...
@@ -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
);
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/cropper/EditPictoActivity.java
View file @
1a140216
...
@@ -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
;
}
}
...
...
android/Pictogram/tabletlibrary/src/main/res/drawable-hdpi/record_animation.gif
0 → 100644
View file @
1a140216
141 Bytes
android/Pictogram/tabletlibrary/src/main/res/layout/edit_picto_layout.xml
View file @
1a140216
...
@@ -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=
"
16
dp"
android:paddingLeft=
"
5
dp"
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"
/>
...
...
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