IntelliJ plugin for supporting PermissionsDispatcher

Overview

PermissionsDispatcher plugin

IntelliJ plugin for supporting PermissionsDispatcher.

PermissionsDispatcher is wonderful library for Runtime Permissions. However, it asks developers "attach annotations" and "delegate to generated class" and then after that "rebuild". It's hard to follow all steps correctly. This plugin generates the skelton of methods for "attach annotations" and "delegate to generated class" using GUI.

How to install?

Use the IDE's plugin manager to install the latest version of the plugin.

How to use?

Add dependencies (Optional)

  • Open build.gradle and Generate -> Add PermissionsDispatcher dependencies

(If you already add the dependencies, there is no 'Add PermissionsDispatcher dependencies' menu.)

dep

Generate Runtime Permissions codes

  • Open Activity/Fragment
  • Generate -> Generate Runtime Permissions...
  • Choose permissions and enter method names for each annotations
  • Click Generate button
  • Done!

pd

(It skips "rebuild" for making gif small, but it is highly recommended to rebuild after generating codes.)

Add a generation method call

  • Generate -> Add a generation method call
  • (If there is multiple choices, dialog asks which method you want to delegate)
  • Done!

add_delegation

Settings

You can change PermissionsDispatcher plugin from Preferences... > Other Settings > PermissionsDispatcher plugin

Rebuild

There are 3 behaviors for rebuilding project after generating PermissionsDispatcher code.

Type Behavior
Prompt (Default) Show dialog
Always Always rebuild without dialog
Not Always Does not rebuild

Supported PermissionsDispatcher version

License

Copyright 2017 Yoshinori Isogai

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Plugin Error: PermissionsDispatcher plugin threw an uncaught NullPointerException. Disable Plugin 12:38:45 NullPointerException: null

    Plugin Error: PermissionsDispatcher plugin threw an uncaught NullPointerException. Disable Plugin 12:38:45 NullPointerException: null

    Using the latest Android Studio 2.1.1

    Plugin Error: PermissionsDispatcher plugin threw an uncaught NullPointerException. Disable Plugin 12:38:45 NullPointerException: null

    opened by ArthurSav 10
  • can't install this plugin

    can't install this plugin

    android studio 2.2.2 when i install this plugin from browse repositories, it can't download. so i use install plugin from disk, this can install but when i restart android studio, it warn this plugin has some problems. please help me!

    Question 
    opened by gqandroid 3
  • androidannotations  not used Permissions-dispatcher

    androidannotations not used Permissions-dispatcher

    my project is used androidannotations https://github.com/androidannotations/androidannotations and cannot Integrate permissions-dispatcher

    java.lang.RuntimeException: permissions.dispatcher.processor.exception.NoAnnotatedMethodsException: Annotated class 'LoginActivity_' doesn't have any method annotated with '@NeedsPermission'

    Question 
    opened by xiangou 2
  • fix ImportPath

    fix ImportPath

    fix #75

    In Kotlin 1.1.2, ImportPath(String) was removed. Maybe ImportPath(FqName, Boolean) works fine. https://github.com/JetBrains/kotlin/commit/babb3b557dbd11b41d1885eb0defc0d7e5609ad2#diff-75af61ffa546231c196398f21cc919c1

    opened by sckm 2
  • v3.0.0

    v3.0.0

    v3.0.0 has a big changes. We need to take care of them like we did for v2.1.3 https://github.com/permissions-dispatcher/permissions-dispatcher-plugin/blob/a5b3d78266f6d418f694137d493b1648d2fd18ad/src/main/kotlin/com/github/shiraji/permissionsdispatcherplugin/views/GeneratePMCodeDialogDelegate.kt#L77

    opened by shiraji 1
  • "Generate Runtime Permissions" not work in Kotlin file

    When I trying to generate some methods with "Generate Runtime Permissions" in kotlin file, I'm getting the following error

    [ 139300]  ERROR - llij.ide.plugins.PluginManager - org.jetbrains.kotlin.resolve.ImportPath.<init>(Ljava/lang/String;)V 
    java.lang.NoSuchMethodError: org.jetbrains.kotlin.resolve.ImportPath.<init>(Ljava/lang/String;)V
    	at com.github.shiraji.permissionsdispatcherplugin.handlers.GeneratePMCodeHandlerKt.addImport(GeneratePMCodeHandlerKt.kt:115)
    	at com.github.shiraji.permissionsdispatcherplugin.handlers.GeneratePMCodeHandler.addRuntimePermissionAnnotation(GeneratePMCodeHandler.kt:33)
    	at com.github.shiraji.permissionsdispatcherplugin.handlers.GeneratePMCodeHandler.invoke(GeneratePMCodeHandler.kt:19)
    	at com.github.shiraji.permissionsdispatcherplugin.handlers.GeneratePMCodeHandlerKt.invoke(GeneratePMCodeHandlerKt.kt:17)
    	at com.intellij.codeInsight.actions.CodeInsightAction.lambda$null$0(CodeInsightAction.java:59)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:898)
    	at com.intellij.codeInsight.actions.CodeInsightAction.lambda$actionPerformedImpl$1(CodeInsightAction.java:62)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:129)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:100)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:86)
    	at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformedImpl(CodeInsightAction.java:55)
    	at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformed(CodeInsightAction.java:41)
    	at com.github.shiraji.permissionsdispatcherplugin.actions.GeneratePMCodeAction.access$actionPerformed$s-307674507(GeneratePMCodeAction.kt:30)
    	at com.github.shiraji.permissionsdispatcherplugin.actions.GeneratePMCodeAction$actionPerformed$2.invoke(GeneratePMCodeAction.kt:102)
    	at com.github.shiraji.permissionsdispatcherplugin.actions.GeneratePMCodeAction.actionPerformed(GeneratePMCodeAction.kt:124)
    	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:197)
    	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    	at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:156)
    	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:211)
    	at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep.performAction(PopupFactoryImpl.java:875)
    	at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep.lambda$onChosen$0(PopupFactoryImpl.java:863)
    	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:199)
    	at com.intellij.ui.popup.AbstractPopup.lambda$null$7(AbstractPopup.java:1390)
    	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    	at java.awt.EventQueue.access$500(EventQueue.java:97)
    	at java.awt.EventQueue$3.run(EventQueue.java:709)
    	at java.awt.EventQueue$3.run(EventQueue.java:703)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795)
    	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
    	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    [ 139306]  ERROR - llij.ide.plugins.PluginManager - Android Studio 2.3.3  Build #AI-162.4069837 
    [ 139308]  ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_92 
    [ 139308]  ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM 
    [ 139308]  ERROR - llij.ide.plugins.PluginManager - Vendor: Oracle Corporation 
    [ 139308]  ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X 
    [ 139308]  ERROR - llij.ide.plugins.PluginManager - Last Action: Generate 
    
    
    Bug 
    opened by sckm 1
  • Remove the case when no pd version found

    Remove the case when no pd version found

    This is because some developer add PD dependency in some unique format. Since I can't pick them all, at least this plugin let them generate the code.

    Close #43

    opened by shiraji 1
  • It doesn't work

    It doesn't work

    gradle:

    dependencies { //permissions compile appDependencies.permissionsDispatcher annotationProcessor appDependencies.permissionsDispatcherProcessor }

    appDependencies = [ permissionsDispatcher : "com.github.hotchemi:permissionsdispatcher:${permissionsDispatcherVersion}", permissionsDispatcherProcessor: "com.github.hotchemi:permissionsdispatcher-processor:${permissionsDispatcherVersion}", ]

    It doesn't work ,,fragment or activity generate show : image

    opened by BigKarel 1
  • PD v2.2.0

    PD v2.2.0

    PermissionsDispatcher v2.2.0 is available https://github.com/hotchemi/PermissionsDispatcher/releases/tag/2.2.0

    ~~I don't think there is no change for this plugin but make sure it is working.~~

    I lie. This plugin need to support maxSdkVersion. Maybe add checkbox and then if the checkbox is selected, add maxSdkVersion = 18 from manifest file. (or just show text box for maxSdkVersion value)

    • [x] Support maxSdkVersion
    • [x] Update README
    ContributionWelcome FeatureRequest Documentation 
    opened by shiraji 1
  • Add PermissionsDispatcher to dependencies

    Add PermissionsDispatcher to dependencies

    Add this to app/build.gradle

    buildscript {
      dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
      }
    }
    
    apply plugin: 'android-apt'
    
    dependencies {
      compile 'com.github.hotchemi:permissionsdispatcher:2.1.3'
      apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.3'
    }
    

    2.1.3 is hard coded for first release.

    ContributionWelcome FeatureRequest 
    opened by shiraji 1
  • Make travis ci works

    Make travis ci works

    • [x] Add .travis.yml
    • [x] Connect with travis ci
    • [x] Add RELEASING.md
    • [x] Fix https://github.com/shiraji/permissions-dispatcher-plugin/blob/master/.travis/after_success.sh
    • [x] Fix plugin id https://github.com/shiraji/permissions-dispatcher-plugin/blob/master/build.gradle#L30
    opened by shiraji 1
  • Missing `apply plugin: 'kotlin-kapt'` for kotlin version

    Missing `apply plugin: 'kotlin-kapt'` for kotlin version

    Missing add apply plugin: 'kotlin-kapt' code into Gradle for kotlin version Now it won't add apply plugin: 'kotlin-kapt' code ,And then I paste much time to find that was missing the code. It would be greate for generating code like this:

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-android-extensions'
    apply plugin: 'kotlin-kapt'
    
    
    opened by wuseal 0
  • Refactoring...

    Refactoring...

    Currently, we have a lot of duplicated methods and logics in View classes.

    After createing generating missing functions, I think it's time to refactoring code.

    opened by shiraji 0
