Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
8a8441c8
Commit
8a8441c8
authored
Apr 17, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added failure callback to fingerprint dialog
parent
15aa8134
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
FingerprintAuthDialog.java
.../topjohnwu/magisk/view/dialogs/FingerprintAuthDialog.java
+22
-4
No files found.
app/src/main/java/com/topjohnwu/magisk/view/dialogs/FingerprintAuthDialog.java
View file @
8a8441c8
...
@@ -16,15 +16,18 @@ import com.topjohnwu.magisk.utils.FingerprintHelper;
...
@@ -16,15 +16,18 @@ import com.topjohnwu.magisk.utils.FingerprintHelper;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AlertDialog
;
@TargetApi
(
Build
.
VERSION_CODES
.
M
)
@TargetApi
(
Build
.
VERSION_CODES
.
M
)
public
class
FingerprintAuthDialog
extends
CustomAlertDialog
{
public
class
FingerprintAuthDialog
extends
CustomAlertDialog
{
private
Runnable
callback
;
private
final
Runnable
callback
;
@Nullable
private
Runnable
failureCallback
;
private
DialogFingerprintHelper
helper
;
private
DialogFingerprintHelper
helper
;
public
FingerprintAuthDialog
(
@NonNull
Activity
activity
,
Runnable
onSuccess
)
{
public
FingerprintAuthDialog
(
@NonNull
Activity
activity
,
@NonNull
Runnable
onSuccess
)
{
super
(
activity
);
super
(
activity
);
callback
=
onSuccess
;
callback
=
onSuccess
;
Drawable
fingerprint
=
activity
.
getResources
().
getDrawable
(
R
.
drawable
.
ic_fingerprint
);
Drawable
fingerprint
=
activity
.
getResources
().
getDrawable
(
R
.
drawable
.
ic_fingerprint
);
...
@@ -37,13 +40,28 @@ public class FingerprintAuthDialog extends CustomAlertDialog {
...
@@ -37,13 +40,28 @@ public class FingerprintAuthDialog extends CustomAlertDialog {
vh
.
messageView
.
setCompoundDrawablePadding
(
Utils
.
dpInPx
(
20
));
vh
.
messageView
.
setCompoundDrawablePadding
(
Utils
.
dpInPx
(
20
));
vh
.
messageView
.
setGravity
(
Gravity
.
CENTER
);
vh
.
messageView
.
setGravity
(
Gravity
.
CENTER
);
setMessage
(
R
.
string
.
auth_fingerprint
);
setMessage
(
R
.
string
.
auth_fingerprint
);
setNegativeButton
(
R
.
string
.
close
,
(
d
,
w
)
->
helper
.
cancel
());
setNegativeButton
(
R
.
string
.
close
,
(
d
,
w
)
->
{
setOnCancelListener
(
d
->
helper
.
cancel
());
helper
.
cancel
();
if
(
failureCallback
!=
null
)
{
failureCallback
.
run
();
}
});
setOnCancelListener
(
d
->
{
helper
.
cancel
();
if
(
failureCallback
!=
null
)
{
failureCallback
.
run
();
}
});
try
{
try
{
helper
=
new
DialogFingerprintHelper
();
helper
=
new
DialogFingerprintHelper
();
}
catch
(
Exception
ignored
)
{}
}
catch
(
Exception
ignored
)
{}
}
}
public
FingerprintAuthDialog
(
@NonNull
Activity
activity
,
@NonNull
Runnable
onSuccess
,
@NonNull
Runnable
onFailure
)
{
this
(
activity
,
onSuccess
);
failureCallback
=
onFailure
;
}
@Override
@Override
public
AlertDialog
show
()
{
public
AlertDialog
show
()
{
create
();
create
();
...
...
Write
Preview
Markdown
is supported
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