|
@ -40,12 +40,15 @@ public class LoginActivity extends BaseActivity { |
|
|
/* --Graphics End-- */ |
|
|
/* --Graphics End-- */ |
|
|
|
|
|
|
|
|
private LoginTask loginTask; |
|
|
private LoginTask loginTask; |
|
|
|
|
|
private boolean initialRedirect; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onCreate(Bundle savedInstanceState) { |
|
|
public void onCreate(Bundle savedInstanceState) { |
|
|
super.onCreate(savedInstanceState); |
|
|
super.onCreate(savedInstanceState); |
|
|
setContentView(R.layout.activity_login); |
|
|
setContentView(R.layout.activity_login); |
|
|
|
|
|
|
|
|
|
|
|
initialRedirect = getIntent().getBooleanExtra("REDIRECT", false); |
|
|
|
|
|
|
|
|
PreferenceManager.setDefaultValues(this, R.xml.app_preferences_user, false); |
|
|
PreferenceManager.setDefaultValues(this, R.xml.app_preferences_user, false); |
|
|
|
|
|
|
|
|
//Variables initialization
|
|
|
//Variables initialization
|
|
@ -56,7 +59,6 @@ public class LoginActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
//Login button Click Event
|
|
|
//Login button Click Event
|
|
|
btnLogin.setOnClickListener(view -> { |
|
|
btnLogin.setOnClickListener(view -> { |
|
|
Timber.d("Login"); |
|
|
|
|
|
|
|
|
|
|
|
//Get username and password strings
|
|
|
//Get username and password strings
|
|
|
username = inputUsername.getText().toString().trim(); |
|
|
username = inputUsername.getText().toString().trim(); |
|
@ -162,9 +164,12 @@ public class LoginActivity extends BaseActivity { |
|
|
"Welcome, " + sessionManager.getUsername() + "!", Toast.LENGTH_LONG) |
|
|
"Welcome, " + sessionManager.getUsername() + "!", Toast.LENGTH_LONG) |
|
|
.show(); |
|
|
.show(); |
|
|
BaseApplication.getInstance().logFirebaseAnalyticsEvent(FirebaseAnalytics.Event.LOGIN, null); |
|
|
BaseApplication.getInstance().logFirebaseAnalyticsEvent(FirebaseAnalytics.Event.LOGIN, null); |
|
|
//Go to main
|
|
|
if(initialRedirect){ |
|
|
Intent intent = new Intent(LoginActivity.this, MainActivity.class); |
|
|
Intent intent = new Intent(LoginActivity.this, MainActivity.class); |
|
|
startActivity(intent); |
|
|
startActivity(intent); |
|
|
|
|
|
} else |
|
|
|
|
|
onBackPressed(); |
|
|
|
|
|
|
|
|
finish(); |
|
|
finish(); |
|
|
overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); |
|
|
overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); |
|
|
break; |
|
|
break; |
|
|