Skip to content

Latest commit

 

History

History
59 lines (48 loc) · 1.7 KB

README.md

File metadata and controls

59 lines (48 loc) · 1.7 KB

AndroidCore

AndroidCore make you get the most rapid development.

Release

Wiki

To know what's inside in this repository, please read our Wiki

Changelog

Read the CHANGELOG to find out what's included in the latest update!

Download

Add it to your build.gradle with:

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and:

dependencies {
    implementation 'com.github.crocodic-studio:AndroidCoreProject:{latest version}'
}

Usage

1. Extend CoreActivity

To get DataBinding and ViewModel implementation

class HomeActivity : CoreActivity<ActivityHomeBinding, HomeViewModel>(R.layout.activity_home) {
  override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // auto generate binding and viewModel variable
        binding.lifecycleOwner = this
        binding.viewModel = viewModel
  }
}

2. Extend NoViewModelActivity

To get DataBinding without ViewModel implementation

class HomeActivity : NoViewModelActivity<ActivityHomeBinding>(R.layout.activity_home) {
  override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // auto generate binding variable
        binding.lifecycleOwner = this
  }
}

License

Licensed under the Apache License, Version 2.0,