Skip to content

NicosNicolaou16/Ink_Api_Compose

Repository files navigation

Ink API Compose

Linktree Site X LinkedIn Medium Mastodon Bluesky Dev.to blog YouTube Google Developer Profile

This open-source project tests the new Google Ink API with a drawing example. It offers options to select colors, erase parts of the drawing, or clear the entire canvas. It also includes functionality to convert the stroke to a bitmap and to save and load the stroke using a Room database.

✨ Features

  • Smooth Drawing: Built with the Ink API for low-latency, freehand drawing with stylus and pointer input.
  • Modern UI: Crafted entirely with Jetpack Compose for a declarative and intuitive user interface.
  • Color Selection: Allows users to choose from a variety of colors for their drawings.
  • Erase Tool: Provides options to erase parts of the drawing or clear the entire canvas.
  • Offline Storage: Saves and loads drawings using Room Database, preserving the user's work across app sessions.
  • Bitmap Conversion: Includes functionality to convert the ink stroke into a bitmap, which can be displayed in a dialog.
  • Scalable Architecture: Follows the MVVM pattern with a repository, ensuring a clean separation of concerns and maintainable code.
  • Optimized Performance: Leverages Coroutines for asynchronous tasks, KSP for faster annotation processing (for Room), and R8 for code shrinking.

📸 Screenshots & Demos

Drawing Screen Color Selection Drawing and Erasing Demo

🛠️ Tech Stack & Libraries

This project is built with Kotlin and utilizes a variety of modern Android libraries and tools:

A Brief History Behind This Repository 😃

I began this project to test the new Google Ink API. While I was working on it, my son saw it and asked if he could draw. I told him to wait, then quickly implemented a simple version with options to select colors and erase the drawing. After generating the APKs (my daughter also saw it), I installed the app on their tablet, and they started drawing right away.

🔧 Versioning

  • Target SDK: 36
  • Minimum SDK: 29
  • Ink API Version: 1.1.0-alpha01
  • Kotlin Version: 2.3.20
  • Gradle Version: 9.1.1

📚 References & Useful Links

Official Documentation

Important Resources for State Preservation (Room DB)

⭐ Stargazers

If you enjoy this project, please give it a star! Check out all the stargazers here: Stargazers on GitHub

🙏 Support & Contributions

This project is actively maintained. Feedback, bug reports, and feature requests are welcome! Please feel free to open an issue or submit a pull request.

About

This open-source project tests the new Google Ink API with an example for drawing, offering options to select colors, erase part of the drawing or clear the entire drawing. It also includes functionality to convert the stroke to a bitmap and to save and load the stroke using a Room database.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages