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
01662b9e
Commit
01662b9e
authored
Mar 04, 2019
by
kareemhamdy500
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IMPROVEMENT Hide the drawing toolbar while drawing
parent
cf7ffd51
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
52 deletions
+56
-52
build.gradle
app/build.gradle
+0
-27
DrawActivity.kt
...ain/java/chat/rocket/android/draw/main/ui/DrawActivity.kt
+34
-23
CustomDrawView.kt
...in/java/chat/rocket/android/draw/widget/CustomDrawView.kt
+2
-2
ic_draw_tools_shwoing_24dp.xml
draw/src/main/res/drawable/ic_draw_tools_shwoing_24dp.xml
+5
-0
activity_drawing.xml
draw/src/main/res/layout/activity_drawing.xml
+15
-0
No files found.
app/build.gradle
View file @
01662b9e
...
...
@@ -10,8 +10,6 @@ apply plugin: "com.github.ben-manes.versions"
android
{
compileSdkVersion
versions
.
compileSdk
buildToolsVersion
versions
.
buildTools
defaultConfig
{
applicationId
"chat.rocket.android"
minSdkVersion
versions
.
minSdk
...
...
@@ -31,7 +29,6 @@ android {
}
}
}
signingConfigs
{
release
{
storeFile
project
.
rootProject
.
file
(
'Rocket.jks'
).
getCanonicalFile
()
...
...
@@ -47,7 +44,6 @@ android {
keyPassword
"android"
}
}
buildTypes
{
release
{
buildConfigField
"String"
,
"REQUIRED_SERVER_VERSION"
,
'"0.62.0"'
...
...
@@ -64,9 +60,7 @@ android {
applicationIdSuffix
".dev"
}
}
flavorDimensions
"type"
productFlavors
{
// includes proprietary libs
play
{
...
...
@@ -78,7 +72,6 @@ android {
dimension
"type"
}
}
packagingOptions
{
exclude
'META-INF/core.kotlin_module'
exclude
'META-INF/main.kotlin_module'
...
...
@@ -87,81 +80,61 @@ android {
dependencies
{
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
project
(
':player'
)
implementation
project
(
':emoji'
)
implementation
project
(
':draw'
)
implementation
project
(
':util'
)
implementation
project
(
':core'
)
implementation
project
(
':suggestions'
)
implementation
libraries
.
kotlin
implementation
libraries
.
coroutines
implementation
libraries
.
coroutinesAndroid
implementation
libraries
.
appCompat
implementation
libraries
.
recyclerview
implementation
libraries
.
constraintlayout
implementation
libraries
.
cardview
implementation
libraries
.
browser
implementation
libraries
.
androidKtx
implementation
libraries
.
fragmentsKtx
implementation
libraries
.
dagger
implementation
libraries
.
daggerSupport
kapt
libraries
.
daggerProcessor
kapt
libraries
.
daggerAndroidApt
implementation
libraries
.
flexbox
implementation
libraries
.
material
implementation
libraries
.
room
kapt
libraries
.
roomProcessor
implementation
libraries
.
lifecycleExtensions
kapt
libraries
.
lifecycleCompiler
implementation
libraries
.
viewmodelKtx
implementation
libraries
.
workmanager
implementation
libraries
.
rxKotlin
implementation
libraries
.
rxAndroid
implementation
libraries
.
moshi
implementation
libraries
.
okhttp
implementation
libraries
.
okhttpLogger
implementation
libraries
.
timber
implementation
libraries
.
threeTenABP
implementation
libraries
.
fresco
api
libraries
.
frescoOkHttp
implementation
libraries
.
frescoAnimatedGif
implementation
libraries
.
frescoWebP
implementation
libraries
.
frescoAnimatedWebP
implementation
libraries
.
glide
implementation
libraries
.
glideTransformations
kapt
libraries
.
kotshiCompiler
implementation
libraries
.
kotshiApi
implementation
libraries
.
frescoImageViewer
implementation
libraries
.
markwon
implementation
libraries
.
aVLoadingIndicatorView
implementation
libraries
.
livedataKtx
implementation
'com.google.code.findbugs:jsr305:3.0.2'
// Proprietary libraries
playImplementation
libraries
.
fcm
playImplementation
libraries
.
firebaseAnalytics
playImplementation
libraries
.
playServicesAuth
playImplementation
(
'com.crashlytics.sdk.android:crashlytics:2.9.5@aar'
)
{
transitive
=
true
}
playImplementation
(
'com.crashlytics.sdk.android:answers:1.4.3@aar'
)
{
transitive
=
true
}
testImplementation
libraries
.
junit
testImplementation
libraries
.
truth
androidTestImplementation
libraries
.
espressoCore
...
...
draw/src/main/java/chat/rocket/android/draw/main/ui/DrawActivity.kt
View file @
01662b9e
...
...
@@ -41,10 +41,14 @@ class DrawingActivity : DaggerAppCompatActivity(), DrawView {
override
fun
showWrongProcessingMessage
()
{
Toast
.
makeText
(
this
,
getText
(
R
.
string
.
msg_wrong_processing_draw_image
),
Toast
.
LENGTH_SHORT
)
.
show
()
.
show
()
}
private
fun
setupListeners
()
{
custom_draw_view
.
setOnClickListener
{
toggleCompleteDrawTools
(
draw_tools
,
false
)}
image_show_drawing_tool
.
setOnClickListener
{
toggleCompleteDrawTools
(
draw_tools
)}
image_close_drawing
.
setOnClickListener
{
finish
()
}
image_send_drawing
.
setOnClickListener
{
...
...
@@ -102,65 +106,72 @@ class DrawingActivity : DaggerAppCompatActivity(), DrawView {
}
}
private
fun
toggleDrawTools
(
view
:
View
,
showView
:
Boolean
=
true
)
{
if
(
showView
)
{
private
fun
toggleDrawTools
(
view
:
View
,
showView
:
Boolean
=
true
,
all_show
:
Boolean
=
true
)
{
if
(
showView
)
view
.
animate
().
translationY
((
0
).
toPx
)
}
else
{
else
view
.
animate
().
translationY
((
56
).
toPx
)
}
}
private
fun
toggleCompleteDrawTools
(
view
:
View
,
showView
:
Boolean
=
true
)
{
if
(
view
.
translationY
==
(
112
).
toPx
&&
showView
)
toggleDrawTools
(
draw_tools
,
false
)
else
view
.
animate
().
translationY
((
112
).
toPx
)
}
private
fun
colorSelector
()
{
image_color_red
.
setOnClickListener
{
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_red
,
null
)
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_red
,
null
)
)
scaleColorView
(
image_color_red
)
}
image_color_yellow
.
setOnClickListener
{
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_yellow
,
null
)
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_yellow
,
null
)
)
scaleColorView
(
image_color_yellow
)
}
image_color_green
.
setOnClickListener
{
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_green
,
null
)
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_green
,
null
)
)
scaleColorView
(
image_color_green
)
}
image_color_blue
.
setOnClickListener
{
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_blue
,
null
)
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_blue
,
null
)
)
scaleColorView
(
image_color_blue
)
}
image_color_pink
.
setOnClickListener
{
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_pink
,
null
)
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_pink
,
null
)
)
scaleColorView
(
image_color_pink
)
}
image_color_brown
.
setOnClickListener
{
custom_draw_view
.
setColor
(
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_brown
,
null
)
ResourcesCompat
.
getColor
(
resources
,
R
.
color
.
color_brown
,
null
)
)
scaleColorView
(
image_color_brown
)
}
...
...
draw/src/main/java/chat/rocket/android/draw/widget/CustomDrawView.kt
View file @
01662b9e
...
...
@@ -159,9 +159,9 @@ class CustomDrawView(context: Context, attrs: AttributeSet) : View(context, attr
}
override
fun
onTouchEvent
(
event
:
MotionEvent
):
Boolean
{
super
.
onTouchEvent
(
event
)
val
x
=
event
.
x
val
y
=
event
.
y
when
(
event
.
action
)
{
MotionEvent
.
ACTION_DOWN
->
{
mStartX
=
x
...
...
@@ -172,8 +172,8 @@ class CustomDrawView(context: Context, attrs: AttributeSet) : View(context, attr
MotionEvent
.
ACTION_MOVE
->
actionMove
(
x
,
y
)
MotionEvent
.
ACTION_UP
->
actionUp
()
}
invalidate
()
return
true
}
}
\ No newline at end of file
draw/src/main/res/drawable/ic_draw_tools_shwoing_24dp.xml
0 → 100644
View file @
01662b9e
<vector
android:autoMirrored=
"true"
android:height=
"24dp"
android:viewportHeight=
"24.0"
android:viewportWidth=
"24.0"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"
/>
</vector>
draw/src/main/res/layout/activity_drawing.xml
View file @
01662b9e
...
...
@@ -28,6 +28,21 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/image_show_drawing_tool"
android:layout_width=
"56dp"
android:layout_height=
"56dp"
android:layout_marginStart=
"8dp"
android:layout_marginEnd=
"8dp"
android:background=
"@color/color_white"
android:foreground=
"?selectableItemBackgroundBorderless"
android:padding=
"16dp"
android:src=
"@drawable/ic_draw_tools_shwoing_24dp"
android:tint=
"@color/icon_color"
app:layout_constraintEnd_toStartOf=
"@+id/image_send_drawing"
app:layout_constraintStart_toEndOf=
"@+id/image_close_drawing"
app:layout_constraintTop_toTopOf=
"@+id/custom_draw_view"
/>
<ImageView
android:id=
"@+id/image_send_drawing"
android:layout_width=
"56dp"
...
...
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