npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-android-template

v1.0.1

Published

Add android components in databinding way into your project

Downloads

17

Readme

generator-android-template NPM version

Create a new app from scratch and add components to it

Version : 1.0.1

This project was created in order to generate the different classes used by my other library (https://github.com/joxad/easydatabinding) using yeoman generator :

In order to make databinding working, we need to create

  • a xml layout with ...
  • a activity/fragment class
  • a vm associated to this activity/fragment

The generator is here to help developers do it faster :)

Installation

  1. First, install Yeoman and generator-android-template using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-android-template

Then generate your new project:

You will have to call the command line below IN THE ROOT of your project.

  1. In your android project

project build.gradle :

repositories {
       maven { url "http://dl.bintray.com/joxad/maven" }    
   }

app build.gradle :

compile com.joxad.easydatabinding:lib:1.1.0

How does it work

You will be ask a few questions in order to generate the needed classes :

  • applicationId => in order to know where to place the generated code
  • packageName => the package where you want to put the activity/fragment java classes
  • layout name => it will generate the xml & activity/fragment & activityVM/fragmentVM

Generate an activity

yo android-template:activity

This will generate :

  • Activity
  • Activity layout
  • Activity VM that will have your binding activity

Generate an activity with recycler (v1)

yo android-template:activity-recycler

This will generate an activity with a recycler view using https://github.com/evant/binding-collection-adapter v1

  • Activity
  • Activity layout
  • Activity VM that will have your binding activity
  • BaseVM that will handle each item model of your recycler
  • Item Layout for your recycler

In your build.gradle add :

compile 'me.tatarka.bindingcollectionadapter:bindingcollectionadapter:1.0.3'
compile 'me.tatarka.bindingcollectionadapter:bindingcollectionadapter-recyclerview:1.0.3'

Generate an activity with recycler view (v2)

yo android-template:activity-recycler-v2

This will generate an activity with a recycler view using https://github.com/evant/binding-collection-adapter v2

  • Activity
  • Activity layout
  • Activity VM that will have your binding activity
  • BaseVM that will handle each item model of your recycler
  • Item Layout for your recycler

Generate an activity with bottom bar navigation

yo android-template:activity-bottom-nav

This will generate an activity with a coordinator layout and a bottom view navigation

  • Activity
  • Activity layout
  • Activity VM that will have your binding activity
  • Menu xml in the resources
  • Menu color selector

Generate a fragment

yo android-template:fragment

This will generate :

  • Fragment
  • Fragment layout
  • Fragment VM that will have your binding fragment

Generate a support fragment

yo android-template:fragment-support

This will generate :

  • Fragment v4
  • Fragment layout
  • Fragment VM that will have your binding fragment

Generate a support fragment with recycler view (v2)

yo android-template:fragment-support-recycler-v2

This will generate an fragment with a recycler view using https://github.com/evant/binding-collection-adapter v2

  • Fragment
  • Fragment layout
  • Fragment VM that will have your binding fragment
  • BaseVM that will handle each item model of your recycler
  • Item Layout for your recycler

Generate a bottomsheet dialog fragment

yo android-template:bottom-fragment

This will generate :

  • Bottom Sheet Dialog Fragment
  • Fragment layout
  • Bottom Sheet Dialog Fragment VM that will have your binding fragment

Generate an item

yo android-template:item

This will generate :

  • BaseVM of your model
  • Item layout associated with your vm

Thanks

Very useful lib used :

https://github.com/evant/binding-collection-adapter/

It handles the databinding inside the recyclerview => No adapter to write :)

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

License

MIT © Jocelyn David