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
ad802c4d
Commit
ad802c4d
authored
May 04, 2019
by
Hussein El Feky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed DrawableHelper methods
parent
3d40cb71
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
34 deletions
+34
-34
DrawableHelper.kt
app/src/main/java/chat/rocket/android/app/DrawableHelper.kt
+17
-17
RegisterUsernameFragment.kt
...ntication/registerusername/ui/RegisterUsernameFragment.kt
+1
-1
ChatDetailsFragment.kt
...chat/rocket/android/chatdetails/ui/ChatDetailsFragment.kt
+1
-1
ChatRoomActivity.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomActivity.kt
+1
-1
DirectoryFragment.kt
...ava/chat/rocket/android/directory/ui/DirectoryFragment.kt
+2
-2
DirectorySortingBottomSheetFragment.kt
...droid/directory/ui/DirectorySortingBottomSheetFragment.kt
+6
-6
SortingAndGroupingBottomSheetFragment.kt
...ngandgrouping/ui/SortingAndGroupingBottomSheetFragment.kt
+6
-6
No files found.
app/src/main/java/chat/rocket/android/app/DrawableHelper.kt
View file @
ad802c4d
...
...
@@ -73,13 +73,13 @@ object DrawableHelper {
DrawableCompat
.
setTint
(
drawable
,
ContextCompat
.
getColor
(
context
,
resId
))
/**
* Compounds an array of Drawable (to appear
to the left of the
text) into an array of TextView.
* Compounds an array of Drawable (to appear
on the start side of a
text) into an array of TextView.
*
* REMARK: the number of elements in both array of Drawable and TextView MUST be equal.
* REMARK: the number of elements in both array
s
of Drawable and TextView MUST be equal.
*
* @param textView The array of TextView.
* @param drawables The array of Drawable.
* @see compound
Lef
tDrawable
* @see compound
Star
tDrawable
*/
fun
compoundDrawables
(
textView
:
Array
<
TextView
>,
drawables
:
Array
<
Drawable
>)
{
if
(
textView
.
size
!=
drawables
.
size
)
{
...
...
@@ -96,13 +96,13 @@ object DrawableHelper {
}
/**
* Compounds a Drawable (to appear on the
lef
t side of a text) into a TextView.
* Compounds a Drawable (to appear on the
star
t side of a text) into a TextView.
*
* @param textView The TextView.
* @param drawable The Drawable.
* @see compoundDrawables
*/
fun
compound
Lef
tDrawable
(
textView
:
TextView
,
drawable
:
Drawable
)
=
fun
compound
Star
tDrawable
(
textView
:
TextView
,
drawable
:
Drawable
)
=
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_LTR
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
drawable
,
null
,
null
,
null
)
}
else
{
...
...
@@ -110,13 +110,13 @@ object DrawableHelper {
}
/**
* Compounds a Drawable (to appear on the
right
side of a text) into a TextView.
* Compounds a Drawable (to appear on the
end
side of a text) into a TextView.
*
* @param textView The TextView.
* @param drawable The Drawable.
* @see compound
Lef
tDrawable
* @see compound
Star
tDrawable
*/
fun
compound
Right
Drawable
(
textView
:
TextView
,
drawable
:
Drawable
)
=
fun
compound
End
Drawable
(
textView
:
TextView
,
drawable
:
Drawable
)
=
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_LTR
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
null
,
null
,
drawable
,
null
)
}
else
{
...
...
@@ -124,22 +124,22 @@ object DrawableHelper {
}
/**
* Compounds a Drawable (to appear on the
left and right
side of a text) into a TextView.
* Compounds a Drawable (to appear on the
start and end
side of a text) into a TextView.
*
* @param textView The TextView.
* @param
leftDrawable The lef
t Drawable.
* @param
rightDrawable The right
Drawable.
* @see compound
Lef
tDrawable
* @param
startDrawable The star
t Drawable.
* @param
endDrawable The end
Drawable.
* @see compound
Star
tDrawable
*/
fun
compound
LeftAndRight
Drawable
(
fun
compound
StartAndEnd
Drawable
(
textView
:
TextView
,
lef
tDrawable
:
Drawable
,
right
Drawable
:
Drawable
star
tDrawable
:
Drawable
,
end
Drawable
:
Drawable
)
=
if
(
textView
.
resources
.
configuration
.
layoutDirection
==
View
.
LAYOUT_DIRECTION_LTR
)
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
leftDrawable
,
null
,
right
Drawable
,
null
)
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
startDrawable
,
null
,
end
Drawable
,
null
)
}
else
{
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
rightDrawable
,
null
,
lef
tDrawable
,
null
)
textView
.
setCompoundDrawablesWithIntrinsicBounds
(
endDrawable
,
null
,
star
tDrawable
,
null
)
}
/**
...
...
app/src/main/java/chat/rocket/android/authentication/registerusername/ui/RegisterUsernameFragment.kt
View file @
ad802c4d
...
...
@@ -140,7 +140,7 @@ class RegisterUsernameFragment : Fragment(), RegisterUsernameView {
val
atDrawable
=
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_at_black_20dp
,
it
)
DrawableHelper
.
wrapDrawable
(
atDrawable
)
DrawableHelper
.
tintDrawable
(
atDrawable
,
it
,
R
.
color
.
colorDrawableTintGrey
)
DrawableHelper
.
compound
Lef
tDrawable
(
text_username
,
atDrawable
)
DrawableHelper
.
compound
Star
tDrawable
(
text_username
,
atDrawable
)
}
}
...
...
app/src/main/java/chat/rocket/android/chatdetails/ui/ChatDetailsFragment.kt
View file @
ad802c4d
...
...
@@ -195,7 +195,7 @@ class ChatDetailsFragment : Fragment(), ChatDetailsView {
val
wrappedDrawable
=
DrawableHelper
.
wrapDrawable
(
it
)
val
mutableDrawable
=
wrappedDrawable
.
mutate
()
DrawableHelper
.
tintDrawable
(
mutableDrawable
,
context
!!
,
R
.
color
.
colorPrimary
)
DrawableHelper
.
compound
Lef
tDrawable
(
name
,
mutableDrawable
)
DrawableHelper
.
compound
Star
tDrawable
(
name
,
mutableDrawable
)
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomActivity.kt
View file @
ad802c4d
...
...
@@ -139,7 +139,7 @@ class ChatRoomActivity : AppCompatActivity(), HasSupportFragmentInjector {
}
fun
setupExpandMoreForToolbar
(
listener
:
(
View
)
->
Unit
)
{
DrawableHelper
.
compound
Right
Drawable
(
DrawableHelper
.
compound
End
Drawable
(
text_toolbar_title
,
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_chatroom_toolbar_expand_more_20dp
,
this
)
)
...
...
app/src/main/java/chat/rocket/android/directory/ui/DirectoryFragment.kt
View file @
ad802c4d
...
...
@@ -233,14 +233,14 @@ class DirectoryFragment : Fragment(), DirectoryView {
private
fun
updateSortByTitle
()
{
if
(
isSortByChannels
)
{
text_sort_by
.
text
=
getString
(
R
.
string
.
msg_channels
)
DrawableHelper
.
compound
LeftAndRight
Drawable
(
DrawableHelper
.
compound
StartAndEnd
Drawable
(
text_sort_by
,
hashtagDrawable
,
arrowDownDrawable
)
}
else
{
text_sort_by
.
text
=
getString
(
R
.
string
.
msg_users
)
DrawableHelper
.
compound
LeftAndRight
Drawable
(
DrawableHelper
.
compound
StartAndEnd
Drawable
(
text_sort_by
,
userDrawable
,
arrowDownDrawable
...
...
app/src/main/java/chat/rocket/android/directory/ui/DirectorySortingBottomSheetFragment.kt
View file @
ad802c4d
...
...
@@ -100,21 +100,21 @@ class DirectorySortingBottomSheetFragment : BottomSheetDialogFragment() {
}
}
private
fun
checkSelection
(
textView
:
TextView
,
lef
tDrawable
:
Drawable
)
{
private
fun
checkSelection
(
textView
:
TextView
,
star
tDrawable
:
Drawable
)
{
context
?.
let
{
DrawableHelper
.
compound
LeftAndRight
Drawable
(
DrawableHelper
.
compound
StartAndEnd
Drawable
(
textView
,
lef
tDrawable
,
star
tDrawable
,
checkDrawable
)
}
}
private
fun
uncheckSelection
(
textView
:
TextView
,
lef
tDrawable
:
Drawable
)
{
private
fun
uncheckSelection
(
textView
:
TextView
,
star
tDrawable
:
Drawable
)
{
context
?.
let
{
DrawableHelper
.
compound
Lef
tDrawable
(
DrawableHelper
.
compound
Star
tDrawable
(
textView
,
lef
tDrawable
star
tDrawable
)
}
}
...
...
app/src/main/java/chat/rocket/android/sortingandgrouping/ui/SortingAndGroupingBottomSheetFragment.kt
View file @
ad802c4d
...
...
@@ -143,21 +143,21 @@ class SortingAndGroupingBottomSheetFragment : BottomSheetDialogFragment(), Sorti
text_sort_by
.
text
=
getString
(
R
.
string
.
msg_sort_by_placeholder
,
text
.
toLowerCase
())
}
private
fun
checkSelection
(
textView
:
TextView
,
@DrawableRes
lef
tDrawable
:
Int
)
{
private
fun
checkSelection
(
textView
:
TextView
,
@DrawableRes
star
tDrawable
:
Int
)
{
context
?.
let
{
DrawableHelper
.
compound
LeftAndRight
Drawable
(
DrawableHelper
.
compound
StartAndEnd
Drawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
lef
tDrawable
,
it
),
DrawableHelper
.
getDrawableFromId
(
star
tDrawable
,
it
),
DrawableHelper
.
getDrawableFromId
(
R
.
drawable
.
ic_check
,
it
)
)
}
}
private
fun
uncheckSelection
(
textView
:
TextView
,
@DrawableRes
lef
tDrawable
:
Int
)
{
private
fun
uncheckSelection
(
textView
:
TextView
,
@DrawableRes
star
tDrawable
:
Int
)
{
context
?.
let
{
DrawableHelper
.
compound
Lef
tDrawable
(
DrawableHelper
.
compound
Star
tDrawable
(
textView
,
DrawableHelper
.
getDrawableFromId
(
lef
tDrawable
,
it
)
DrawableHelper
.
getDrawableFromId
(
star
tDrawable
,
it
)
)
}
}
...
...
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