Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hds
flexin
android-app
Commits
542446c7
Commit
542446c7
authored
Oct 27, 2017
by
Nastuzzi Samy
Browse files
Optimization
Can not cancel pin dialog Fix bug
parent
4f157c29
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/fr/utc/simde/payutc/MainActivity.java
View file @
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
(
tru
e
)
.
setCancelable
(
fals
e
)
.
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
);
}
...
...
app/src/main/java/fr/utc/simde/payutc/tools/Dialog.java
View file @
542446c7
...
...
@@ -93,7 +93,9 @@ public class Dialog {
}
public
void
stopLoading
()
{
this
.
loading
.
dismiss
();
if
(
this
.
loading
!=
null
)
this
.
loading
.
dismiss
();
this
.
loading
=
null
;
}
}
app/src/main/res/layout/dialog_badge.xml
View file @
542446c7
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment