Android Drawable Importer Plugin

为 IntelliJ 添加一个选项,以便从 AndroidIcons、自己的 "可绘制资源库" 导入不同分辨率的可绘制图像,并将特定图像缩小/放大到定义的分辨率。「Adds an option to IntelliJ to import drawables in different resolutions from AndroidIcons, own "drawable repos" and scale a certain image down/up to the defined resolutions.」

Github stars Tracking Chart

Android Drawable Importer Plugin

alt text

This plugin consists of three main features. You can access them by right-clicking anywhere, but not on a file, inside an Android (library) module under New.

AndroidIcons and Material Icons Drawable Import

You are able to select the asset, specify your color, change the target resource name and select all the resolutions you want to import.

All the missing folders will be created automatically. If there are already drawables with the same name, you will be warned.
You can also import Vector Drawables from the Material Icons pack.

You can even search for your desired asset by just start typing when the first spinner has focus.

alt text
alt text

You can download AndroidIcons here and Material Icons here for free.

Batch Drawable Import

Select assets (or a whole folder) and specify the source resolutions. You can change the source size of every image as well. Specify all resolutions, to which it should be resized to.

This works also with 9-Patch-Images. But take care: sometimes it's necessary to remove / add the one or other "pixel" in the 9-Patch-Editor. But just give it a try :)

alt text
alt text
alt text

Multisource-Drawable

Ever got a zip with drawables for your Android project by your designer with the following structure?

  root/
       ./drawable_ldpi.png
       ./drawable_mdpi.png
       ./drawable_hdpi.png
       ./drawable_xhdpi.png

No problem! Now you can just select for every resolution a different asset, specify one name for them, and the rest is done by the plugin.
Or even easier, you can select the whole zip, and this plugin will auto extract the asset to the best matching folder.

alt text
alt text

Hint: When you select an asset, you can also just drag a file from your explorer to the text field and drop it there.

Install Instructions (IntelliJ, Android Studio)

Step 1:

Open IntelliJ and click on the Configure button on the welcome screen.

Welcome Screen

Then click on the Plugins button to open the Plugins dialog.

Welcome Screen - Plugins

If your IntelliJ is already opened or was closed with an open project, go to the Settings in the File menu on Windows or the Preferences.. in the IntelliJ IDEA menu. Select the Plugins option on the left pane.

Settings
Settings - Plugins

Step 2:

Click on the Browse repositories... button.

Plugins

Step 3:

Search for Android Drawable Importer and select the plugin from the list. Click on the Install Plugin button and verify the selection by pressing Yes afterwards.

Install
Verify

Step 4:

Afterwards click on the Close button. If IntelliJ asks you to restart, allow it.

Restart

How to run the repository code

  1. Clone
    git clone git@github.com:winterDroid/android-drawable-importer-intellij-plugin.git
  2. Run Gradle Wrapper In project root.
    ./gradlew runIdea

Contribution

Build Status

  1. Fork it
  2. Checkout develop branch
    git checkout develop && git pull
  3. Create your feature branch
    git checkout -b my-new-feature
  4. Commit your changes
    git commit -am 'Add some feature'
  5. Squash all commits in your branch together
    git rebase -i develop
  6. Push to the branch
    git push origin my-new-feature
  7. Create new Pull Request

License

Copyright 2014 Marc Prengemann

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.

Overview

Name With OwnerwinterDroid/android-drawable-importer-intellij-plugin
Primary LanguageJava
Program languageJava (Language Count: 2)
Platform
License:Apache License 2.0
Release Count11
Last Release Name0,5 (Posted on )
First Release Name0.1 (Posted on )
Created At2014-04-07 06:58:28
Pushed At2018-11-06 10:25:16
Last Commit At2016-11-20 17:53:01
Stargazers Count861
Watchers Count29
Fork Count137
Commits Count236
Has Issues Enabled
Issues Count99
Issue Open Count22
Pull Requests Count68
Pull Requests Open Count0
Pull Requests Close Count2
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private
To the top