Commit e67a273f authored by Nastuzzi Samy's avatar Nastuzzi Samy
Browse files

Allow badge connexion when cas dialog is open

parent c662ed89
......@@ -45,6 +45,8 @@ public class MainActivity extends BaseActivity {
private static TextView appRegisteredText;
private static Button usernameButton;
private boolean casConnexionDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -71,6 +73,8 @@ public class MainActivity extends BaseActivity {
appRegisteredText = findViewById(R.id.text_app_registered);
usernameButton = findViewById(R.id.button_username);
casConnexionDialog = false;
appImg.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
......@@ -122,8 +126,10 @@ public class MainActivity extends BaseActivity {
@Override
protected void onIdentification(final String badgeId) {
if (!dialog.isShowing())
if (!dialog.isShowing() || casConnexionDialog)
badgeDialog(badgeId);
casConnexionDialog = false;
}
@Override
......@@ -181,6 +187,8 @@ public class MainActivity extends BaseActivity {
protected void connectWithCAS(final String username, final String password) throws InterruptedException {
dialog.startLoading(MainActivity.this, getString(R.string.cas_connection), getString(R.string.cas_in_url));
casConnexionDialog = false;
new Thread() {
@Override
public void run() {
......@@ -382,6 +390,8 @@ public class MainActivity extends BaseActivity {
return;
}
casConnexionDialog = true;
final View usernameView = getLayoutInflater().inflate(R.layout.dialog_login, null);
final EditText usernameInput = usernameView.findViewById(R.id.input_username);
final EditText passwordInput = usernameView.findViewById(R.id.input_password);
......
Supports Markdown
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