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
3ee689e3
authored
Jan 26, 2017
by
German Callejas
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Solucionado el tema de las leyendas para que aparezcan en 1 linea
parent
614b18cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
36 deletions
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/PictoItemViewGenerator.java
View file @
3ee689e3
...
...
@@ -43,45 +43,50 @@ public class PictoItemViewGenerator {
StringBuffer
txt
=
new
StringBuffer
();
if
(
words
.
length
==
1
)
{
if
(
words
[
0
].
length
()
>=
11
)
{
texto
=
""
;
for
(
int
i
=
0
;
i
<
words
[
0
].
length
();
i
++){
texto
+=
words
[
0
].
charAt
(
i
);
if
(
i
==
10
)
break
;
}
/*int mitad = (words[0].length() / 2) - 1;
char r = words[0].charAt(mitad);
char r2 = words[0].charAt(mitad + 1);
if
(
picto
.
get_legend
().
equals
(
"full"
)){
return
texto
;
}
else
{
if
(
words
.
length
==
1
)
{
if
(
words
[
0
].
length
()
>=
11
)
{
texto
=
""
;
for
(
int
i
=
0
;
i
<
words
[
0
].
length
();
i
++){
texto
+=
words
[
0
].
charAt
(
i
);
if
(
i
==
10
)
break
;
}
/*int mitad = (words[0].length() / 2) - 1;
char r = words[0].charAt(mitad);
char r2 = words[0].charAt(mitad + 1);
while ((r2 == 'A' || r2 == 'E' || r2 == 'I' || r2 == 'O' || r2 == 'U') && (r != 'A' || r != 'E' || r != 'I' || r != 'O' || r != 'U')) {
mitad++;
r = words[0].charAt(mitad);
r2 = words[0].charAt(mitad + 1);
}
int i = 0;
while (i <= mitad) {
txt.append(words[0].charAt(i));
i++;
}
int diff = 10 - mitad;
diff -= 1;
txt.append("-");
while (diff != 10) {
txt.append(" ");
diff++;
}
while (i < words[0].length()) {
txt.append(words[0].charAt(i));
i++;
while ((r2 == 'A' || r2 == 'E' || r2 == 'I' || r2 == 'O' || r2 == 'U') && (r != 'A' || r != 'E' || r != 'I' || r != 'O' || r != 'U')) {
mitad++;
r = words[0].charAt(mitad);
r2 = words[0].charAt(mitad + 1);
}
int i = 0;
while (i <= mitad) {
txt.append(words[0].charAt(i));
i++;
}
int diff = 10 - mitad;
diff -= 1;
txt.append("-");
while (diff != 10) {
txt.append(" ");
diff++;
}
while (i < words[0].length()) {
txt.append(words[0].charAt(i));
i++;
}
texto = txt.toString();*/
}
texto = txt.toString();*/
}
}
else
{
texto
=
words
[
0
];
}
else
{
texto
=
words
[
0
];
}
}
return
texto
;
}
...
...
@@ -146,11 +151,11 @@ public class PictoItemViewGenerator {
textView
.
layout
(
0
,
0
,
100
,
100
);
textView
.
setPadding
(
0
,
0
,
0
,
0
);
textView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_PX
,
13
);
textView
.
setTextSize
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
13
:
11
);
textView
.
setTextColor
(
Color
.
BLACK
);
textView
.
setWidth
(
100
);
textView
.
setGravity
(
Gravity
.
CENTER_HORIZONTAL
);
textView
.
setMaxLines
(
2
);
textView
.
setMaxLines
(
3
);
textView
.
setText
(
texto
);
textView
.
setDrawingCacheEnabled
(
true
);
...
...
@@ -219,6 +224,7 @@ public class PictoItemViewGenerator {
legend
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
bm
=
set_legend
(
PCBcontext
.
getContext
(),
bm
,
picto
);
legend
.
setVisibility
(
View
.
GONE
);
}
}
else
{
legend
.
setVisibility
(
View
.
GONE
);
...
...
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