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

Merge branch 'feature/connection' into feature/foundationListActivity

parents 9b39e556 542446c7
......@@ -283,12 +283,13 @@ public class MainActivity extends BaseActivity {
final View pinView = getLayoutInflater().inflate(R.layout.dialog_badge, null);
final EditText pinInput = pinView.findViewById(R.id.input_pin);
final Button noPinButton = pinView.findViewById(R.id.button_no_pin);
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(MainActivity.this);
alertDialogBuilder
.setTitle(R.string.badge_dialog)
.setView(pinView)
.setCancelable(true)
.setCancelable(false)
.setPositiveButton(R.string.connexion, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int id) {
if (pinInput.getText().toString().equals("")) {
......@@ -302,12 +303,15 @@ public class MainActivity extends BaseActivity {
}
}
})
.setNeutralButton(R.string.no_pin, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int id) {
connectWithBadge(idBadge, "0000");
dialogInterface.cancel();
}
});
.setNegativeButton(R.string.cancel, null);
noPinButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
connectWithBadge(idBadge, "0000");
}
});
dialog.createDialog(alertDialogBuilder, pinInput);
}
......
......@@ -93,7 +93,9 @@ public class Dialog {
}
public void stopLoading() {
this.loading.dismiss();
if (this.loading != null)
this.loading.dismiss();
this.loading = null;
}
}
......@@ -4,13 +4,30 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/input_pin"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:maxLength="4"
android:inputType="numberPassword"
android:hint="@string/pin" />
android:layout_height="match_parent"
android:orientation="horizontal">
<EditText
android:id="@+id/input_pin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="15dp"
android:layout_weight="1"
android:hint="@string/pin"
android:inputType="numberPassword"
android:maxLength="4" />
<Button
android:id="@+id/button_no_pin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="25dp"
android:layout_weight="1"
android:text="@string/no_pin" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
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