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
a603373e
authored
Dec 12, 2016
by
german
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Picto updated
parent
0d8ed678
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/Picto.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/Picto.java
View file @
a603373e
...
...
@@ -54,9 +54,7 @@ public class Picto extends Img {
public
static
String
PCB_STATUS_MODIFICATION
=
"pcb_status_modification"
;
public
static
String
EXPRESSION
=
"expression"
;
public
static
String
MIRROR
=
"mirror"
;
/**Modificacion German*/
public
static
String
LEGEND
=
"legend"
;
public
static
String
LEGEND
=
"legend"
;
}
...
...
@@ -425,14 +423,14 @@ public class Picto extends Img {
Log
.
i
(
"TAG_NUEVO"
,
"ancho: "
+
width
);
Log
.
i
(
"TAG_NUEVO"
,
"alto: "
+
height
);
Log
.
i
(
"TAG_NUEVO"
,
"densidad: "
+
dens
);
//if(!get_legend().equals(JSON_ATTTR_LEGEND_VALUES.NONE)){ //Si tiene leyenda
if
(!
get_legend
().
equals
(
JSON_ATTTR_LEGEND_VALUES
.
NONE
)){
String
texto
=
this
.
translation
.
toUpperCase
();
String
[]
words
=
texto
.
split
(
" "
);
StringBuffer
txt
=
new
StringBuffer
();
if
(
words
.
length
==
1
)
{
//Si solo hay una palabra
if
(
words
[
0
].
length
()
>
10
)
{
//Si es mayor de 10 caracteres
if
(
words
.
length
==
1
)
{
if
(
words
[
0
].
length
()
>
10
)
{
texto
=
""
;
int
mitad
=
(
words
[
0
].
length
()
/
2
)
-
1
;
...
...
@@ -466,7 +464,8 @@ public class Picto extends Img {
}
}
//if(get_legend().equals(JSON_ATTTR_LEGEND_VALUES.NORMAL)) {
if
(
get_legend
().
equals
(
JSON_ATTTR_LEGEND_VALUES
.
NORMAL
))
{
//Normal legend
android
.
graphics
.
Bitmap
.
Config
bitmapConfig
=
bitmap
.
getConfig
();
if
(
bitmapConfig
==
null
)
{
bitmapConfig
=
android
.
graphics
.
Bitmap
.
Config
.
ARGB_8888
;
...
...
@@ -476,7 +475,6 @@ public class Picto extends Img {
Canvas
canvas
=
new
Canvas
(
bitmap
);
if
(
cont
==
0
)
{
//Copiar el bitmap a uno nuevo y reescalar
Bitmap
bm
=
Bitmap
.
createScaledBitmap
(
bitmap
,
width
/
2
,
height
/
2
,
false
);
canvas
.
drawColor
(
Color
.
TRANSPARENT
,
PorterDuff
.
Mode
.
CLEAR
);
//Poner en blanco el bitmap original para dibujar encima
canvas
.
drawBitmap
(
bm
,
25
,
0
,
paint
);
...
...
@@ -498,10 +496,9 @@ public class Picto extends Img {
}
//}else{
//Solo texto
/*android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig();
}
else
{
//Only legend
android
.
graphics
.
Bitmap
.
Config
bitmapConfig
=
bitmap
.
getConfig
();
if
(
bitmapConfig
==
null
)
{
bitmapConfig
=
android
.
graphics
.
Bitmap
.
Config
.
ARGB_8888
;
}
...
...
@@ -529,7 +526,7 @@ public class Picto extends Img {
canvas
.
drawBitmap
(
textView
.
getDrawingCache
(),
0
,
25
,
null
);
}
}
*/
}
return
bitmap
;
}
...
...
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