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
614b18cc
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
51957801
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
8 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoItemViewGenerator.java
android/Pictogram/tabletlibrary/src/main/res/layout/picto_grid_item.xml
android/Pictogram/tabletlibrary/src/main/res/layout/picto_grid_item_big.xml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictoItemViewGenerator.java
View file @
614b18cc
...
@@ -44,10 +44,13 @@ public class PictoItemViewGenerator {
...
@@ -44,10 +44,13 @@ public class PictoItemViewGenerator {
StringBuffer
txt
=
new
StringBuffer
();
StringBuffer
txt
=
new
StringBuffer
();
if
(
words
.
length
==
1
)
{
if
(
words
.
length
==
1
)
{
if
(
words
[
0
].
length
()
>
10
)
{
if
(
words
[
0
].
length
()
>
=
11
)
{
texto
=
""
;
texto
=
""
;
for
(
int
i
=
0
;
i
<
words
[
0
].
length
();
i
++){
int
mitad
=
(
words
[
0
].
length
()
/
2
)
-
1
;
texto
+=
words
[
0
].
charAt
(
i
);
if
(
i
==
10
)
break
;
}
/*int mitad = (words[0].length() / 2) - 1;
char r = words[0].charAt(mitad);
char r = words[0].charAt(mitad);
char r2 = words[0].charAt(mitad + 1);
char r2 = words[0].charAt(mitad + 1);
...
@@ -74,9 +77,11 @@ public class PictoItemViewGenerator {
...
@@ -74,9 +77,11 @@ public class PictoItemViewGenerator {
txt.append(words[0].charAt(i));
txt.append(words[0].charAt(i));
i++;
i++;
}
}
texto
=
txt
.
toString
();
texto = txt.toString();
*/
}
}
}
else
{
texto
=
words
[
0
];
}
}
return
texto
;
return
texto
;
}
}
...
@@ -94,7 +99,7 @@ public class PictoItemViewGenerator {
...
@@ -94,7 +99,7 @@ public class PictoItemViewGenerator {
int
height
=
bitmap
.
getHeight
();
//Alto original
int
height
=
bitmap
.
getHeight
();
//Alto original
String
texto
=
format_legend
(
picto
);
String
texto
=
format_legend
(
picto
);
if
(
picto
.
get_legend
().
equals
(
"normal"
))
{
//Normal legend
/*
if(picto.get_legend().equals("normal")) { //Normal legend
android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig();
android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig();
if (bitmapConfig == null) {
if (bitmapConfig == null) {
...
@@ -123,7 +128,7 @@ public class PictoItemViewGenerator {
...
@@ -123,7 +128,7 @@ public class PictoItemViewGenerator {
textView.setDrawingCacheEnabled(true);
textView.setDrawingCacheEnabled(true);
canvas.drawBitmap(textView.getDrawingCache(), 0, 50, null);
canvas.drawBitmap(textView.getDrawingCache(), 0, 50, null);
}
else
{
}else{
*/
//Only legend
//Only legend
android
.
graphics
.
Bitmap
.
Config
bitmapConfig
=
bitmap
.
getConfig
();
android
.
graphics
.
Bitmap
.
Config
bitmapConfig
=
bitmap
.
getConfig
();
if
(
bitmapConfig
==
null
)
{
if
(
bitmapConfig
==
null
)
{
...
@@ -151,7 +156,7 @@ public class PictoItemViewGenerator {
...
@@ -151,7 +156,7 @@ public class PictoItemViewGenerator {
canvas
.
drawBitmap
(
textView
.
getDrawingCache
(),
0
,
25
,
null
);
canvas
.
drawBitmap
(
textView
.
getDrawingCache
(),
0
,
25
,
null
);
}
}
}
//
}
return
bitmap
;
return
bitmap
;
}
}
...
@@ -168,23 +173,28 @@ public class PictoItemViewGenerator {
...
@@ -168,23 +173,28 @@ public class PictoItemViewGenerator {
FrameLayout
layout
;
FrameLayout
layout
;
final
ImageView
pictoImage
;
final
ImageView
pictoImage
;
ImageView
redCrossImage
;
ImageView
redCrossImage
;
TextView
legend
;
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
())
{
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
())
{
layoutWrapper
=
(
RelativeLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_wrapper_big
);
layoutWrapper
=
(
RelativeLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_wrapper_big
);
layout
=
(
FrameLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_big
);
layout
=
(
FrameLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_big
);
pictoImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_image_big
);
pictoImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_image_big
);
redCrossImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_redcross_big
);
redCrossImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_redcross_big
);
legend
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text_big
);
}
else
}
else
{
{
layoutWrapper
=
(
RelativeLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_wrapper
);
layoutWrapper
=
(
RelativeLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout_wrapper
);
layout
=
(
FrameLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout
);
layout
=
(
FrameLayout
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_layout
);
pictoImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_image
);
pictoImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_image
);
redCrossImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_redcross
);
redCrossImage
=
(
ImageView
)
convertView
.
findViewById
(
R
.
id
.
picto_grid_item_redcross
);
legend
=
(
TextView
)
convertView
.
findViewById
(
R
.
id
.
legend_text
);
//legend.setHeight((int) legend.getTextSize() + 2);
}
}
layoutWrapper
.
setBackground
(
null
);
layoutWrapper
.
setBackground
(
null
);
layoutWrapper
.
setAlpha
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
?
0.25f
:
0
);
layoutWrapper
.
setAlpha
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_supervisor
()
?
0.25f
:
0
);
layout
.
setBackgroundColor
(
convertView
.
getResources
()
layout
.
setBackgroundColor
(
convertView
.
getResources
()
.
getColor
(
R
.
color
.
picto_default_background
));
.
getColor
(
R
.
color
.
picto_default_background
));
redCrossImage
.
setVisibility
(
View
.
GONE
);
redCrossImage
.
setVisibility
(
View
.
GONE
);
// pictoImage.setVisibility(View.GONE);
// pictoImage.setVisibility(View.GONE);
// layoutWrapper.setVisibility(View.GONE);
// layoutWrapper.setVisibility(View.GONE);
if
(
picto
==
null
)
{
if
(
picto
==
null
)
{
...
@@ -194,6 +204,7 @@ public class PictoItemViewGenerator {
...
@@ -194,6 +204,7 @@ public class PictoItemViewGenerator {
.
getDrawable
(
R
.
drawable
.
picto_grid_item_border
));
.
getDrawable
(
R
.
drawable
.
picto_grid_item_border
));
}
}
legend
.
setVisibility
(
View
.
GONE
);
}
else
{
}
else
{
if
(!
picto
.
is_invisible
())
{
if
(!
picto
.
is_invisible
())
{
layoutWrapper
.
setAlpha
(
1.00f
);
layoutWrapper
.
setAlpha
(
1.00f
);
...
@@ -203,7 +214,14 @@ public class PictoItemViewGenerator {
...
@@ -203,7 +214,14 @@ public class PictoItemViewGenerator {
Bitmap
bm
=
picto
.
get_bitmap
(
PCBcontext
.
getContext
());
Bitmap
bm
=
picto
.
get_bitmap
(
PCBcontext
.
getContext
());
if
(!
picto
.
get_legend
().
equals
(
"none"
))
{
if
(!
picto
.
get_legend
().
equals
(
"none"
))
{
bm
=
set_legend
(
PCBcontext
.
getContext
(),
bm
,
picto
);
if
(
picto
.
get_legend
().
equals
(
"normal"
)){
legend
.
setText
(
format_legend
(
picto
));
legend
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
bm
=
set_legend
(
PCBcontext
.
getContext
(),
bm
,
picto
);
}
}
else
{
legend
.
setVisibility
(
View
.
GONE
);
}
}
pictoImage
.
setImageBitmap
(
bm
);
pictoImage
.
setImageBitmap
(
bm
);
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/picto_grid_item.xml
View file @
614b18cc
...
@@ -19,6 +19,18 @@
...
@@ -19,6 +19,18 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
<TextView
android:text=
"Legend"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/legend_text"
android:textSize=
"11sp"
android:textColor=
"@android:color/black"
android:layout_gravity=
"bottom"
android:textAlignment=
"center"
android:visibility=
"gone"
android:background=
"@android:color/white"
/>
<ImageView
<ImageView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/picto_grid_item_big.xml
View file @
614b18cc
...
@@ -19,6 +19,18 @@
...
@@ -19,6 +19,18 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
<TextView
android:text=
"Legend"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/legend_text_big"
android:textSize=
"13sp"
android:textColor=
"@android:color/black"
android:layout_gravity=
"bottom"
android:textAlignment=
"center"
android:visibility=
"gone"
android:background=
"@android:color/white"
/>
<ImageView
<ImageView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
...
...
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