Commit 3ee689e3 by German Callejas

Solucionado el tema de las leyendas para que aparezcan en 1 linea

parent 614b18cc
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment