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
0df555c0
authored
Feb 08, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
trabajando en recorte de imagen desde el pcb
parent
de4d53ee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
188 additions
and
147 deletions
android/Pictogram/commonlibrary/build.gradle
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
android/Pictogram/supervisor_tablet/supervisor_tablet.iml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/cropper/EditPictoActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoItemViewGenerator.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictogramActivity.java
android/Pictogram/tabletlibrary/tabletlibrary.iml
android/Pictogram/watch/watch.iml
android/Pictogram/yotta_tablet/yotta_tablet.iml
android/Pictogram/commonlibrary/build.gradle
View file @
0df555c0
...
...
@@ -11,7 +11,7 @@ android {
versionName
"1.0"
resValue
"string"
,
"db_name"
,
"PCB.db"
resValue
"integer"
,
"db_version"
,
"2"
resValue
"string"
,
"app_version"
,
"0.
0
"
resValue
"string"
,
"app_version"
,
"0.
1
"
resValue
"string"
,
"core_vocabulary"
,
"core_vocabulary"
resValue
"string"
,
"apk"
,
"to_be_set_in_subproject"
}
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
View file @
0df555c0
...
...
@@ -209,7 +209,7 @@ public class Vocabulary implements Iterable<Picto> {
@Override
public
void
error
(
RestapiWrapper
.
HTTPException
e
)
{
Log
.
e
(
this
.
getClass
().
getName
(),
" Server RESTAPI error: "
+
e
.
getLocalizedMessage
());
Vocabulary
.
this
.
imgListener
.
error
(
e
);
if
(
Vocabulary
.
this
.
imgListener
!=
null
)
Vocabulary
.
this
.
imgListener
.
error
(
e
);
}
});
...
...
android/Pictogram/supervisor_tablet/supervisor_tablet.iml
View file @
0df555c0
...
...
@@ -66,6 +66,14 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavor/jni"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavor/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavor/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDevFlavor/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDevFlavor/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDevFlavor/assets"
type=
"java-test-resource"
/>
...
...
@@ -74,14 +82,50 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDevFlavor/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDevFlavor/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDevFlavor/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavor/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/res"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/assets"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/aidl"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/jni"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDebug/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDebug/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDebug/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDebug/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDebug/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDebug/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDebug/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDebug/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/res"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/assets"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/aidl"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/jni"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/assets"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/blame"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/classes"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/dependency-cache"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars"
/>
...
...
@@ -144,4 +188,4 @@
<orderEntry
type=
"library"
exported=
""
scope=
"TEST"
name=
"json-20090211"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-ads-lite-9.2.1"
level=
"project"
/>
</component>
</module>
</module>
\ No newline at end of file
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/cropper/EditPictoActivity.java
View file @
0df555c0
...
...
@@ -11,14 +11,8 @@ import android.view.Window;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.yottacode.pictogram.tabletlibrary.R
;
import
com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity
;
import
com.yottacode.pictogram.tools.PCBcontext
;
import
org.w3c.dom.Text
;
/**
* Created by German on 06/02/2017.
...
...
@@ -27,7 +21,9 @@ import org.w3c.dom.Text;
public
class
EditPictoActivity
extends
Activity
{
// Private Constants ///////////////////////////////////////////////////////////////////////////
private
static
final
int
GUIDELINES_ON_TOUCH
=
1
;
public
static
final
int
EDIT_PICTO_REQUEST
=
2288
;
public
static
final
String
TRANSCRIPTION
=
"textPicto"
;
public
static
final
String
IMAGE_PICTO
=
"imagePicto"
;
// Activity Methods ////////////////////////////////////////////////////////////////////////////
...
...
@@ -50,12 +46,12 @@ public class EditPictoActivity extends Activity {
cropImageView
.
setGuidelines
(
2
);
cropImageView
.
setAspectRatio
(
1
,
1
);
String
legendText
=
getIntent
().
getExtras
().
getString
(
"textPicto"
);
String
legendText
=
getIntent
().
getExtras
().
getString
(
EditPictoActivity
.
TRANSCRIPTION
);
if
(
legendText
!=
null
)
{
Log
.
i
(
"DETALLES"
,
"Llega el intent al layout recortar, con texto: "
+
legend
);
Log
.
i
(
"DETALLES"
,
"Llega el intent al layout recortar, con texto: "
+
legend
Text
);
legend
.
setText
(
legendText
);
}
byte
[]
byteArray
=
getIntent
().
getByteArrayExtra
(
"imagePicto"
);
byte
[]
byteArray
=
getIntent
().
getByteArrayExtra
(
EditPictoActivity
.
IMAGE_PICTO
);
Bitmap
imagePicto
=
BitmapFactory
.
decodeByteArray
(
byteArray
,
0
,
byteArray
.
length
);
cropImageView
.
setImageBitmap
(
imagePicto
);
...
...
@@ -69,8 +65,12 @@ public class EditPictoActivity extends Activity {
final
Bitmap
croppedImage
=
cropImageView
.
getCroppedImage
();
//Escalar y guardarla al server
croppedImage
.
createScaledBitmap
(
croppedImage
,
96
,
96
,
true
);
Intent
intent
=
getIntent
();
intent
.
putExtra
(
EditPictoActivity
.
TRANSCRIPTION
,
legend
.
getText
().
toString
());
Log
.
i
(
"DETALLES"
,
"sale el intent al layout recortar, con texto: "
+
legend
.
getText
().
toString
());
cropImageView
.
setImageBitmap
(
croppedImage
);
setResult
(
RESULT_OK
,
intent
);
finish
();
}
});
...
...
@@ -79,8 +79,6 @@ public class EditPictoActivity extends Activity {
@Override
public
void
onClick
(
View
v
)
{
finish
();
Intent
intent
=
new
Intent
(
EditPictoActivity
.
this
,
PictogramActivity
.
class
);
startActivity
(
intent
);
}
});
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoItemViewGenerator.java
View file @
0df555c0
...
...
@@ -172,64 +172,66 @@ public class PictoItemViewGenerator {
.
getColor
(
R
.
color
.
picto_default_background
));
redCrossImage
.
setVisibility
(
View
.
GONE
);
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
&&
picto
!=
null
)
{
layoutWrapper
.
setVisibility
(
View
.
GONE
);
pictoImage
.
setVisibility
(
View
.
GONE
);
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
GONE
);
pictoImage
.
setImageBitmap
(
null
);
layoutWrapper
.
setAlpha
(
1
f
);
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
||
(
picto
!=
null
&&
!
picto
.
is_invisible
()))
{
layoutWrapper
.
setVisibility
(
View
.
VISIBLE
);
pictoImage
.
setVisibility
(
View
.
VISIBLE
);
layoutWrapper
.
setBackground
(
convertView
.
getResources
()
.
getDrawable
(
R
.
drawable
.
picto_grid_item_border
));
}
else
if
(
picto
==
null
||
picto
.
is_invisible
()
)
{
layoutWrapper
.
setVisibility
(
View
.
GONE
);
pictoImage
.
setVisibility
(
View
.
GONE
);
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
GONE
);
}
if
(
picto
!=
null
)
{
layoutWrapper
.
setAlpha
(!
picto
.
is_invisible
()
?
1.00f
:
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
?
0.25f
:
0
f
);
try
{
Bitmap
bm
=
picto
.
get_bitmap
(
PCBcontext
.
getContext
());
switch
(
picto
.
get_legend
())
{
case
"none"
:
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
GONE
);
break
;
case
"normal"
:
legend
.
setText
(
format_legend
(
picto
,
MAX_LINE_LENGTH
,
false
));
legend
.
setVisibility
(
View
.
VISIBLE
);
legend_full
.
setVisibility
(
View
.
GONE
);
break
;
default
:
legend_full
.
setText
(
format_legend
(
picto
,
MAX_LINE_LENGTH_FULL
,
true
));
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
VISIBLE
);
}
pictoImage
.
setImageBitmap
(
bm
);
if
(
picto
.
is_magnify
())
{
pictoImage
.
setScaleX
(
1.2f
);
pictoImage
.
setScaleY
(
1.2f
);
if
(
picto
!=
null
)
{
layoutWrapper
.
setAlpha
(!
picto
.
is_invisible
()
?
1.00f
:
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
?
0.25f
:
0
f
);
try
{
Bitmap
bm
=
picto
.
get_bitmap
(
PCBcontext
.
getContext
());
switch
(
picto
.
get_legend
())
{
case
"none"
:
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
GONE
);
break
;
case
"normal"
:
legend
.
setText
(
format_legend
(
picto
,
MAX_LINE_LENGTH
,
false
));
legend
.
setVisibility
(
View
.
VISIBLE
);
legend_full
.
setVisibility
(
View
.
GONE
);
break
;
default
:
legend_full
.
setText
(
format_legend
(
picto
,
MAX_LINE_LENGTH_FULL
,
true
));
legend
.
setVisibility
(
View
.
GONE
);
legend_full
.
setVisibility
(
View
.
VISIBLE
);
}
pictoImage
.
setImageBitmap
(
bm
);
if
(
picto
.
is_magnify
())
{
pictoImage
.
setScaleX
(
1.2f
);
pictoImage
.
setScaleY
(
1.2f
);
}
if
(
picto
.
is_disabled
())
redCrossImage
.
setVisibility
(
View
.
VISIBLE
);
if
(
picto
.
is_category
())
layout
.
setBackgroundColor
(
picto
.
get_color
());
if
(
picto
.
is_mirror
()
&&
!
preventMirror
)
{
int
color
[]
=
{
Color
.
WHITE
,
Color
.
LTGRAY
,
Color
.
GRAY
,
Color
.
DKGRAY
,
Color
.
BLACK
,
Color
.
DKGRAY
,
Color
.
GRAY
,
Color
.
LTGRAY
,
Color
.
WHITE
};
float
scale
[]
=
{
1
f
,
1.1f
,
1.2f
,
1.3f
,
1.4f
,
1.5f
,
1.4f
,
1.3f
,
1.2f
,
1.1f
};
mirror_color
++;
pictoImage
.
setScaleX
(
scale
[
mirror_color
%
scale
.
length
]);
pictoImage
.
setScaleY
(
scale
[
mirror_color
%
scale
.
length
]);
if
(
picto
.
is_highlight_background
())
layout
.
setBackgroundColor
(
color
[
mirror_color
%
color
.
length
]);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
if
(
picto
.
is_disabled
())
redCrossImage
.
setVisibility
(
View
.
VISIBLE
);
if
(
picto
.
is_category
())
layout
.
setBackgroundColor
(
picto
.
get_color
());
if
(
picto
.
is_mirror
()
&&
!
preventMirror
)
{
int
color
[]={
Color
.
WHITE
,
Color
.
LTGRAY
,
Color
.
GRAY
,
Color
.
DKGRAY
,
Color
.
BLACK
,
Color
.
DKGRAY
,
Color
.
GRAY
,
Color
.
LTGRAY
,
Color
.
WHITE
};
float
scale
[]={
1
f
,
1.1f
,
1.2f
,
1.3f
,
1.4f
,
1.5f
,
1.4f
,
1.3f
,
1.2f
,
1.1f
};
mirror_color
++;
pictoImage
.
setScaleX
(
scale
[
mirror_color
%
scale
.
length
]);
pictoImage
.
setScaleY
(
scale
[
mirror_color
%
scale
.
length
]);
if
(
picto
.
is_highlight_background
())
layout
.
setBackgroundColor
(
color
[
mirror_color
%
color
.
length
]);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictogramActivity.java
View file @
0df555c0
...
...
@@ -41,7 +41,6 @@ import android.widget.ImageButton;
import
android.widget.RelativeLayout
;
import
android.widget.Toast
;
import
com.google.android.gms.gcm.GcmNetworkManager
;
import
com.yottacode.pictogram.action.PictosAction
;
import
com.yottacode.pictogram.action.TalkAction
;
import
com.yottacode.pictogram.dao.Picto
;
...
...
@@ -63,9 +62,9 @@ import org.json.JSONException;
import
org.json.JSONObject
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Iterator
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Locale
;
...
...
@@ -825,14 +824,13 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
*/
private
class
OnPictoLongClickListener
implements
AdapterView
.
OnItemLongClickListener
{
public
boolean
onItemLongClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
Log
.
i
(
LOG_TAG
,
"Click largo"
);
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
())
{
// Si es supervisor al hacer longClick deshabilito ese pictograma o lo habilito
Picto
p
=
getCurrentPictoGridAdapter
().
getItem
(
position
);
if
(
p
==
null
)
{
// No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria
if
(
currentCategory
!=
null
||
!
PCBcontext
.
getPcbdb
().
getCurrentUser
().
has_categories
())
{
Log
.
d
(
LOG_TAG
,
"No tengo pictograma. Abro carrete..."
);
new
PictoMenu
(
PictogramActivity
.
this
).
addPicto
(
position
%
maxColumns
,
(
int
)
(
position
/
maxColumns
));
}
else
Toast
.
makeText
(
PictogramActivity
.
this
,
PictogramActivity
.
this
.
getResources
().
getString
(
R
.
string
.
notNewCats
),
Toast
.
LENGTH_SHORT
).
show
();
...
...
@@ -1082,42 +1080,46 @@ protected void showOnlyTape(boolean onlyTape) {
*/
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
Iterator
<
String
>
keys
=
data
.
getExtras
().
keySet
().
iterator
();
while
(
keys
.
hasNext
()){
String
key
=
keys
.
next
();
Log
.
i
(
"DETALLES"
,
"Llega el intent 0: "
+
key
);}
Bitmap
imagen
=
null
;
String
legend
=
null
;
switch
(
requestCode
)
{
case
CAMERA_PIC_REQUEST:
//Captura de foto
if
(
data
!=
null
)
{
imagen
=
(
Bitmap
)
data
.
getExtras
().
get
(
"data"
);
legend
=
data
.
getExtras
().
getString
(
"pictoText"
);
/**AQUI DEBERIA OBTENER EL LEGEND EN EL CASO DE QUE QUIERA EDITAR LA IMAGEN DE UN PICTO
NO FUNCIONA DEVUELVE NULL ¿?¿?¿WHY?¿?¿*/
Log
.
i
(
"DETALLES"
,
"Llega el intent del menú, con texto: "
+
legend
);
}
else
{
Log
.
i
(
"DETALLES"
,
"Fallo al tomar foto"
);
}
break
;
case
GALLERY_PIC_REQUEST:
//Galeria
Uri
selectedImage
=
data
.
getData
();
String
[]
filePathColumn
=
{
MediaStore
.
Images
.
Media
.
DATA
};
Cursor
cursor
=
getContentResolver
().
query
(
selectedImage
,
filePathColumn
,
null
,
null
,
null
);
cursor
.
moveToFirst
();
int
columnIndex
=
cursor
.
getColumnIndex
(
filePathColumn
[
0
]);
String
filePath
=
cursor
.
getString
(
columnIndex
);
cursor
.
close
();
imagen
=
BitmapFactory
.
decodeFile
(
filePath
);
break
;
}
/** Tras echar foto llamar a la actividad de recortar y le paso la leyenda para si tiene anteriormente o null, y la imagen a recortar */
this
.
launchActivity
(
legend
!=
null
?
legend
:
null
,
imagen
);
switch
(
requestCode
)
{
case
CAMERA_PIC_REQUEST:
//Captura de foto
if
(
data
!=
null
)
{
imagen
=
(
Bitmap
)
data
.
getExtras
().
get
(
"data"
);
legend
=
data
.
getExtras
().
getString
(
"pictoText"
);
/**AQUI DEBERIA OBTENER EL LEGEND EN EL CASO DE QUE QUIERA EDITAR LA IMAGEN DE UN PICTO
NO FUNCIONA DEVUELVE NULL ¿?¿?¿WHY?¿?¿*/
Log
.
i
(
"DETALLES"
,
"Llega el intent del menú, con texto: "
+
legend
);
}
else
{
Log
.
i
(
"DETALLES"
,
"Fallo al tomar foto"
);
}
/** Tras echar foto llamar a la actividad de recortar y le paso la leyenda para si tiene anteriormente o null, y la imagen a recortar */
//-->GERMAN: legend != null ? legend : null es lo mismo que simplemente legend
this
.
launchActivity
(
legend
,
imagen
);
break
;
case
GALLERY_PIC_REQUEST:
//Galeria
Uri
selectedImage
=
data
.
getData
();
String
[]
filePathColumn
=
{
MediaStore
.
Images
.
Media
.
DATA
};
Cursor
cursor
=
getContentResolver
().
query
(
selectedImage
,
filePathColumn
,
null
,
null
,
null
);
cursor
.
moveToFirst
();
int
columnIndex
=
cursor
.
getColumnIndex
(
filePathColumn
[
0
]);
String
filePath
=
cursor
.
getString
(
columnIndex
);
cursor
.
close
();
imagen
=
BitmapFactory
.
decodeFile
(
filePath
);
/** Tras echar foto llamar a la actividad de recortar y le paso la leyenda para si tiene anteriormente o null, y la imagen a recortar */
//-->GERMAN: legend != null ? legend : null es lo mismo que simplemente legend
this
.
launchActivity
(
legend
,
imagen
);
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
));
}
}
...
...
@@ -1136,26 +1138,20 @@ protected void showOnlyTape(boolean onlyTape) {
v1.setDrawingCacheEnabled(false);*/
Intent
intent
=
new
Intent
(
this
,
EditPictoActivity
.
class
);
finish
();
if
(
image
!=
null
){
if
(
image
!=
null
)
{
int
bWidth
=
image
.
getWidth
();
int
bHeight
=
image
.
getHeight
();
Bitmap
rescaled
=
Bitmap
.
createScaledBitmap
(
image
,
bWidth
*
5
,
bHeight
*
4
,
true
);
Bitmap
rescaled
=
Bitmap
.
createScaledBitmap
(
image
,
bWidth
*
5
,
bHeight
*
5
,
true
);
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
rescaled
.
compress
(
Bitmap
.
CompressFormat
.
PNG
,
100
,
stream
);
byte
[]
byteArray
=
stream
.
toByteArray
();
intent
.
putExtra
(
"imagePicto"
,
byteArray
);
intent
.
putExtra
(
EditPictoActivity
.
IMAGE_PICTO
,
byteArray
);
if
(
textLegend
!=
null
)
{
//Si es editar un picto anterior
Log
.
i
(
"DETALLES"
,
"Lanza el intent a recortar con texto: "
+
textLegend
);
intent
.
putExtra
(
"textPicto"
,
textLegend
);
}
}
else
{
Log
.
i
(
"Detalles"
,
"Activity sin imagen"
);
intent
.
putExtra
(
EditPictoActivity
.
TRANSCRIPTION
,
textLegend
==
null
?
" "
:
textLegend
);
startActivityForResult
(
intent
,
EditPictoActivity
.
EDIT_PICTO_REQUEST
);
}
startActivity
(
intent
);
}
}
android/Pictogram/tabletlibrary/tabletlibrary.iml
View file @
0df555c0
...
...
@@ -73,14 +73,6 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/jni"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/assets"
type=
"java-test-resource"
/>
...
...
@@ -89,6 +81,14 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/annotations"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/blame"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/bundles"
/>
...
...
android/Pictogram/watch/watch.iml
View file @
0df555c0
...
...
@@ -66,14 +66,6 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/DefaultFlavor/jni"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DefaultFlavor/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DefaultFlavor/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDefaultFlavor/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDefaultFlavor/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDefaultFlavor/assets"
type=
"java-test-resource"
/>
...
...
@@ -82,6 +74,14 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDefaultFlavor/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDefaultFlavor/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTestDefaultFlavor/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDefaultFlavor/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/res"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/debug/assets"
type=
"java-resource"
/>
...
...
@@ -106,14 +106,6 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/jni"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
...
...
@@ -122,6 +114,14 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/assets"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/blame"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/classes"
/>
...
...
android/Pictogram/yotta_tablet/yotta_tablet.iml
View file @
0df555c0
This diff is collapsed.
Click to expand it.
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