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
e2469712
Commit
e2469712
authored
May 07, 2019
by
Hussein El Feky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored code
parent
a346b70e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
DrawableHelper.kt
app/src/main/java/chat/rocket/android/app/DrawableHelper.kt
+12
-12
No files found.
app/src/main/java/chat/rocket/android/app/DrawableHelper.kt
View file @
e2469712
...
...
@@ -86,10 +86,10 @@ object DrawableHelper {
return
}
else
{
for
(
i
in
textView
.
indices
)
{
if
(
textView
[
i
].
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_LTR
)
{
textView
[
i
].
setCompoundDrawablesWithIntrinsicBounds
(
drawables
[
i
],
null
,
null
,
null
)
}
else
{
if
(
textView
[
i
].
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_RTL
)
{
textView
[
i
].
setCompoundDrawablesWithIntrinsicBounds
(
null
,
null
,
drawables
[
i
],
null
)
}
else
{
textView
[
i
].
setCompoundDrawablesWithIntrinsicBounds
(
drawables
[
i
],
null
,
null
,
null
)
}
}
}
...
...
@@ -103,10 +103,10 @@ object DrawableHelper {
* @see compoundDrawables
*/
fun
compoundStartDrawable
(
textView
:
TextView
,
drawable
:
Drawable
)
=
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_LTR
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
drawable
,
null
,
null
,
null
)
}
else
{
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_RTL
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
null
,
null
,
drawable
,
null
)
}
else
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
drawable
,
null
,
null
,
null
)
}
/**
...
...
@@ -117,10 +117,10 @@ object DrawableHelper {
* @see compoundStartDrawable
*/
fun
compoundEndDrawable
(
textView
:
TextView
,
drawable
:
Drawable
)
=
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_LTR
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
null
,
null
,
drawable
,
null
)
}
else
{
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_RTL
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
drawable
,
null
,
null
,
null
)
}
else
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
null
,
null
,
drawable
,
null
)
}
/**
...
...
@@ -136,10 +136,10 @@ object DrawableHelper {
startDrawable
:
Drawable
,
endDrawable
:
Drawable
)
=
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_LTR
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
startDrawable
,
null
,
endDrawable
,
null
)
}
else
{
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_RTL
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
endDrawable
,
null
,
startDrawable
,
null
)
}
else
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
startDrawable
,
null
,
endDrawable
,
null
)
}
/**
...
...
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