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
3ef05550
authored
Dec 23, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on PCB issues
parent
9371a190
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictoItemViewGenerator.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
android/Pictogram/tabletlibrary/src/main/res/layout/picto_grid_item_big.xml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictoItemViewGenerator.java
View file @
3ef05550
...
@@ -165,7 +165,8 @@ public class PictoItemViewGenerator {
...
@@ -165,7 +165,8 @@ public class PictoItemViewGenerator {
if
(
convertView
==
null
)
{
if
(
convertView
==
null
)
{
convertView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
LAYOUT_BIG
:
LAYOUT
,
parent
,
false
);
convertView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
is_picto_size_big
()
?
LAYOUT_BIG
:
LAYOUT
,
parent
,
false
);
}
}
if
(
parent
.
getId
()==
R
.
id
.
tape_grid_view
)
convertView
.
setPadding
(
0
,
0
,
0
,
0
);
RelativeLayout
layoutWrapper
;
RelativeLayout
layoutWrapper
;
FrameLayout
layout
;
FrameLayout
layout
;
final
ImageView
pictoImage
;
final
ImageView
pictoImage
;
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
View file @
3ef05550
...
@@ -11,6 +11,7 @@ import android.content.DialogInterface;
...
@@ -11,6 +11,7 @@ import android.content.DialogInterface;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.database.Cursor
;
import
android.database.Cursor
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.graphics.ColorFilter
;
import
android.graphics.PorterDuff
;
import
android.graphics.PorterDuff
;
import
android.media.Ringtone
;
import
android.media.Ringtone
;
import
android.media.RingtoneManager
;
import
android.media.RingtoneManager
;
...
@@ -213,8 +214,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
...
@@ -213,8 +214,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
Log
.
i
(
PictogramActivity
.
class
.
getCanonicalName
(),
" Deleting item "
+
position
+
"-"
+
id
+
"("
+
PictogramActivity
.
this
.
tapeAdapter
.
getItem
(
position
).
get_translation
()
+
")"
);
Log
.
i
(
PictogramActivity
.
class
.
getCanonicalName
(),
" Deleting item "
+
position
+
"-"
+
id
+
"("
+
PictogramActivity
.
this
.
tapeAdapter
.
getItem
(
position
).
get_translation
()
+
")"
);
ImageView
pictov
=((
ImageView
)((
FrameLayout
)((
RelativeLayout
)
view
).
getChildAt
(
0
)).
getChildAt
(
0
));
animateImageView
(
view
,
position
);
animateImageView
(
pictov
,
position
);
PictogramActivity
.
this
.
tapeAdapter
.
notifyDataSetChanged
();
PictogramActivity
.
this
.
tapeAdapter
.
notifyDataSetChanged
();
PCBcontext
.
getActionLog
().
log
(
new
TalkAction
(
TalkAction
.
DELETE
,
PictogramActivity
.
this
.
tapeAdapter
.
getItem
(
position
)));
PCBcontext
.
getActionLog
().
log
(
new
TalkAction
(
TalkAction
.
DELETE
,
PictogramActivity
.
this
.
tapeAdapter
.
getItem
(
position
)));
}});
}});
...
@@ -1116,13 +1116,16 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
...
@@ -1116,13 +1116,16 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
void
animateImageView
(
final
ImageView
v
,
final
int
position
)
{
public
void
animateImageView
(
View
view
,
final
int
position
)
{
if
(
PictogramActivity
.
this
.
deleting
)
return
;
if
(
PictogramActivity
.
this
.
deleting
)
return
;
View
borderlayout
=((
RelativeLayout
)
view
).
getChildAt
(
0
);
final
ImageView
v
=((
ImageView
)((
FrameLayout
)
borderlayout
).
getChildAt
(
0
));
final
int
orange
=
ContextCompat
.
getColor
(
PCBcontext
.
getContext
(),
R
.
color
.
picto_default_background
);
// final int orange = ContextCompat.getColor(PCBcontext.getContext(),R.color.picto_default_background);
final
int
orange
=
ContextCompat
.
getColor
(
PCBcontext
.
getContext
(),
R
.
color
.
red
);
final
ValueAnimator
colorAnim
=
ObjectAnimator
.
ofFloat
(
0
f
,
1
f
);
final
ValueAnimator
colorAnim
=
ObjectAnimator
.
ofFloat
(
0
f
,
1
f
);
colorAnim
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
colorAnim
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
...
@@ -1130,8 +1133,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
...
@@ -1130,8 +1133,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
void
onAnimationUpdate
(
ValueAnimator
animation
)
{
public
void
onAnimationUpdate
(
ValueAnimator
animation
)
{
float
mul
=
(
Float
)
animation
.
getAnimatedValue
();
float
mul
=
(
Float
)
animation
.
getAnimatedValue
();
int
alphaOrange
=
adjustAlpha
(
orange
,
mul
);
int
alphaOrange
=
adjustAlpha
(
orange
,
mul
);
v
.
setBackgroundColor
(
alphaOrange
);
v
.
setColorFilter
(
alphaOrange
,
PorterDuff
.
Mode
.
SRC_ATOP
);
v
.
setColorFilter
(
alphaOrange
,
PorterDuff
.
Mode
.
SRC_ATOP
);
v
.
setBackgroundColor
(
alphaOrange
);
v
.
setPadding
(
0
,
0
,
0
,
0
);
if
(
mul
==
0.0
)
{
if
(
mul
==
0.0
)
{
v
.
setColorFilter
(
0
);
v
.
setColorFilter
(
0
);
}
}
...
@@ -1152,6 +1156,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
...
@@ -1152,6 +1156,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
tapeAdapter
.
deleteItem
(
position
);
tapeAdapter
.
deleteItem
(
position
);
tapeAdapter
.
notifyDataSetChanged
();
tapeAdapter
.
notifyDataSetChanged
();
v
.
setColorFilter
(
0
);
v
.
setColorFilter
(
0
);
v
.
setBackgroundColor
(
ContextCompat
.
getColor
(
PCBcontext
.
getContext
(),
R
.
color
.
picto_default_background
));
PictogramActivity
.
this
.
deleting
=
false
;
PictogramActivity
.
this
.
deleting
=
false
;
}
}
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/picto_grid_item_big.xml
View file @
3ef05550
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
android:layout_height=
"@dimen/picto_big_height"
android:layout_height=
"@dimen/picto_big_height"
android:id=
"@+id/picto_grid_item_layout_big"
android:id=
"@+id/picto_grid_item_layout_big"
android:background=
"@color/picto_default_background"
android:background=
"@color/picto_default_background"
android:padding=
"@dimen/picto_padding"
>
>
<ImageView
<ImageView
android:id=
"@+id/picto_grid_item_image_big"
android:id=
"@+id/picto_grid_item_image_big"
...
...
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