|
@ -22,6 +22,7 @@ import static gr.thmmy.mthmmy.utils.Thmmy.login; |
|
|
|
|
|
|
|
|
public class LoginActivity extends BaseActivity { |
|
|
public class LoginActivity extends BaseActivity { |
|
|
private static final String TAG = "LoginActivity"; |
|
|
private static final String TAG = "LoginActivity"; |
|
|
|
|
|
private static boolean passed=false; //becomes true after (guest) login - to redirect to Main
|
|
|
private EditText inputUsername; |
|
|
private EditText inputUsername; |
|
|
private EditText inputPassword; |
|
|
private EditText inputPassword; |
|
|
Button btnLogin; |
|
|
Button btnLogin; |
|
@ -29,6 +30,12 @@ public class LoginActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onCreate(Bundle savedInstanceState) { |
|
|
public void onCreate(Bundle savedInstanceState) { |
|
|
|
|
|
if(passed) //redirect to MainActivity if user passed this one at least once
|
|
|
|
|
|
{ |
|
|
|
|
|
Intent intent = new Intent(LoginActivity.this, MainActivity.class); |
|
|
|
|
|
startActivity(intent); |
|
|
|
|
|
finish(); |
|
|
|
|
|
} |
|
|
super.onCreate(savedInstanceState); |
|
|
super.onCreate(savedInstanceState); |
|
|
setContentView(R.layout.activity_login); |
|
|
setContentView(R.layout.activity_login); |
|
|
|
|
|
|
|
@ -61,7 +68,11 @@ public class LoginActivity extends BaseActivity { |
|
|
btnGuest.setOnClickListener(new View.OnClickListener() { |
|
|
btnGuest.setOnClickListener(new View.OnClickListener() { |
|
|
|
|
|
|
|
|
public void onClick(View view) { |
|
|
public void onClick(View view) { |
|
|
//TO-DO
|
|
|
Intent intent = new Intent(LoginActivity.this, MainActivity.class); |
|
|
|
|
|
startActivity(intent); |
|
|
|
|
|
passed=true; |
|
|
|
|
|
finish(); |
|
|
|
|
|
overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -134,6 +145,7 @@ public class LoginActivity extends BaseActivity { |
|
|
.show(); |
|
|
.show(); |
|
|
Intent intent = new Intent(LoginActivity.this, MainActivity.class); |
|
|
Intent intent = new Intent(LoginActivity.this, MainActivity.class); |
|
|
startActivity(intent); |
|
|
startActivity(intent); |
|
|
|
|
|
passed=true; |
|
|
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; |
|
|