Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
/ pump Public archive

Generate inflater classes for view binding, store them and easy to access.

License

Notifications You must be signed in to change notification settings

shenghaiyang/pump

Repository files navigation

Pump

Generate inflater classes for view binding, store them and easy to access.

Snapshots

Adding dependencies

First, add the pump-gradle-plugin plugin to your project's root build.gradle file:

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"
        classpath "com.shenghaiyang.pump:pump-gradle-plugin:4.0.1-r1-SNAPSHOT"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
    }
}

Then, apply the Gradle plugin and add these dependencies in your app/build.gradle file:

apply plugin: 'com.android.application'
apply plugin: 'com.shenghaiyang.pump'

dependencies {
    implementation "com.shenghaiyang.pump:pump:4.0.1-r1-SNAPSHOT"
}

Inflate ViewBinding

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ActivityMainBinding mainBinding = Pump.inflate(ActivityMainBinding.class, getLayoutInflater());
        setContentView(mainBinding.getRoot());
    }
}

TODO

  • incremental support

License

Copyright 2020 shenghaiyang

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.

About

Generate inflater classes for view binding, store them and easy to access.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published