Skip to content

A custom animated progress button with sleek transitions for Idle, Loading, and Completed states. Features MVVM architecture, MotionScene animations, notifications, and reactive UI using DataBindingAdapter and Observable.

License

Notifications You must be signed in to change notification settings

AliElDerawi/MotionButtonAnimator

Repository files navigation

MotionButtonAnimator

"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.

Why This Project?

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.

Main Features of the Project

  • 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.

See It in Action

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

Project Showcase
Transitions between Idle, Loading, and Completed states, also MotionScene for Views.

Project Resources

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.

Snapshots from the App

Phone Screens (Portrait)

Select Download URL Screen

Select Download URL Screen
Select a URL for downloading, using MVVM to save and update the status dynamically.

Project Showcase

Project Showcase
View transitions between Idle, Loading, and Completed states, also MotionScene for Views.

Phone Screens (Landscape)

Select Download URL Screen in Landscape Mode

Select Download URL Screen in Landscape Mode
Optimized for a seamless landscape viewing experience.

Customization

Some Attributes

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" />

Installation Guide

This project doesn't require any previous setup. Follow these steps to run the app:

  1. Clone the Repository: Clone the project repository using Git.
  2. Open in Android Studio: Open the project in Android Studio Ladybug (2024.2.1 Patch 2) or later.
  3. 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.

Included External Libraries

  • Koin (v4): Dependency injection framework, allowing modularity and making the project easier to test.
  • Timber: A lightweight logging utility for debugging purposes.

Contributing

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.

How to Contribute

  • 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.

Contact

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.

License

This project is open-source and licensed under the Apache 2.0 License. The LICENSE file in this repository provides more details.

About

A custom animated progress button with sleek transitions for Idle, Loading, and Completed states. Features MVVM architecture, MotionScene animations, notifications, and reactive UI using DataBindingAdapter and Observable.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages