├── .idea ├── .name ├── encodings.xml ├── vcs.xml ├── uiDesigner.xml ├── modules.xml ├── misc.xml └── workspace.xml ├── snippets └── FilesUtils.java ├── Plugin.jar ├── droid_snippet_usage_demo.gif ├── plugin_settings └── droid_snippet_settings.jar ├── out └── production │ └── Plugin │ ├── xyz │ └── belvi │ │ ├── TemplateContext.class │ │ └── TemplateProvider.class │ ├── liveTemplates │ ├── DroidSnippet_FileUtils.xml │ ├── DroidSnippet_PermissionUtils.xml │ ├── DroidSnippet_TimeUtils.xml │ ├── DroidSnippet_Utils.xml │ ├── DroidSnippet_LocationUtils.xml │ ├── DroidSnippet_ServiceUtils.xml │ ├── DroidSnippet_NetworkUtils.xml │ ├── DroidSnippet_DeviceUtils.xml │ ├── DroidSnippet_Constants.xml │ ├── DroidSnippet_IntentUtils.xml │ ├── DroidSnippet_ScreenUtils.xml │ └── DroidSnippet_ConvertUtils.xml │ └── META-INF │ └── plugin.xml ├── src └── xyz │ └── belvi │ ├── TemplateContext.java │ └── TemplateProvider.java ├── ref └── DeviceUtils.md ├── Plugin.iml ├── LICENSE ├── resources ├── liveTemplates │ ├── DroidSnippet_FileUtils.xml │ ├── DroidSnippet_PermissionUtils.xml │ ├── DroidSnippet_TimeUtils.xml │ ├── DroidSnippet_Utils.xml │ ├── DroidSnippet_LocationUtils.xml │ ├── DroidSnippet_ServiceUtils.xml │ ├── DroidSnippet_NetworkUtils.xml │ ├── DroidSnippet_DeviceUtils.xml │ ├── DroidSnippet_Constants.xml │ ├── DroidSnippet_IntentUtils.xml │ ├── DroidSnippet_ScreenUtils.xml │ ├── DroidSnippet_ConvertUtils.xml │ └── DroidSnippet_ImageUtils.xml └── META-INF │ └── plugin.xml └── README.md /.idea/.name: -------------------------------------------------------------------------------- 1 | Droid Snippet -------------------------------------------------------------------------------- /snippets/FilesUtils.java: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Plugin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KingsMentor/Droid-Snippet/HEAD/Plugin.jar -------------------------------------------------------------------------------- /droid_snippet_usage_demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KingsMentor/Droid-Snippet/HEAD/droid_snippet_usage_demo.gif -------------------------------------------------------------------------------- /plugin_settings/droid_snippet_settings.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KingsMentor/Droid-Snippet/HEAD/plugin_settings/droid_snippet_settings.jar -------------------------------------------------------------------------------- /out/production/Plugin/xyz/belvi/TemplateContext.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KingsMentor/Droid-Snippet/HEAD/out/production/Plugin/xyz/belvi/TemplateContext.class -------------------------------------------------------------------------------- /out/production/Plugin/xyz/belvi/TemplateProvider.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KingsMentor/Droid-Snippet/HEAD/out/production/Plugin/xyz/belvi/TemplateProvider.class -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/xyz/belvi/TemplateContext.java: -------------------------------------------------------------------------------- 1 | package xyz.belvi; 2 | 3 | import com.intellij.codeInsight.template.TemplateContextType; 4 | import com.intellij.psi.PsiFile; 5 | 6 | public class TemplateContext extends TemplateContextType { 7 | protected TemplateContext() { 8 | super("JAVA", "Java"); 9 | } 10 | 11 | @Override 12 | public boolean isInContext(PsiFile file, int offset) { 13 | 14 | return file.getName().endsWith(".java"); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /ref/DeviceUtils.md: -------------------------------------------------------------------------------- 1 | 2 | # DeviceUtils 3 | ***Snippet for device related functionalities*** 4 | 5 | * deviceUtils_isDeviceRooted - ***check if device is rooted or not*** 6 | * deviceUtils_getSDKVersion - ***get SDK version of the device*** 7 | * deviceUtils_getAndroidID - ***get ID of the device*** 8 | * deviceUtils_getMacAddress - ***get mac address of a device"*** 9 | * deviceUtils_reboot - ***reboot a device*** 10 | * deviceUtils_getModel - ***get model of the device*** 11 | * deviceUtils_getManufacturer - ***get device manufacture*** 12 | * deviceUtils_getMacAddressByNetworkInterface - ***get mac address by network interface*** 13 | -------------------------------------------------------------------------------- /Plugin.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Nosakhare Belvi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/xyz/belvi/TemplateProvider.java: -------------------------------------------------------------------------------- 1 | package xyz.belvi; 2 | 3 | 4 | import com.intellij.codeInsight.template.impl.DefaultLiveTemplatesProvider; 5 | import com.intellij.ide.structureView.*; 6 | import com.intellij.lang.PsiStructureViewFactory; 7 | import com.intellij.openapi.editor.Editor; 8 | import com.intellij.psi.PsiFile; 9 | import org.jetbrains.annotations.*; 10 | 11 | public class TemplateProvider implements DefaultLiveTemplatesProvider { 12 | @Override 13 | public String[] getDefaultLiveTemplateFiles() { 14 | 15 | 16 | return new String[]{ 17 | 18 | 19 | "liveTemplates/DroidSnippet_Constants", 20 | "liveTemplates/DroidSnippet_ConvertUtils", 21 | "liveTemplates/DroidSnippet_DeviceUtils", 22 | "liveTemplates/DroidSnippet_FileUtils", 23 | "liveTemplates/DroidSnippet_ImageUtils", 24 | "liveTemplates/DroidSnippet_IntentUtils", 25 | "liveTemplates/DroidSnippet_LocationUtils", 26 | "liveTemplates/DroidSnippet_NetworkUtils", 27 | "liveTemplates/DroidSnippet_PermissionUtils", 28 | "liveTemplates/DroidSnippet_ScreenUtils", 29 | "liveTemplates/DroidSnippet_ServiceUtils", 30 | "liveTemplates/DroidSnippet_TimeUtils", 31 | "liveTemplates/DroidSnippet_Utils" 32 | }; 33 | 34 | 35 | } 36 | 37 | 38 | 39 | @Nullable 40 | @Override 41 | public String[] getHiddenLiveTemplateFiles() { 42 | return new String[0]; 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_FileUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_FileUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_PermissionUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_PermissionUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | -------------------------------------------------------------------------------- /resources/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | xyz.belvi.droid_snippet 3 | Droid Snippet 4 | 1.0.2 5 | Nosakhare Belvi 6 | 7 | 9 | Speed up development time by adding access to important android utils snippet. 10 | 11 |

Contributions

12 | 13 | Send a PR, Suggestions and snippet you used quiet often via 14 | 15 | Droid Snippet 16 | 17 |

Credits

18 | 19 | AndroidUtilCode 20 | ]]>
21 | 22 | 23 | 1.0.0-beta 26 | 35 | 36 |

