Giter VIP home page Giter VIP logo

Comments (7)

Serchinastico avatar Serchinastico commented on May 18, 2024

Hi @rfgamaral (again :P)

I'm guessing you are talking about the DialogOnDeniedPermissionListener implementation. As in the other issue, I'd say that it sounds completely logical to me to have access to the alert being displayed or to close it automatically when the user chooses an option.

from dexter.

rfgamaral avatar rfgamaral commented on May 18, 2024

Not necessarily.

Say I implement PermissionsListener and create my own AlertDialog inside onPermissionRationaleShouldBeShown to explain why I need a specific permission with my own words. User selects OK and then I invoke token.continuePermissionRequest() and then the native rationale will be shown. Two dialogs.

I was looking for a way to get this into just one...

from dexter.

Serchinastico avatar Serchinastico commented on May 18, 2024

What about closing the alert before calling the token?

from dexter.

rfgamaral avatar rfgamaral commented on May 18, 2024

Not sure what you mean...

from dexter.

Serchinastico avatar Serchinastico commented on May 18, 2024

I'm probably not following you here.

I understand you want to show an alert dialog when you are asked to show the rationale to your user, then when the user accepts it, close the dialog and show the native view. Your listener implementation should be similar to the following:

@Override public void onPermissionRationaleShouldBeShown(PermissionRequest permission,
          final PermissionToken token) {
        new AlertDialog.Builder(SampleActivity.this)
            .setTitle("Hi there")
            .setMessage("Something something")
            .setPositiveButton("OK", new DialogInterface.OnClickListener() {
              @Override public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                token.continuePermissionRequest();
              }
            })
            .show();
      }

Am I missing something?

from dexter.

rfgamaral avatar rfgamaral commented on May 18, 2024

That will give you two dialogs, your own and the rationale one. What I wanted was to have a single dialog with my own rationale words, not the platform's. But I guess this is just how the Android framework works and there's nothing this library can do about it. Feel free to close this issue.

from dexter.

Serchinastico avatar Serchinastico commented on May 18, 2024

Ok, I think I got what you meant.

As you said, the framework doesn't let you customize in any way the native dialog so there is no way you can do that.

from dexter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.