Green Android is a project that consists of two main parts:
- Component Library: A reusable library of UI components designed for Android applications. This library is distributed via GitHub Packages, making it easy to integrate into your own projects.
- Companion App: A demonstration app showcasing the components available in the library. The app provides examples of how to use the components and serves as a reference for developers.
The component library is a collection of customizable UI components designed to simplify and accelerate Android development. It is distributed as an .aar
package via GitHub Packages.
- A variety of reusable UI components.
- Fully customizable colors, styles, and behaviors.
- Designed with accessibility and performance in mind.
- Distributed via GitHub Packages for easy integration.
To use the component library in your project, add the following configuration to your build.gradle.kts
file:
- Add the GitHub Packages repository to your
repositories
block:
repositories {
maven {
setUrl("https://maven.pkg.github.com/seb-oss/green-android")
credentials {
username = System.getenv("GPR_USER") ?: "<your-github-username>"
password = System.getenv("GPR_TOKEN") ?: "<your-github-token>"
}
}
}
- Add the library as a dependency:
dependencies {
implementation("se.seb.green:components:<latest-version>")
}
Note: Replace
<latest-version>
with the latest version of the library. You will also need to set up a GitHub Personal Access Token (PAT) with the appropriate permissions to access GitHub Packages.
Once installed, you can start using the components in your project. For example:
// Example usage of a Switch component
var checked by remember { mutableStateOf(true) }
GreenSwitch(
checked = checked,
onCheckedChanged = { checked = it },
style = GreenSwitchDefaults.defaultStyle()
)
Refer to the Companion App for detailed examples of how to use the components.
The companion app is a showcase of the components available in the library. It demonstrates how to use the components and provides a visual reference for their appearance and behavior.
- Interactive examples of all components.
- A clean and intuitive UI for browsing components.
- Clone the repository:
git clone [email protected]:seb-oss/green-android.git
-
Open the project in Android Studio.
-
Select the
app
module and run it on an emulator or physical device.
To build the project locally:
- Ensure you have Java 17 installed.
- Run the following command to build the library and the app:
./gradlew build
Contributions are welcome! If you would like to contribute to the project:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.