Commit 51a9b57d authored by Aniket's avatar Aniket

makes suggested changes

parent 287fe196
package chat.rocket.android.activity; package chat.rocket.android.activity;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
...@@ -100,8 +99,7 @@ public class LoginActivity extends AbstractFragmentActivity implements LoginCont ...@@ -100,8 +99,7 @@ public class LoginActivity extends AbstractFragmentActivity implements LoginCont
} else if (BackStackHelper.FRAGMENT_TAG.equals("login")) { } else if (BackStackHelper.FRAGMENT_TAG.equals("login")) {
LoginFragment loginFragment = (LoginFragment) getSupportFragmentManager() LoginFragment loginFragment = (LoginFragment) getSupportFragmentManager()
.findFragmentById(getLayoutContainerForFragment()); .findFragmentById(getLayoutContainerForFragment());
Context loginActivityContext = this; loginFragment.goBack();
loginFragment.goBack(loginActivityContext);
} }
return true; return true;
} }
......
...@@ -26,7 +26,7 @@ public interface LoginContract { ...@@ -26,7 +26,7 @@ public interface LoginContract {
void showTwoStepAuth(); void showTwoStepAuth();
void goBack(Context ctx); void goBack();
} }
interface Presenter extends BaseContract.Presenter<View> { interface Presenter extends BaseContract.Presenter<View> {
......
package chat.rocket.android.fragment.server_config package chat.rocket.android.fragment.server_config
import android.content.Context
import android.os.Bundle import android.os.Bundle
import android.support.constraint.ConstraintLayout import android.support.constraint.ConstraintLayout
import android.support.design.widget.Snackbar import android.support.design.widget.Snackbar
...@@ -161,8 +160,9 @@ class LoginFragment : AbstractServerConfigFragment(), LoginContract.View { ...@@ -161,8 +160,9 @@ class LoginFragment : AbstractServerConfigFragment(), LoginContract.View {
presenter.release() presenter.release()
super.onPause() super.onPause()
} }
override fun goBack(ctx: Context?) {
presenter.goBack(ctx) override fun goBack() {
presenter.goBack(context)
} }
} }
...@@ -33,7 +33,7 @@ class LoginPresenter(private val loginServiceConfigurationRepository: LoginServi ...@@ -33,7 +33,7 @@ class LoginPresenter(private val loginServiceConfigurationRepository: LoginServi
} }
override fun goBack(ctx : Context?) { override fun goBack(ctx: Context?) {
val context = RocketChatApplication.getInstance() val context = RocketChatApplication.getInstance()
val hostname = RocketChatCache.getSelectedServerHostname() val hostname = RocketChatCache.getSelectedServerHostname()
hostname?.let { hostname?.let {
......
package chat.rocket.android.helper; package chat.rocket.android.helper;
/**
* Created by whocares on 28/12/17.
*/
public class BackStackHelper { public class BackStackHelper {
public static String FRAGMENT_TAG = "login"; public static String FRAGMENT_TAG = "login";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment