ahmedrizwan / Andgen
Programming Languages
Andgen
A terminal based templates generator for Android!
It's similar to what 'rails generate' command does on Ruby on Rails.
Why?
Because terminals are awesome! And some [other reasons] (https://medium.com/@ahmedrizwan/andgen-generating-android-templates-from-terminal-616e2cb3afa6#.uf1tstpsu)...
Installation
Using HomeBrew
brew tap ahmedrizwan/andgen
brew install andgen
Usage
Step 0: Navigate to the module directory of your project
To see available commands and format, do
andgen --help
Generating Activities
To check the format and examples, execute
andgen activity
Simple activity creation
andgen activity SomeActivity
Generated file will look like
Create activity with Layout
andgen activity -l SomeActivity
Create activity with bindable layout
andgen activity -bl SomeActivity
Create acvivity and place it inside some package
andgen activity SomeActivity com.example
No one wants to write down full package! So simply do this
andgen activity SomeActivity example
But what if there's a conflict!? No worries, andgen will ask you to select the package
Generating Fragments
Same commands and format as Activities
Simple Fragment
andgen fragment SomeFragment
Fragment with a Layout
andgen fragment -l SomeFragment
Fragment with a Bindable Layout
andgen fragment -bl SomeFragment
This will generate code like
Generating Layouts
For a simple layout
andgen layout my_layout
And for bindable layout (which is enclosed inside layout tag)
andgen layout -bl my_layout
TODO
- Add more templates : EmptyActivity, ListActivity and so on
- Add third party templates for : Mosby, Conductor etc
License
Copyright 2016 Ahmed Rizwan
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.