Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
konifar committed Jul 6, 2015
1 parent e01bc39 commit df3257a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 22 deletions.
9 changes: 1 addition & 8 deletions META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,15 @@
]]></description>

<change-notes><![CDATA[
1.3: Fixed a crashing issue in Windows
1.3: Fixed a crashing issue in Windows & Added transparency color support.
1.2: Add custom color function & Reduce unnecessary icons.
1.1: Add resource dir setting & Add document for Windows/Linux.
1.0: First version released.
]]>
</change-notes>

<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
<idea-version since-build="131"/>

<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
on how to target different products -->
<!-- uncomment to enable plugin in all products
<depends>com.intellij.modules.lang</depends>
-->

<depends>com.intellij.modules.java</depends>
<depends>org.jetbrains.android</depends>

Expand Down
3 changes: 2 additions & 1 deletion MaterialDesignIconGeneratorPlugin.iml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="IntelliJ 1.6" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="android" level="project" />
</component>
</module>
Binary file added lib/android.jar
Binary file not shown.
9 changes: 1 addition & 8 deletions src/com/konifar/material_icon_generator/IconModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,7 @@ private String getIconName(String shortName, String colorName) {
}

public String getResourcePath(Project project) {
//This fails in Windows. Let's assume a complete path for now
// if (resDir.startsWith(project.getBasePath())) {
return resDir;
// }
// StringBuilder sb = new StringBuilder();
// sb.append(project.getBasePath());
// sb.append(resDir);
// return sb.toString();
return resDir;
}

public String getCopyPath(Project project, String size) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public class MaterialDesignIconGenerateDialog extends DialogWrapper {
private static final String ERROR_ICON_NOT_SELECTED = "Please select icon.";
private static final String ERROR_FILE_NAME_EMPTY = "Please input file name.";
private static final String ERROR_SIZE_CHECK_EMPTY = "Please check icon size.";
private static final String ERROR_RESOURCE_DIR_NOTHING_PREFIX = "Cannot find resource dir: ";
private static final String ERROR_CUSTOM_COLOR = "Cannot parse custom color. Please provide color in hex format (#FFFFFF).";
private static final String ERROR_RESOURCE_DIR_NOTHING_PREFIX = "Can not find resource dir: ";
private static final String ERROR_CUSTOM_COLOR = "Can not parse custom color. Please provide color in hex format (#FFFFFF).";

private static final String PACKAGE = "/com/konifar/material_icon_generator/";
private static final String ICON_CONFIRM = PACKAGE + "icons/toggle/drawable-mdpi/ic_check_box_white_48dp.png";
Expand Down Expand Up @@ -222,9 +222,9 @@ private void setText() {
}

private void initResDirectoryName() {
resDirectoryName.setText(DEFAULT_RES_DIR);
resDirectoryName.setText(project.getBasePath() + DEFAULT_RES_DIR);
List<AndroidFacet> facets = AndroidUtils.getApplicationFacets(project);
//This code needs refined to support multiple facets and multiple resource directories
// This code needs refined to support multiple facets and multiple resource directories
if (facets.size() >= 1) {
List<VirtualFile> allResourceDirectories = facets.get(0).getAllResourceDirectories();
if (allResourceDirectories.size() >= 1) {
Expand Down Expand Up @@ -279,7 +279,7 @@ public void propertyChange(PropertyChangeEvent event) {
}

private void initColorComboBox() {
colorPaletteMap = new HashMap<>();
colorPaletteMap = new HashMap<String, String>();

Document doc;
try {
Expand Down

0 comments on commit df3257a

Please sign in to comment.