Releases(2.0.0)
IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea

IntelliJ Idea Astor Plugin IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea. It communicates with a local/remote program

null 4 Aug 28, 2021
Intellij-platform-plugin-template - IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template TL;DR: Click the Use this template button and

null 0 Jan 1, 2022
Kirill Rakhman 4 Sep 15, 2022
eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.

eventbus-intellij-plugin Plugin to navigate between events posted by EventBus. Post to onEvent and onEvent to Post Install There are two ways. Prefere

Shinnosuke Kugimiya 315 Aug 8, 2022
IntelliJ Plugin for Android Parcelable boilerplate code generation.

IntelliJ/Android Studio Plugin for Android Parcelable boilerplate code generation This tool generates an Android Parcelable implementation based on fi

Michał Charmas 2.1k Dec 27, 2022
A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.

ADB Idea A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development. The following commands are provided: Uninst

Philippe Breault 2k Dec 28, 2022
IntelliJ / Android Studio plugin for Android Holo Colors

This project is not maintained anymore. Holo Colors doesn't make sense since the introduction of Material Design and the ability to set the primary co

Jérôme Van Der Linden 644 Nov 10, 2022
Android Studio & IntelliJ Plugin for sort xml by name="xxx".

AndroidXmlSorter Android Studio & IntelliJ Plugin for sort xml by name="xxx". Options Insert space between difference prefix ('Snake Case', 'Camel Cas

Kaoru Tsutsumishita 102 Nov 29, 2022
IntelliJ plugin that provides some useful utilities to support the daily work with Gradle.

IntelliJ Gradle Utilities Plugin This IntelliJ plugin provides some useful utilities to support the daily work with Gradle. It's available on the offi

Marcel Kliemannel 6 Jul 29, 2022
IntelliJ-based IDEs Protobuf Language Plugin that provides Protobuf language support.

IntelliJ Protobuf Language Plugin Reference Inspired by protobuf-jetbrains-plugin and intellij-protobuf-editor. Descriptor IntelliJ-based IDEs Protobu

Kanro 72 Dec 7, 2022
Plugin for IntelliJ-based IDEs folding root files in the ProjectView

Foldable ProjectView The Foldable ProjectView is a plugin for the IntelliJ-based IDEs that lets you fold files located in the root of your project. Av

Jakub Chrzanowski 47 Dec 13, 2022
IntelliJ plugin that provides a modern and powerful byte code analyzer tool window.

IntelliJ Byte Code Analyzer Plugin This IntelliJ plugin provides a modern and powerful byte code analyzer tool window. Its supports Java, Kotlin, Groo

Marcel Kliemannel 29 Nov 9, 2022
✈️ IDE plugin for the IntelliJ platform which adds GitHub Copilot support. (VERY WIP)

JetBrains Copilot GitHub Copilot support for the IntellIJ Platform. Installation Download the latest release. Select the Install Plugin from Disk opti

Koding 155 Dec 10, 2022
A plugin that adds support for rs2asm files to IntelliJ.

Rs2Asm This plugin adds some simple features when interacting with rs2asm files. Features Syntax highlighting Autocompletion for label names and instr

Joshua Filby 3 Dec 16, 2021
IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template is a repository that provides a pure template to make it easier to create a new plugin project (check the Creating a repository from a template article).

null 0 Nov 8, 2021
IntelliJ IDEA / PhpStorm InertiaJS Plugin

PhpStorm and IntelliJ IDEA Inertia.js Plugin Provides support in PhpStorm and IntelliJ IDEA Ultimate for Inertia.js. ?? GitHub Issues: feature request

Matthew Hailwood 16 Dec 18, 2022
A playground to development intellij plugin

pluginExporlor Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get familiar with the template documentation. Verify the plu

Woody Hu 0 Nov 23, 2021
Developer ToolBox IntelliJ Plugin

developer-toolbox Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get familiar with the template documentation. Verify the

canarin 0 Dec 11, 2021
A IntelliJ plugin to provide check on 'value type' which is limited to numerical constant values

ValueType A IntelliJ plugin to provide check on 'value type' which is limited to

Bennyhuo 4 Mar 11, 2022