mirror of
https://github.com/ChronosX88/Influence-P2P.git
synced 2024-11-22 23:32:18 +00:00
Fixed bug with LoginActivity (not finished MainActivity when LoginActivity is started)
This commit is contained in:
parent
8c52586411
commit
835a73a006
@ -55,6 +55,7 @@ interface CoreContracts {
|
|||||||
interface IMainViewContract {
|
interface IMainViewContract {
|
||||||
fun showSnackbar(message: String)
|
fun showSnackbar(message: String)
|
||||||
fun showProgressBar(state: Boolean)
|
fun showProgressBar(state: Boolean)
|
||||||
|
fun finishActivity()
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----ChatActivity-----
|
// -----ChatActivity-----
|
||||||
|
@ -31,6 +31,7 @@ class MainPresenter(private val view: CoreContracts.IMainViewContract) : CoreCon
|
|||||||
val intent = Intent(AppHelper.getContext(), LoginActivity::class.java)
|
val intent = Intent(AppHelper.getContext(), LoginActivity::class.java)
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
AppHelper.getContext().startActivity(intent)
|
AppHelper.getContext().startActivity(intent)
|
||||||
|
view.finishActivity()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,9 @@ public class LoginActivity extends AppCompatActivity implements CoreContracts.IL
|
|||||||
jidEditText.setError(null);
|
jidEditText.setError(null);
|
||||||
passwordEditText.setError(null);
|
passwordEditText.setError(null);
|
||||||
|
|
||||||
|
jidInputLayout.setError(null);
|
||||||
|
passwordInputLayout.setError(null);
|
||||||
|
|
||||||
String jid = jidEditText.getText().toString();
|
String jid = jidEditText.getText().toString();
|
||||||
String password = passwordEditText.getText().toString();
|
String password = passwordEditText.getText().toString();
|
||||||
|
|
||||||
@ -161,6 +164,7 @@ public class LoginActivity extends AppCompatActivity implements CoreContracts.IL
|
|||||||
case AuthenticationStatusEvent.CONNECT_AND_LOGIN_SUCCESSFUL: {
|
case AuthenticationStatusEvent.CONNECT_AND_LOGIN_SUCCESSFUL: {
|
||||||
loadingScreen(false);
|
loadingScreen(false);
|
||||||
finish();
|
finish();
|
||||||
|
startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AuthenticationStatusEvent.INCORRECT_LOGIN_OR_PASSWORD: {
|
case AuthenticationStatusEvent.INCORRECT_LOGIN_OR_PASSWORD: {
|
||||||
|
@ -143,4 +143,9 @@ public class MainActivity extends AppCompatActivity implements CoreContracts.IMa
|
|||||||
super.onStop();
|
super.onStop();
|
||||||
presenter.onStop();
|
presenter.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finishActivity() {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user