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
da33e61f
Commit
da33e61f
authored
Dec 23, 2017
by
Aniket
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolves incorrect context issue in login activity
parent
6f80a3c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
LoginActivity.java
...main/java/chat/rocket/android/activity/LoginActivity.java
+3
-1
LoginContract.java
.../rocket/android/fragment/server_config/LoginContract.java
+5
-2
LoginFragment.kt
...at/rocket/android/fragment/server_config/LoginFragment.kt
+4
-3
LoginPresenter.kt
...t/rocket/android/fragment/server_config/LoginPresenter.kt
+3
-2
No files found.
app/src/main/java/chat/rocket/android/activity/LoginActivity.java
View file @
da33e61f
package
chat
.
rocket
.
android
.
activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
...
...
@@ -94,7 +95,8 @@ public class LoginActivity extends AbstractFragmentActivity implements LoginCont
protected
boolean
onBackPress
()
{
LoginFragment
loginFragment
=
(
LoginFragment
)
getSupportFragmentManager
()
.
findFragmentById
(
getLayoutContainerForFragment
());
loginFragment
.
goBack
();
Context
loginActivityContext
=
this
;
loginFragment
.
goBack
(
loginActivityContext
);
return
true
;
}
}
app/src/main/java/chat/rocket/android/fragment/server_config/LoginContract.java
View file @
da33e61f
package
chat
.
rocket
.
android
.
fragment
.
server_config
;
import
android.content.Context
;
import
java.util.List
;
import
chat.rocket.android.shared.BaseContract
;
...
...
@@ -19,13 +22,13 @@ public interface LoginContract {
void
showTwoStepAuth
();
void
goBack
();
void
goBack
(
Context
ctx
);
}
interface
Presenter
extends
BaseContract
.
Presenter
<
View
>
{
void
login
(
String
username
,
String
password
);
void
goBack
();
void
goBack
(
Context
ctx
);
}
}
app/src/main/java/chat/rocket/android/fragment/server_config/LoginFragment.kt
View file @
da33e61f
package
chat.rocket.android.fragment.server_config
import
android.content.Context
import
android.os.Bundle
import
android.support.constraint.ConstraintLayout
import
android.support.design.widget.Snackbar
...
...
@@ -126,8 +127,8 @@ class LoginFragment : AbstractServerConfigFragment(), LoginContract.View {
presenter
.
release
()
super
.
onPause
()
}
override
fun
goBack
()
{
presenter
.
goBack
()
override
fun
goBack
(
ctx
:
Context
?)
{
presenter
.
goBack
(
ctx
)
}
}
app/src/main/java/chat/rocket/android/fragment/server_config/LoginPresenter.kt
View file @
da33e61f
package
chat.rocket.android.fragment.server_config
import
android.content.Context
import
bolts.Continuation
import
bolts.Task
import
chat.rocket.android.BackgroundLooper
...
...
@@ -31,7 +32,7 @@ class LoginPresenter(private val loginServiceConfigurationRepository: LoginServi
getLoginServices
()
}
override
fun
goBack
()
{
override
fun
goBack
(
ctx
:
Context
?
)
{
val
context
=
RocketChatApplication
.
getInstance
()
val
hostname
=
RocketChatCache
.
getSelectedServerHostname
()
hostname
?.
let
{
...
...
@@ -39,7 +40,7 @@ class LoginPresenter(private val loginServiceConfigurationRepository: LoginServi
RocketChatCache
.
clearSelectedHostnameReferences
()
}
LaunchUtil
.
showMainActivity
(
c
ontext
)
LaunchUtil
.
showMainActivity
(
c
tx
)
}
override
fun
login
(
username
:
String
,
password
:
String
)
{
...
...
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