1.0.1

37 | 38 |

Enhanced Utils

39 | 40 | 41 | 42 |
  • Device Utils
  • 43 |
  • Utils
  • 44 | 45 | 46 | 47 |

    New Entries

    48 |
      49 | 50 |
    • File Utils
    • 51 |
    • Image Utils
    • 52 |
    • Service Utils
    • 53 |
    • Time Utils
    • 54 | 55 |
    56 | 57 |

    1.0.2

    58 | 59 |

    New Entries

    60 | 61 |
      62 | 63 |
    • Constants
    • 64 |
    • Convert Utils
    • 65 | 66 |
    67 | ]]> 68 |
    69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | com.intellij.modules.androidstudio 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 |
    -------------------------------------------------------------------------------- /out/production/Plugin/META-INF/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | xyz.belvi.droid_snippet 3 | Droid Snippet 4 | 1.0.2 5 | Nosakhare Belvi 6 | 7 | 9 | Speed up development time by adding access to important android utils snippet. 10 | 11 |

    Contributions

    12 | 13 | Send a PR, Suggestions and snippet you used quiet often via 14 | 15 | Droid Snippet 16 | 17 |

    Credits

    18 | 19 | AndroidUtilCode 20 | ]]>
    21 | 22 | 23 | 1.0.0-beta 26 |
      27 |
    • Utils
    • 28 |
    • Network Utils
    • 29 |
    • Device Utils
    • 30 |
    • Screen Utils
    • 31 |
    • Location Utils
    • 32 |
    • Permission Utils
    • 33 |
    • Intent Utils
    • 34 |
    35 | 36 |

    1.0.1

    37 | 38 |

    Enhanced Utils

    39 | 40 | 41 | 42 |
  • Device Utils
  • 43 |
  • Utils
  • 44 | 45 | 46 | 47 |

    New Entries

    48 |
      49 | 50 |
    • File Utils
    • 51 |
    • Image Utils
    • 52 |
    • Service Utils
    • 53 |
    • Time Utils
    • 54 | 55 |
    56 | 57 |

    1.0.2

    58 | 59 |

    New Entries

    60 | 61 |
      62 | 63 |
    • Constants
    • 64 |
    • Convert Utils
    • 65 | 66 |
    67 | ]]> 68 |
    69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | com.intellij.modules.androidstudio 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 |
    -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_TimeUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_TimeUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_Utils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_Utils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_LocationUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_LocationUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **This plugin is still in alpha stage, so it might be unstable. Feel free to share your feedback and report issues!** 2 | 3 | This plugin is in JetBrains Plugins Repository! Get it from [here](https://plugins.jetbrains.com/plugin/10198-droid-snippet). 4 | 5 | # Droid-Snippet 6 | ![Take a look](droid_snippet_usage_demo.gif) 7 | 8 | Live Coding Template for Android Studio. 9 | Speed up development time by adding access to important android utils snippet. 10 | Droid Snippet is currating fingertips utils needed in day to day development of android application. 11 | 12 | Usage: 13 | 14 | Find the **Droid Snippet** action with `CMD+J` shortcut and type the initials of the utils you are looking for. 15 | ### Available Utils : 16 | 17 | * Constants 18 | * Convert Utils 19 | * ![Device Utils](ref/DeviceUtils.md) 20 | * File Utils 21 | * ImageUtils 22 | * Intent Utils 23 | * Location Utils 24 | * Network Utils 25 | * Permission Utils 26 | * Screen Utils 27 | * ServiceUtils 28 | * Time Utils 29 | * Utils (General Utilities like isEmpty, isSpace) 30 | 31 | ## Installation 32 | 33 | ### Online Repository 34 | Android Studio > Preference > Plugin > Browse Repositories > Search > Droid Snippet > Install and Restart 35 | 36 | ### From Disk 37 | [Download Droid Snippet.jar](https://github.com/KingsMentor/Droid-Snippet/blob/master/Plugin.jar?raw=true) > Android Studio > Preference > Plugin > Install plugin from disk > find Droid Snippet . jar> select > Install and Restart 38 | 39 | ## Setting Up Project on IntelliJ 40 | 41 | * Clone repository into local disk 42 | * Import project 43 | * [Download Droid Snippet Settings](https://github.com/KingsMentor/Droid-Snippet/blob/master/plugin_settings/droid_snippet_settings.jar?raw=true) 44 | * IntelliJ > File > Import Settings > Select droid_snippet_settings.jar > Confirm and Restart IntelliJ 45 | * `CMD+,` to lauch Preferences Screen on Intellij 46 | * Editor > Live Templates 47 | * [Learn more on live template support](https://www.jetbrains.org/intellij/sdk/docs/tutorials/live_templates/template_support.html) 48 | 49 | ## Disclaimer 50 | This is built off utils on [Android Utils Code](https://github.com/Blankj/AndroidUtilCode) . 51 | This is continuously a work in progress and more utils will be added based on usage and contributions. 52 | 53 | ## Contribution 54 | * Snippets can be suggested by adding utilsFile.java to `/snippets` on the repository or 55 | * Contribution to [Android Utils Code](https://github.com/Blankj/AndroidUtilCode) or 56 | * [Live templates](https://www.jetbrains.org/intellij/sdk/docs/tutorials/live_templates/template_support.html) 57 | 58 | ### Before sending a PR 59 | 60 | * Naming Convention - Ensure naming convertion follwing the pattern. UtilsCategoryName_UtilsFunction (e.g networkUtils_isConnected) 61 | * Test (Application for live template resource) - ensure it's tested and works as expected. 62 | 63 | Adequate testing will be conducted before a PR is accepted. 64 | 65 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_ServiceUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_ServiceUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_NetworkUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 17 | 22 | 27 | 32 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_NetworkUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 17 | 22 | 27 | 32 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_DeviceUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | 37 | 42 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_DeviceUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | 37 | 42 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_Constants.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_Constants.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_IntentUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | 37 | 42 | 47 | 52 | 57 | 62 | -------------------------------------------------------------------------------- /out/production/Plugin/liveTemplates/DroidSnippet_IntentUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | 37 | 42 | 47 | 52 | 57 | 62 | -------------------------------------------------------------------------------- /resources/liveTemplates/DroidSnippet_ScreenUtils.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | 37 |