Coder Social home page Coder Social logo

drawablecopier's Introduction

DrawableCopier

Python script for copying drawable resources into your Android project from an external /res directory. It will copy each /res/drawable-* resource to the destination directory's /res/drawable-* folder.

Perfect for use with Roman Nurik's Android Asset Studio or Google's Material Design Icons!

Usage

Open up your favorite terminal. The script will provide you with confirmation messages of what will be copied before actually copying the files, giving you the option to cancel. Rest easy!

Basic

>>> python drawable_copier.py <source_res_directory> <destination_res_directory>

Example: If my Android Project is located at /Users/jmhend/MyAndroidStudioProject and the directory containing the resources I want to copy is at /Users/jmhend/Desktop/material-design-icons-1.0.1/action, the command will be:

>>> python drawable_copier.py /Users/jmhend/Desktop/material-design-icons-1.0.1/action /Users/jmhend/MyAndroidStudioProject/app/src/main/res

All resource files in the <source_res_directory> will be copied. Read on to see how to limit which files are copied.

The resource directories you supply as arguments must be the directories containing the drawable-* subdirectories. Also for now, each directory must be represented by a full directory path, i.e for example on Mac: /Users/jmhend/MyAndroidStudioProject/app/src/main/res, not ../../main/res

<destination_res_directory> is required. <source_res_directory> will default to your current working directory if not supplied.

Extra

You can supply optional arguments to limit which files are copied with the -f flag:

>>> python drawable_copier.py <source_res_directory> <destination_res_directory> -f ic_menu.png ic_action_new.png ...

This will only copy ic_menu.png and ic_action_new.png from the source directories. This is especially useful when copying files from the Material Design Icons set.

The script also supports some basic filename matching, using the --filematch optional argument:

>>> python drawable_copier.py <source_res_directory> <destination_res_directory> -f ic_action --filematch

This will copy all resources in the source directories containing the substring "ic_action". I.e, if there is ic_action_new.png and ic_action_remove.png, both will be copied. Again, you'll see a confirmation list of resources that will be copied before any copy action is made.

For more usage help, see:

>>> python drawable_copier.py --help

Disclaimer

This script has only yet been lightly tested (and only on OSX). Shoot me a note or fork if you find any bugs. Cheers!

drawablecopier's People

Contributors

jmhend avatar roelvandun avatar

Stargazers

 avatar Anton Bohomol avatar Artur Galeno avatar João Orui avatar José Luis Dupinet avatar Moh Mah avatar Jordan Bangia avatar Bob Zabor avatar Abel Joo avatar SirVon Thomas avatar Kevin Carpenter avatar  avatar Alex Bitek avatar Mark Beaty avatar Jens Knutson avatar Said Tahsin Dane avatar Sean Schendel avatar Daniel Grech avatar Ravindra Kumar avatar Johnny Molina avatar Wade avatar

Watchers

 avatar

drawablecopier's Issues

About added to Git

There is a problem:
These resources cannot be automatically added to Git

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.