Giter VIP home page Giter VIP logo

Comments (6)

mannodermaus avatar mannodermaus commented on May 17, 2024

The code generated by PermissionsDispatcher always resides in the same package that the annotated Activity/Fragment classes live in, which is why those classes are able to use the non-public static methods from the generated code. We chose to reduce visibility of these methods as much as possible to prevent abuse and highlight the tight connection that an annotated class has to its generated counterpart. I don't see why we should relax those restrictions.

from permissionsdispatcher.

hmedat avatar hmedat commented on May 17, 2024

I agreed with you, but I have another implementation before using PermissionsDispatcher methods, So I need to put all my code in single class,

So I need from you to give me an option to set modifier (public,default,protracted) of those methods,

from permissionsdispatcher.

mannodermaus avatar mannodermaus commented on May 17, 2024

Can you go into a little detail on the implementation you're referring to? I'd like to get a better understanding about how it would be beneficial to add something like this to the library.

from permissionsdispatcher.

hmedat avatar hmedat commented on May 17, 2024

I have Class name DialogHelper, I put all my implementations inside it,
My Implementation, to add another dialog before show native permission dialog like this

class DialogHelper{
public static void showSmsForRegisterPage(final RegisterFragment fragment) {
Permission permission = Permission.READ_SMS;
if (PermissionDialogUtil.hasPermission(fragment, permission)) {
fragment.showSms();
return;
}

    if (permission.isNeverAsk()) {
        fragment.onShowSmsNeverAsk();
        return;
    }

    PermissionDialogUtil.showDialog(fragment, permission,
            new MaterialDialog.ButtonCallback() {
                @Override
                public void onPositive(MaterialDialog dialog) {
                    RegisterFragmentPermissionsDispatcher.showSmsWithCheck(fragment);
                }

                @Override
                public void onNegative(MaterialDialog dialog) {
                    fragment.onShowSmsDenied();
                }
            });
}

}

Permission is an enum I created it to set all details permissions inside it,

The DialogHelper class I need to repeat it, inside each package I used a permission inside it's classes

This is my problem basically

from permissionsdispatcher.

hotchemi avatar hotchemi commented on May 17, 2024

We have no plan to do that.
We constrain generated codes to being called only annotated class itself.
IMO, in your case you should modify application codes to being them more loose coupling.

from permissionsdispatcher.

hmedat avatar hmedat commented on May 17, 2024

I know your library do 1 2 3 4, but I need to give ability to change modifiers of methods,

Thant all My needs

from permissionsdispatcher.

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.