feat: extract color schemes only if 'scheme.prop' file does not exist

This commit is contained in:
Akash Yadav
2022-12-25 13:11:52 +05:30
parent 19f35e2b93
commit fcce7e804b
2 changed files with 12 additions and 2 deletions
@@ -82,8 +82,18 @@ public class ToolsManager {
final var dir = new File(Environment.ANDROIDIDE_UI, defPath);
try {
for (final String asset : app.getAssets().list(defPath)) {
ResourceUtils.copyFileFromAssets(
defPath + "/" + asset, new File(dir, asset).getAbsolutePath());
final var prop = new File(dir, asset + "/" + "scheme.prop");
if (prop.exists()) {
continue;
}
final File schemeDir = new File(dir, asset);
if (schemeDir.exists()) {
schemeDir.delete();
}
ResourceUtils.copyFileFromAssets(defPath + "/" + asset, schemeDir.getAbsolutePath());
}
} catch (IOException e) {
LOG.error("Failed to extract color schemes", e);
Binary file not shown.