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
fe22aa68
Commit
fe22aa68
authored
Jan 04, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete unneeded code.
parent
43b32108
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
59 deletions
+16
-59
LoginFragment.kt
...t/rocket/android/authentication/login/ui/LoginFragment.kt
+4
-16
ServerFragment.kt
...rocket/android/authentication/server/ui/ServerFragment.kt
+3
-4
SignupFragment.kt
...rocket/android/authentication/signup/ui/SignupFragment.kt
+4
-16
TwoFAFragment.kt
...cket/android/authentication/twofactor/ui/TwoFAFragment.kt
+5
-23
No files found.
app/src/main/java/chat/rocket/android/authentication/login/ui/LoginFragment.kt
View file @
fe22aa68
...
...
@@ -41,24 +41,12 @@ class LoginFragment : Fragment(), LoginView {
private
var
isGlobalLayoutListenerSetUp
=
false
companion
object
{
private
const
val
SERVER_URL
=
"server_url"
fun
newInstance
(
url
:
String
)
=
LoginFragment
().
apply
{
arguments
=
Bundle
(
1
).
apply
{
putString
(
SERVER_URL
,
url
)
}
}
fun
newInstance
()
=
LoginFragment
()
}
// Todo remove
private
lateinit
var
serverUrl
:
String
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
AndroidSupportInjection
.
inject
(
this
)
super
.
onCreate
(
savedInstanceState
)
// TODO - research a better way to initialize parameters on fragments.
serverUrl
=
arguments
?.
getString
(
SERVER_URL
)
?:
"https://open.rocket.chat"
AndroidSupportInjection
.
inject
(
this
)
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
=
inflater
.
inflate
(
R
.
layout
.
fragment_authentication_log_in
,
container
,
false
)
...
...
@@ -170,11 +158,11 @@ class LoginFragment : Fragment(), LoginView {
override
fun
showLoading
()
{
enableUserInput
(
false
)
view_loading
.
s
how
(
)
view_loading
.
s
etVisibility
(
true
)
}
override
fun
hideLoading
()
{
view_loading
.
hide
(
)
view_loading
.
setVisibility
(
false
)
enableUserInput
(
true
)
}
...
...
app/src/main/java/chat/rocket/android/authentication/server/ui/ServerFragment.kt
View file @
fe22aa68
...
...
@@ -40,7 +40,7 @@ class ServerFragment : Fragment(), ServerView {
super
.
onViewCreated
(
view
,
savedInstanceState
)
relative_layout
.
viewTreeObserver
.
addOnGlobalLayoutListener
(
layoutListener
)
activity
?.
appl
icationContext
?.
appl
y
{
activity
?.
apply
{
button_connect
.
setOnClickListener
{
val
url
=
text_server_url
.
textContent
.
ifEmpty
(
text_server_url
.
hintContent
)
presenter
.
connect
(
text_server_protocol
.
textContent
+
url
)
...
...
@@ -55,15 +55,14 @@ class ServerFragment : Fragment(), ServerView {
override
fun
showLoading
()
{
enableUserInput
(
false
)
view_loading
.
s
how
(
)
view_loading
.
s
etVisibility
(
true
)
}
override
fun
hideLoading
()
{
view_loading
.
hide
(
)
view_loading
.
setVisibility
(
false
)
enableUserInput
(
true
)
}
override
fun
showMessage
(
message
:
String
)
{
Toast
.
makeText
(
activity
,
message
,
Toast
.
LENGTH_SHORT
).
show
()
}
...
...
app/src/main/java/chat/rocket/android/authentication/signup/ui/SignupFragment.kt
View file @
fe22aa68
...
...
@@ -32,25 +32,13 @@ class SignupFragment : Fragment(), SignupView {
}
}
// TODO delete
lateinit
var
serverUrl
:
String
companion
object
{
private
const
val
SERVER_URL
=
"server_url"
fun
newInstance
(
url
:
String
)
=
SignupFragment
().
apply
{
arguments
=
Bundle
(
1
).
apply
{
putString
(
SERVER_URL
,
url
)
}
}
fun
newInstance
()
=
SignupFragment
()
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
AndroidSupportInjection
.
inject
(
this
)
super
.
onCreate
(
savedInstanceState
)
// TODO - research a better way to initialize parameters on fragments.
serverUrl
=
arguments
?.
getString
(
SERVER_URL
)
?:
"https://open.rocket.chat"
AndroidSupportInjection
.
inject
(
this
)
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
=
inflater
.
inflate
(
R
.
layout
.
fragment_authentication_sign_up
,
container
,
false
)
...
...
@@ -104,11 +92,11 @@ class SignupFragment : Fragment(), SignupView {
override
fun
showLoading
()
{
enableUserInput
(
false
)
view_loading
.
s
how
(
)
view_loading
.
s
etVisibility
(
true
)
}
override
fun
hideLoading
()
{
view_loading
.
hide
(
)
view_loading
.
setVisibility
(
false
)
enableUserInput
(
true
)
}
...
...
app/src/main/java/chat/rocket/android/authentication/twofactor/ui/TwoFAFragment.kt
View file @
fe22aa68
...
...
@@ -23,32 +23,14 @@ import javax.inject.Inject
class
TwoFAFragment
:
Fragment
(),
TwoFAView
{
@Inject
lateinit
var
presenter
:
TwoFAPresenter
@Inject
lateinit
var
appContext
:
Context
lateinit
var
serverUrl
:
String
lateinit
var
username
:
String
lateinit
var
password
:
String
companion
object
{
private
const
val
SERVER_URL
=
"server_url"
private
const
val
USERNAME
=
"username"
private
const
val
PASSWORD
=
"password"
fun
newInstance
(
url
:
String
,
username
:
String
,
password
:
String
)
=
TwoFAFragment
().
apply
{
arguments
=
Bundle
(
1
).
apply
{
putString
(
SERVER_URL
,
url
)
putString
(
USERNAME
,
username
)
putString
(
PASSWORD
,
password
)
}
}
fun
newInstance
()
=
TwoFAFragment
()
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
AndroidSupportInjection
.
inject
(
this
)
super
.
onCreate
(
savedInstanceState
)
// TODO - research a better way to initialize parameters on fragments.
serverUrl
=
arguments
?.
getString
(
SERVER_URL
)
?:
"https://open.rocket.chat"
username
=
arguments
?.
getString
(
USERNAME
)
?:
""
password
=
arguments
?.
getString
(
PASSWORD
)
?:
""
AndroidSupportInjection
.
inject
(
this
)
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
=
inflater
.
inflate
(
R
.
layout
.
fragment_authentication_two_fa
,
container
,
false
)
...
...
@@ -63,7 +45,7 @@ class TwoFAFragment : Fragment(), TwoFAView {
}
button_log_in
.
setOnClickListener
{
presenter
.
authenticate
(
username
,
password
,
text_two_factor_auth
.
textContent
)
presenter
.
authenticate
(
text_two_factor_auth
.
textContent
)
}
}
...
...
@@ -78,11 +60,11 @@ class TwoFAFragment : Fragment(), TwoFAView {
override
fun
showLoading
()
{
enableUserInput
(
false
)
view_loading
.
s
how
(
)
view_loading
.
s
etVisibility
(
true
)
}
override
fun
hideLoading
()
{
view_loading
.
hide
(
)
view_loading
.
setVisibility
(
false
)
enableUserInput
(
true
)
}
...
...
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