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
33897bad
Commit
33897bad
authored
Oct 07, 2018
by
divyanshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use isVisible Ktx function rather than extension function
parent
c736eff3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
38 additions
and
53 deletions
+38
-53
RegisterUsernameFragment.kt
...ntication/registerusername/ui/RegisterUsernameFragment.kt
+3
-3
ResetPasswordFragment.kt
.../authentication/resetpassword/ui/ResetPasswordFragment.kt
+3
-3
ServerFragment.kt
...rocket/android/authentication/server/ui/ServerFragment.kt
+3
-3
SignupFragment.kt
...rocket/android/authentication/signup/ui/SignupFragment.kt
+5
-5
TwoFAFragment.kt
...cket/android/authentication/twofactor/ui/TwoFAFragment.kt
+3
-3
MessageInfoFragment.kt
.../rocket/android/chatinformation/ui/MessageInfoFragment.kt
+3
-3
PeopleSuggestionsAdapter.kt
...cket/android/chatroom/adapter/PeopleSuggestionsAdapter.kt
+4
-4
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+8
-7
Animation.kt
...ain/java/chat/rocket/android/util/extensions/Animation.kt
+6
-9
Ui.kt
app/src/main/java/chat/rocket/android/util/extensions/Ui.kt
+0
-13
No files found.
app/src/main/java/chat/rocket/android/authentication/registerusername/ui/RegisterUsernameFragment.kt
View file @
33897bad
...
...
@@ -6,6 +6,7 @@ import android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.analytics.AnalyticsManager
...
...
@@ -13,7 +14,6 @@ import chat.rocket.android.analytics.event.ScreenViewEvent
import
chat.rocket.android.authentication.registerusername.presentation.RegisterUsernamePresenter
import
chat.rocket.android.authentication.registerusername.presentation.RegisterUsernameView
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.shake
import
chat.rocket.android.util.extensions.showKeyboard
import
chat.rocket.android.util.extensions.showToast
...
...
@@ -88,13 +88,13 @@ class RegisterUsernameFragment : Fragment(), RegisterUsernameView {
override
fun
showLoading
()
{
ui
{
disableUserInput
()
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
}
}
override
fun
hideLoading
()
{
ui
{
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
enableUserInput
()
}
}
...
...
app/src/main/java/chat/rocket/android/authentication/resetpassword/ui/ResetPasswordFragment.kt
View file @
33897bad
...
...
@@ -7,6 +7,7 @@ import android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.Toast
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.analytics.AnalyticsManager
...
...
@@ -14,7 +15,6 @@ import chat.rocket.android.analytics.event.ScreenViewEvent
import
chat.rocket.android.authentication.resetpassword.presentation.ResetPasswordPresenter
import
chat.rocket.android.authentication.resetpassword.presentation.ResetPasswordView
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.shake
import
chat.rocket.android.util.extensions.showKeyboard
import
chat.rocket.android.util.extensions.showToast
...
...
@@ -85,13 +85,13 @@ class ResetPasswordFragment : Fragment(), ResetPasswordView {
override
fun
showLoading
()
{
ui
{
disableUserInput
()
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
}
}
override
fun
hideLoading
()
{
ui
{
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
enableUserInput
()
}
}
...
...
app/src/main/java/chat/rocket/android/authentication/server/ui/ServerFragment.kt
View file @
33897bad
...
...
@@ -9,6 +9,7 @@ import android.view.ViewGroup
import
android.view.ViewTreeObserver
import
android.widget.AdapterView
import
android.widget.ArrayAdapter
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.BuildConfig
import
chat.rocket.android.R
...
...
@@ -22,7 +23,6 @@ import chat.rocket.android.util.extensions.hintContent
import
chat.rocket.android.util.extensions.ifEmpty
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.sanitize
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.android.util.extensions.textContent
import
chat.rocket.android.util.extensions.ui
...
...
@@ -118,13 +118,13 @@ class ServerFragment : Fragment(), ServerView {
override
fun
showLoading
()
{
ui
{
enableUserInput
(
false
)
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
}
}
override
fun
hideLoading
()
{
ui
{
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
enableUserInput
(
true
)
}
}
...
...
app/src/main/java/chat/rocket/android/authentication/signup/ui/SignupFragment.kt
View file @
33897bad
...
...
@@ -10,6 +10,7 @@ import android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewTreeObserver
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.R.string.message_credentials_saved_successfully
...
...
@@ -20,7 +21,6 @@ import chat.rocket.android.authentication.signup.presentation.SignupView
import
chat.rocket.android.helper.KeyboardHelper
import
chat.rocket.android.helper.TextHelper
import
chat.rocket.android.helper.saveCredentials
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.shake
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.android.util.extensions.textContent
...
...
@@ -40,11 +40,11 @@ class SignupFragment : Fragment(), SignupView {
lateinit
var
analyticsManager
:
AnalyticsManager
private
val
layoutListener
=
ViewTreeObserver
.
OnGlobalLayoutListener
{
if
(
KeyboardHelper
.
isSoftKeyboardShown
(
relative_layout
.
rootView
))
{
bottom_container
.
setVisible
(
false
)
bottom_container
.
isVisible
=
false
}
else
{
bottom_container
.
apply
{
postDelayed
({
ui
{
setVisible
(
true
)
}
ui
{
isVisible
=
true
}
},
3
)
}
}
...
...
@@ -134,13 +134,13 @@ class SignupFragment : Fragment(), SignupView {
override
fun
showLoading
()
{
ui
{
enableUserInput
(
false
)
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
}
}
override
fun
hideLoading
()
{
ui
{
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
enableUserInput
(
true
)
}
}
...
...
app/src/main/java/chat/rocket/android/authentication/twofactor/ui/TwoFAFragment.kt
View file @
33897bad
...
...
@@ -8,6 +8,7 @@ import android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.view.inputmethod.InputMethodManager
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.analytics.AnalyticsManager
...
...
@@ -15,7 +16,6 @@ import chat.rocket.android.analytics.event.ScreenViewEvent
import
chat.rocket.android.authentication.twofactor.presentation.TwoFAPresenter
import
chat.rocket.android.authentication.twofactor.presentation.TwoFAView
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.shake
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.android.util.extensions.textContent
...
...
@@ -82,13 +82,13 @@ class TwoFAFragment : Fragment(), TwoFAView {
override
fun
showLoading
()
{
ui
{
enableUserInput
(
false
)
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
}
}
override
fun
hideLoading
()
{
ui
{
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
enableUserInput
(
true
)
}
}
...
...
app/src/main/java/chat/rocket/android/chatinformation/ui/MessageInfoFragment.kt
View file @
33897bad
...
...
@@ -4,6 +4,7 @@ import android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.DefaultItemAnimator
import
androidx.recyclerview.widget.LinearLayoutManager
...
...
@@ -15,7 +16,6 @@ import chat.rocket.android.chatinformation.adapter.ReadReceiptAdapter
import
chat.rocket.android.chatinformation.presentation.MessageInfoPresenter
import
chat.rocket.android.chatinformation.presentation.MessageInfoView
import
chat.rocket.android.chatinformation.viewmodel.ReadReceiptViewModel
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.showToast
import
dagger.android.support.AndroidSupportInjection
import
kotlinx.android.synthetic.main.fragment_message_info.*
...
...
@@ -84,13 +84,13 @@ class MessageInfoFragment : Fragment(), MessageInfoView {
}
override
fun
showLoading
()
{
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
view_loading
.
show
()
}
override
fun
hideLoading
()
{
view_loading
.
hide
()
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
}
override
fun
showReadReceipts
(
messageReceipts
:
List
<
ReadReceiptViewModel
>)
{
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/PeopleSuggestionsAdapter.kt
View file @
33897bad
...
...
@@ -7,10 +7,10 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.core.view.isVisible
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.adapter.PeopleSuggestionsAdapter.PeopleSuggestionViewHolder
import
chat.rocket.android.chatroom.uimodel.suggestion.PeopleSuggestionUiModel
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.suggestions.model.SuggestionModel
import
chat.rocket.android.suggestions.ui.BaseSuggestionViewHolder
import
chat.rocket.android.suggestions.ui.SuggestionsAdapter
...
...
@@ -58,9 +58,9 @@ class PeopleSuggestionsAdapter(context: Context) : SuggestionsAdapter<PeopleSugg
username
.
text
=
item
.
username
name
.
text
=
item
.
name
if
(
item
.
imageUri
?.
isEmpty
()
!=
false
)
{
avatar
.
setVisible
(
false
)
avatar
.
isVisible
=
false
}
else
{
avatar
.
setVisible
(
true
)
avatar
.
isVisible
=
true
avatar
.
setImageURI
(
item
.
imageUri
)
}
val
status
=
item
.
status
...
...
@@ -68,7 +68,7 @@ class PeopleSuggestionsAdapter(context: Context) : SuggestionsAdapter<PeopleSugg
val
statusDrawable
=
DrawableHelper
.
getUserStatusDrawable
(
status
,
itemView
.
context
)
statusView
.
setImageDrawable
(
statusDrawable
)
}
else
{
statusView
.
setVisible
(
false
)
statusView
.
isVisible
=
false
}
setOnClickListener
{
itemClickListener
?.
onClick
(
item
)
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
33897bad
...
...
@@ -12,6 +12,7 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.core.view.isVisible
import
chat.rocket.android.R
import
chat.rocket.android.infrastructure.LocalRepository
import
chat.rocket.android.infrastructure.checkIfMyself
...
...
@@ -53,13 +54,13 @@ class ChatRoomsAdapter(
bindName
(
chatRoom
,
text_chat_name
)
bindIcon
(
chatRoom
,
image_chat_icon
)
if
(
settings
.
showLastMessage
())
{
text_last_message
.
setVisible
(
true
)
text_last_message_date_time
.
setVisible
(
true
)
text_last_message
.
isVisible
=
true
text_last_message_date_time
.
isVisible
=
true
bindLastMessageDateTime
(
chatRoom
,
text_last_message_date_time
)
bindLastMessage
(
chatRoom
,
text_last_message
)
}
else
{
text_last_message
.
setVisible
(
false
)
text_last_message_date_time
.
setVisible
(
false
)
text_last_message
.
isVisible
=
false
text_last_message_date_time
.
isVisible
=
false
}
bindUnreadMessages
(
chatRoom
,
text_total_unread_messages
)
...
...
@@ -178,13 +179,13 @@ class ChatRoomsAdapter(
when
{
totalUnreadMessage
in
1
..
99
->
{
textView
.
textContent
=
totalUnreadMessage
.
toString
()
textView
.
setVisible
(
true
)
textView
.
isVisible
=
true
}
totalUnreadMessage
>
99
->
{
textView
.
textContent
=
context
.
getString
(
R
.
string
.
msg_more_than_ninety_nine_unread_messages
)
textView
.
setVisible
(
true
)
textView
.
isVisible
=
true
}
else
->
textView
.
setVisible
(
false
)
else
->
textView
.
isVisible
=
false
}
}
}
...
...
app/src/main/java/chat/rocket/android/util/extensions/Animation.kt
View file @
33897bad
...
...
@@ -12,6 +12,7 @@ import android.view.View
import
android.view.ViewAnimationUtils
import
android.view.animation.AccelerateInterpolator
import
android.view.animation.DecelerateInterpolator
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
fun
View
.
rotateBy
(
value
:
Float
,
duration
:
Long
=
100
)
{
...
...
@@ -23,7 +24,7 @@ fun View.rotateBy(value: Float, duration: Long = 100) {
fun
View
.
fadeIn
(
startValue
:
Float
=
0f
,
finishValue
:
Float
=
1f
,
duration
:
Long
=
200
)
{
if
(
alpha
==
finishValue
)
{
setVisible
(
true
)
isVisible
=
true
return
}
...
...
@@ -38,12 +39,12 @@ fun View.fadeIn(startValue: Float = 0f, finishValue: Float = 1f, duration: Long
.
setInterpolator
(
AccelerateInterpolator
()).
start
()
}.
start
()
setVisible
(
true
)
isVisible
=
true
}
fun
View
.
fadeOut
(
startValue
:
Float
=
1f
,
finishValue
:
Float
=
0f
,
duration
:
Long
=
200
)
{
if
(
alpha
==
finishValue
)
{
setVisible
(
false
)
isVisible
=
false
return
}
...
...
@@ -58,7 +59,7 @@ fun View.fadeOut(startValue: Float = 1f, finishValue: Float = 0f, duration: Long
.
setInterpolator
(
AccelerateInterpolator
()).
start
()
}.
start
()
setVisible
(
false
)
isVisible
=
false
}
fun
View
.
circularRevealOrUnreveal
(
...
...
@@ -72,11 +73,7 @@ fun View.circularRevealOrUnreveal(
ViewAnimationUtils
.
createCircularReveal
(
this
,
centerX
,
centerY
,
startRadius
,
endRadius
)
anim
.
duration
=
duration
if
(
startRadius
<
endRadius
)
{
setVisible
(
true
)
}
else
{
setVisible
(
false
)
}
isVisible
=
startRadius
<
endRadius
anim
.
start
()
}
...
...
app/src/main/java/chat/rocket/android/util/extensions/Ui.kt
View file @
33897bad
...
...
@@ -19,19 +19,6 @@ import androidx.appcompat.view.menu.MenuBuilder
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
// TODO: Remove. Use KTX instead.
fun
View
.
setVisible
(
visible
:
Boolean
)
{
visibility
=
if
(
visible
)
{
View
.
VISIBLE
}
else
{
View
.
GONE
}
}
fun
View
.
isVisible
():
Boolean
{
return
visibility
==
View
.
VISIBLE
}
fun
ViewGroup
.
inflate
(
@LayoutRes
resource
:
Int
,
attachToRoot
:
Boolean
=
false
):
View
=
LayoutInflater
.
from
(
context
).
inflate
(
resource
,
this
,
attachToRoot
)
...
...
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