This project is a practical demonstration of the concepts discussed in the article "Can You Create a Bookmark Button in Jetpack Compose?" 📖. It showcases the creation of a bookmark button in Jetpack Compose with three states - Bookmarked 📌, Not bookmarked ❌, and Toggling 🔄. The project emphasizes not just on the UI implementation but also on testing 🧪, performance 🚀, handling configuration changes 🔄, and other key aspects of feature development in Android.
- Bookmark Button Implementation: A fully functional bookmark button with three distinct states, demonstrating state management and UI updates in Jetpack Compose.
- Unit and UI Testing: Examples of how to write tests for the bookmark button, ensuring its functionality remains consistent across app updates.
- Performance Metrics: Implementation of Jetpack Compose performance metrics to monitor and optimize the UI's performance.
- Handling Configuration Changes: Demonstrates how to preserve the bookmark button's state across configuration changes, ensuring a seamless user experience.
- Accessibility: Tips on making the bookmark button accessible to all users, including those with disabilities.
To get a local copy up and running, follow these simple steps:
- Android Studio Iguana | 2023.2.1 RC 1 🛠️
- Kotlin 1.9.22 or later 🕹️
- Clone the repo
git clone https://github.com/LloydBlv/BookmarkButton.git
- Open the project in Android Studio.
- Build the project and run on an emulator or a real device.
This project can be used as a reference for implementing a bookmark button in your own Jetpack Compose applications. It demonstrates not just how to create interactive UI components but also how to ensure they are robust, performant, and accessible.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project includes both unit tests and UI tests to ensure the bookmark button works as expected:
- Unit Tests: Verify the logic behind the bookmark button's states and interactions.
- UI Tests: Ensure the button's integration with the UI is seamless and user interactions are handled correctly.
Reza - [email protected]
Project Link: https://github.com/LloydBlv/BookmarkButton