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
42b3ba10
authored
Jan 19, 2017
by
German Callejas
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Submenu para editar pictos añadido, funcionando el cambiar la etiqueta(leyenda)
parent
94e87157
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
24 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/RadialMenuWidget.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
View file @
42b3ba10
...
...
@@ -31,6 +31,7 @@ import android.view.KeyEvent;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewParent
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.animation.AccelerateDecelerateInterpolator
;
...
...
@@ -1277,7 +1278,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
//Parameters for hide navigation bar when u save or cancel
final
View
decorView
=
getWindow
().
getDecorView
();
final
int
uiOptions
=
View
.
SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
View
.
SYSTEM_UI_FLAG_FULLSCREEN
;
/*| View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE*/
;
final
EditText
leyenda
=
new
EditText
(
PCBcontext
.
getContext
());
leyenda
.
setBackgroundColor
(
rgb
(
221
,
221
,
211
));
...
...
@@ -1285,11 +1286,11 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
leyenda
.
setMaxLines
(
1
);
leyenda
.
setClickable
(
true
);
leyenda
.
setTextSize
(
25
);
leyenda
.
setX
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
widthPixels
/
2
-
4
00
);
leyenda
.
setX
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
widthPixels
/
2
-
3
00
);
leyenda
.
setY
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
heightPixels
/
2
-
50
);
leyenda
.
setTextColor
(
BLACK
);
if
(
picto
.
get_translation
()!=
null
){
leyenda
.
setText
(
picto
.
get_translation
());
if
(
picto
.
get_translation
()!=
null
&&
picto
!=
null
){
leyenda
.
setText
(
picto
.
get_translation
());
}
else
{
leyenda
.
setText
(
"Sin Descripción"
);
}
...
...
@@ -1301,7 +1302,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
ImageButton
botonOk
=
new
ImageButton
(
PCBcontext
.
getContext
());
botonOk
.
setImageResource
(
android
.
R
.
drawable
.
ic_menu_save
);
botonOk
.
setX
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
widthPixels
/
2
+
10
);
botonOk
.
setX
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
widthPixels
/
2
+
1
1
0
);
botonOk
.
setY
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
heightPixels
/
2
-
50
);
botonOk
.
setBackgroundColor
(
rgb
(
221
,
221
,
221
));
botonOk
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
@@ -1316,14 +1317,16 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
}
getCurrentPictoGridAdapter
().
notifyDataSetChanged
();
ll
.
setVisibility
(
View
.
GONE
);
ll
.
removeAllViewsInLayout
();
//Hide navigation bar
//PictogramActivity.this.refresh();
decorView
.
setSystemUiVisibility
(
uiOptions
);
}
});
ImageButton
botonSalir
=
new
ImageButton
(
PCBcontext
.
getContext
());
botonSalir
.
setImageResource
(
android
.
R
.
drawable
.
ic_menu_close_clear_cancel
);
botonSalir
.
setX
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
widthPixels
/
2
+
8
0
);
botonSalir
.
setX
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
widthPixels
/
2
+
15
0
);
botonSalir
.
setY
(
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
heightPixels
/
2
-
50
);
botonSalir
.
setBackgroundColor
(
rgb
(
221
,
221
,
221
));
botonSalir
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
@@ -1331,7 +1334,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
void
onClick
(
View
v
)
{
imm
.
hideSoftInputFromWindow
(
leyenda
.
getWindowToken
(),
0
);
ll
.
setVisibility
(
View
.
GONE
);
ll
.
removeAllViewsInLayout
();
//Hide navigation bar
//PictogramActivity.this.refresh();
decorView
.
setSystemUiVisibility
(
uiOptions
);
}
});
...
...
@@ -1356,7 +1361,6 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
ll
.
setBackgroundColor
(
argb
(
180
,
0
,
0
,
0
));
detail
=
new
ImageView
(
PCBcontext
.
getContext
());
int
centerX
=
PictogramActivity
.
this
.
getResources
().
getDisplayMetrics
().
widthPixels
/
2
;
...
...
@@ -1414,6 +1418,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
ll
.
setVisibility
(
View
.
GONE
);
((
RelativeLayout
)
PieMenu
.
getParent
()).
removeView
(
PieMenu
);
}
public
void
menuDisabled
(){}
}
//Disable menu button
...
...
@@ -1434,6 +1439,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
ll
.
setVisibility
(
View
.
GONE
);
((
RelativeLayout
)
PieMenu
.
getParent
()).
removeView
(
PieMenu
);
}
public
void
menuDisabled
(){}
}
//Change image of picto menu button
...
...
@@ -1455,6 +1461,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
ll
.
setVisibility
(
View
.
GONE
);
((
RelativeLayout
)
PieMenu
.
getParent
()).
removeView
(
PieMenu
);
}
public
void
menuDisabled
(){}
}
//Activate/enable picto on vocabulary menu button
...
...
@@ -1476,6 +1483,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
ll
.
setVisibility
(
View
.
GONE
);
((
RelativeLayout
)
PieMenu
.
getParent
()).
removeView
(
PieMenu
);
}
public
void
menuDisabled
(){}
}
//Edit menu button
...
...
@@ -1488,12 +1496,15 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
String
getName
()
{
return
"edit"
;
}
public
String
getLabel
()
{
return
null
;
}
public
int
getIcon
()
{
return
R
.
drawable
.
edit
;
}
private
List
<
RadialMenuWidget
.
RadialMenuEntry
>
children
=
new
ArrayList
<>(
Arrays
.
asList
(
new
EditTextPicto
(
this
.
p
),
new
EditImage
(
this
.
p
)))
;
private
List
<
RadialMenuWidget
.
RadialMenuEntry
>
children
;
public
List
<
RadialMenuWidget
.
RadialMenuEntry
>
getChildren
()
{
return
children
;
}
public
void
menuActiviated
()
{
/**TODO: Llamar a la interfaz de editar foto y leyenda*/
Toast
.
makeText
(
PCBcontext
.
getContext
(),
"Editar Picto"
,
Toast
.
LENGTH_SHORT
).
show
();
ll
.
getChildAt
(
1
).
setX
(
ll
.
getChildAt
(
1
).
getX
()
+
30
);
children
=
new
ArrayList
<>(
Arrays
.
asList
(
new
EditTextPicto
(
p
),
new
EditImage
(
p
)));
}
public
void
menuDisabled
(){
ll
.
getChildAt
(
1
).
setX
(
ll
.
getChildAt
(
1
).
getX
()
-
30
);
}
}
...
...
@@ -1510,11 +1521,11 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
List
<
RadialMenuWidget
.
RadialMenuEntry
>
getChildren
()
{
return
null
;
}
public
void
menuActiviated
()
{
Toast
.
makeText
(
PCBcontext
.
getContext
(),
"Editar Texto"
,
Toast
.
LENGTH_SHORT
).
show
();
ll
.
setVisibility
(
View
.
GONE
);
((
RelativeLayout
)
PieMenu
.
getParent
()).
removeView
(
PieMenu
);
ll
.
removeAllViewsInLayout
(
);
createViewForExpression
(
this
.
p
);
}
public
void
menuDisabled
(){}
}
public
class
EditImage
implements
RadialMenuWidget
.
RadialMenuEntry
...
...
@@ -1532,6 +1543,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
/**TODO: Llamar a la interfaz de editar foto*/
Toast
.
makeText
(
PCBcontext
.
getContext
(),
"Editar Imagen"
,
Toast
.
LENGTH_SHORT
).
show
();
}
public
void
menuDisabled
(){}
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/RadialMenuWidget.java
View file @
42b3ba10
...
...
@@ -36,13 +36,15 @@ public class RadialMenuWidget extends View {
int
getIcon
();
List
<
RadialMenuEntry
>
getChildren
();
void
menuActiviated
();
void
menuDisabled
();
}
private
List
<
RadialMenuEntry
>
menuEntries
=
new
ArrayList
<
RadialMenuEntry
>();
private
List
<
RadialMenuEntry
>
menuEntries2
=
new
ArrayList
<
RadialMenuEntry
>();
private
RadialMenuEntry
centerCircle
=
null
;
private
int
variable
;
private
boolean
pulsed
=
false
;
private
int
variable
;
//For know which submenu button was click
private
float
screen_density
=
getContext
().
getResources
().
getDisplayMetrics
().
density
;
private
int
defaultColor
=
Color
.
rgb
(
221
,
221
,
211
);
//default color of wedge pieces
...
...
@@ -219,10 +221,11 @@ public class RadialMenuWidget extends View {
if
(
enabled
!=
null
)
{
enabled
=
null
;
animateOuterIn
=
true
;
//sets Wedge2Shown = false;
menuEntries
.
get
(
variable
).
menuDisabled
();
//If outer ring is not enabled, then executes event
}
else
{
menuEntries
.
get
(
i
).
menuActiviated
();
menuEntries
.
get
(
i
).
menuActiviated
();
variable
=
i
;
//Figures out how many outer rings
if
(
menuEntries
.
get
(
i
).
getChildren
()
!=
null
)
{
...
...
@@ -239,16 +242,16 @@ public class RadialMenuWidget extends View {
}
}
else
if
(
selected2
!=
null
){
for
(
int
i
=
0
;
i
<
Wedges2
.
length
;
i
++)
{
//for (int j = 0; j < menuEntries.get(i).getChildren().size(); j++) {
Wedge
f
=
Wedges2
[
i
];
if
(
f
==
selected2
)
{
animateOuterIn
=
true
;
//sets Wedge2Shown = false
;
enabl
ed
=
null
;
selected
=
null
;
menuEntries
.
get
(
variable
).
getChildren
().
get
(
i
).
menuActiviated
();
}
//
}
Wedge
f
=
Wedges2
[
i
];
if
(
f
==
selected2
)
{
animateOuterIn
=
true
;
//sets Wedge2Shown = false;
enabled
=
null
;
select
ed
=
null
;
menuEntries
.
get
(
variable
).
getChildren
().
get
(
i
).
menuActiviated
();
}
}
}
else
{
//This is when something outside the circle or any of the rings is selected
...
...
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