"A Custom Animated Progress View (Button) app that animates three statuses of the Button: Idle, Loading, and Completed, with a sleek design, also showcasing a clean architecture."
MotionButtonAnimator is an app designed to help developers craft an animated view for a download button, featuring a custom design and animation. It allows you to control the view's three statuses, Idle, Progress, and Completed, using XML. The project also uses MotionScene to animate views after opening a fragment. This project is part of the Udacity Android Kotlin Developer Nanodegree Program.
This project showcases the ability to build custom views, work with Animators and MotionScene, handle fragment navigation, work with dependency injection, and implement a clean and maintainable MVVM architecture—all critical skills for a mid-senior Android developer.
- MVVM Architecture: Implements an MVVM pattern for clean, maintainable architecture.
- Custom View: Creates a custom animated view (button) that can change its attributes using XML.
- MotionScene: Implements MotionScene to animate views in the download detail fragment.
- Orientation Support: Adapts to portrait and landscape orientations without losing data.
- Notification Handling: Displays and handles notifications for all Android versions.
- Modern UI: Uses a single-activity architecture with multiple fragments.
- Download Manager: Uses a download manager to download from a URL.
- Dependency Injection: Koin (v4) used for better modularity and testability.
- Reactive UI: Uses DataBindingAdapter and Observable for a reactive user experience.
Watch the custom animated progress button transition between Idle, Loading, and Completed states. This GIF demonstrates the sleek animations and the MotionScene implementation.
Project Showcase
Transitions between Idle, Loading, and Completed states, also MotionScene for Views.
- Starter Project Code: Get the starter code for the project.
- Project Rubric: View the project rubric.
- Android Kotlin Developer Nanodegree Program: Learn more about the full program and its related projects.
Note: Many improvements and features in this project are not included in the Project Rubric as it was initially a project for the Udacity Nanodegree Program.
Option Name | Format | Description |
---|---|---|
buttonIdleColor | color |
Sets the Idle color of the button |
buttonLoadingColor | color |
Sets the loading fill color of the button |
circleLoadingColor | color |
Sets the color of the loading circle |
textAllCaps | bool |
Controls button text capitalization (default: false) |
textStyling | enum |
Choose between normal, bold, italic, bold_italic |
cornerSize | dimen |
Sets the corner radius of the button |
textSize | dimen |
Sets the text size of the button |
Here is an example of how to use these attributes in XML:
<com.udacity.util.AnimatedProgressButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:buttonIdleColor="@color/idle_color"
app:buttonLoadingColor="@color/loading_color"
app:circleLoadingColor="@color/circle_color"
app:textAllCaps="false"
app:textStyling="bold"
app:cornerSize="8dp"
app:textSize="16sp" />
This project doesn't require any previous setup. Follow these steps to run the app:
- Clone the Repository: Clone the project repository using Git.
- Open in Android Studio: Open the project in Android Studio Ladybug (2024.2.1 Patch 2) or later.
- Build the Project: Use Gradle Plugin v8.7.2 to build the project.
Note: Ensure you have the latest version of Android Studio and the Gradle build tool installed. Please look at the official guide if needed.
- Koin (v4): Dependency injection framework, allowing modularity and making the project easier to test.
- Timber: A lightweight logging utility for debugging purposes.
Contributions are welcome! Please open an issue or submit a pull request for improvements or bug fixes. Please feel free to reach out if you want to add more features, such as custom animations, or expand on the MVVM pattern.
- Fork the Repository: Click the "Fork" button at the top.
- Create a Feature Branch: Branch off from
main
for any features (git checkout -b feature/your-feature
). - Submit a Pull Request: Submit a PR describing your changes.
Feel free to reach out for any collaboration opportunities or if you have any questions. I'd love to hear your thoughts and contributions! Check my GitHub profile.
This project is open-source and licensed under the Apache 2.0 License. The LICENSE file in this repository provides more details.