Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
d95710d1
Commit
d95710d1
authored
Mar 05, 2019
by
kareemhamdy500
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IMPROVEMENT] Hide the drawing toolbar while drawing after formating
parent
01662b9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
DrawActivity.kt
...ain/java/chat/rocket/android/draw/main/ui/DrawActivity.kt
+29
-27
No files found.
draw/src/main/java/chat/rocket/android/draw/main/ui/DrawActivity.kt
View file @
d95710d1
...
@@ -41,13 +41,13 @@ class DrawingActivity : DaggerAppCompatActivity(), DrawView {
...
@@ -41,13 +41,13 @@ class DrawingActivity : DaggerAppCompatActivity(), DrawView {
override
fun
showWrongProcessingMessage
()
{
override
fun
showWrongProcessingMessage
()
{
Toast
.
makeText
(
this
,
getText
(
R
.
string
.
msg_wrong_processing_draw_image
),
Toast
.
LENGTH_SHORT
)
Toast
.
makeText
(
this
,
getText
(
R
.
string
.
msg_wrong_processing_draw_image
),
Toast
.
LENGTH_SHORT
)
.
show
()
.
show
()
}
}
private
fun
setupListeners
()
{
private
fun
setupListeners
()
{
custom_draw_view
.
setOnClickListener
{
toggleCompleteDrawTools
(
draw_tools
,
false
)}
custom_draw_view
.
setOnClickListener
{
toggleCompleteDrawTools
(
draw_tools
,
false
)
}
image_show_drawing_tool
.
setOnClickListener
{
toggleCompleteDrawTools
(
draw_tools
)
}
image_show_drawing_tool
.
setOnClickListener
{
toggleCompleteDrawTools
(
draw_tools
)
}
image_close_drawing
.
setOnClickListener
{
finish
()
}
image_close_drawing
.
setOnClickListener
{
finish
()
}
...
@@ -107,71 +107,73 @@ class DrawingActivity : DaggerAppCompatActivity(), DrawView {
...
@@ -107,71 +107,73 @@ class DrawingActivity : DaggerAppCompatActivity(), DrawView {
}
}
private
fun
toggleDrawTools
(
view
:
View
,
showView
:
Boolean
=
true
,
all_show
:
Boolean
=
true
)
{
private
fun
toggleDrawTools
(
view
:
View
,
showView
:
Boolean
=
true
,
all_show
:
Boolean
=
true
)
{
if
(
showView
)
if
(
showView
)
{
view
.
animate
().
translationY
((
0
).
toPx
)
view
.
animate
().
translationY
((
0
).
toPx
)
else
}
else
{
view
.
animate
().
translationY
((
56
).
toPx
)
view
.
animate
().
translationY
((
56
).
toPx
)
}
}
}
private
fun
toggleCompleteDrawTools
(
view
:
View
,
showView
:
Boolean
=
true
)
{
private
fun
toggleCompleteDrawTools
(
view
:
View
,
showView
:
Boolean
=
true
)
{
if
(
view
.
translationY
==
(
112
).
toPx
&&
showView
)
if
(
view
.
translationY
==
(
112
).
toPx
&&
showView
)
{
toggleDrawTools
(
draw_tools
,
false
)
toggleDrawTools
(
draw_tools
,
false
)
else
}
else
{
view
.
animate
().
translationY
((
112
).
toPx
)
view
.
animate
().
translationY
((
112
).
toPx
)
}
}
}
private
fun
colorSelector
()
{
private
fun
colorSelector
()
{
image_color_red
.
setOnClickListener
{
image_color_red
.
setOnClickListener
{
custom_draw_view
.
setColor
(
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_red
,
null
)
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_red
,
null
)
)
)
scaleColorView
(
image_color_red
)
scaleColorView
(
image_color_red
)
}
}
image_color_yellow
.
setOnClickListener
{
image_color_yellow
.
setOnClickListener
{
custom_draw_view
.
setColor
(
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
ResourcesCompat
.
getColor
(
resources
,
resources
,
R
.
color
.
color_yellow
,
null
R
.
color
.
color_yellow
,
null
)
)
)
)
scaleColorView
(
image_color_yellow
)
scaleColorView
(
image_color_yellow
)
}
}
image_color_green
.
setOnClickListener
{
image_color_green
.
setOnClickListener
{
custom_draw_view
.
setColor
(
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
ResourcesCompat
.
getColor
(
resources
,
resources
,
R
.
color
.
color_green
,
null
R
.
color
.
color_green
,
null
)
)
)
)
scaleColorView
(
image_color_green
)
scaleColorView
(
image_color_green
)
}
}
image_color_blue
.
setOnClickListener
{
image_color_blue
.
setOnClickListener
{
custom_draw_view
.
setColor
(
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_blue
,
null
)
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_blue
,
null
)
)
)
scaleColorView
(
image_color_blue
)
scaleColorView
(
image_color_blue
)
}
}
image_color_pink
.
setOnClickListener
{
image_color_pink
.
setOnClickListener
{
custom_draw_view
.
setColor
(
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
ResourcesCompat
.
getColor
(
resources
,
resources
,
R
.
color
.
color_pink
,
null
R
.
color
.
color_pink
,
null
)
)
)
)
scaleColorView
(
image_color_pink
)
scaleColorView
(
image_color_pink
)
}
}
image_color_brown
.
setOnClickListener
{
image_color_brown
.
setOnClickListener
{
custom_draw_view
.
setColor
(
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
ResourcesCompat
.
getColor
(
resources
,
resources
,
R
.
color
.
color_brown
,
null
R
.
color
.
color_brown
,
null
)
)
)
)
scaleColorView
(
image_color_brown
)
scaleColorView
(
image_color_brown
)
}
}
...
...
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