If permission is already declined when invoking Dexter.check(), startTransparentActivityIfNeeded() should not start DexterActivity. Thus preventing any kind of flicker and animation when opening/closing activities.
Actual behaviour
If I call check() on Dexter library for a permission that was already declined (With flag "don't ask again" checked), I see translucent animation flickering before "onPermissionDenied" is called.
It's only happening if had declined the permission. If user accept the permission, and then I call check() again, the onPermissionGranted is called without this flickering.
Seems to be the same problem as issue #81 but only for declined permissions. For accepted permission the problem was fixed in the issue #81.
Steps to reproduce
Ask a permission by calling the check() method of Dexter Library.
Dexter.withActivity(this)
.withPermission(Manifest.permission.READ_CONTACTS)
.withListener(new PermissionListener()
{
@Override public void onPermissionGranted(PermissionGrantedResponse pResponse)
{...}
@Override public void onPermissionDenied(PermissionDeniedResponse pResponse)
{...}
@Override public void onPermissionRationaleShouldBeShown(PermissionRequest pPermission, PermissionToken pToken)
{...}
}).check();
Cancel the permission asking dialog.
Show again the dialog permission (will show the rationale) then press OK to show permission dialog.
In permission dialog, check the "don't ask again" and decline the permission.
After that, each time I ask the same permission, I see the translucent animation flickering before onPermissionDenied is called.
Expected behaviour
Actual behaviour
Steps to reproduce
Ask a permission by calling the check() method of Dexter Library. Dexter.withActivity(this) .withPermission(Manifest.permission.READ_CONTACTS) .withListener(new PermissionListener() { @Override public void onPermissionGranted(PermissionGrantedResponse pResponse) {...} @Override public void onPermissionDenied(PermissionDeniedResponse pResponse) {...} @Override public void onPermissionRationaleShouldBeShown(PermissionRequest pPermission, PermissionToken pToken) {...} }).check();
Cancel the permission asking dialog.
Show again the dialog permission (will show the rationale) then press OK to show permission dialog.
In permission dialog, check the "don't ask again" and decline the permission.
After that, each time I ask the same permission, I see the translucent animation flickering before onPermissionDenied is called.
Version of the library
Dexter version 4.2.0