Skip to content

ayushpadlekar/Text_Editor_On_Canvas

Repository files navigation

App Logo

Text Editor on Canvas - Android App

An Android app to create, edit or modify text upon a square canvas. It can be used to create personalized text-based designs or to write some Quotes.

This is a Single Activity App :-   MainActivity.kt  (~1800 lines)


Features 💡

  • Add and Edit text on a square canvas.
  • Drag/Move text anywhere upon canvas.
  • Choose fonts - serif, sans-serif, monospace, cursive.
  • Format text - bold, italic, underline, strikethrough.
  • Change text size with (+ -) buttons or slider.
  • Change Text Colors.
  • Change canvas colors - white | black | gray.
  • Undo - Redo functionality.
  • Dark mode - Light mode.
  • Save/Export canvas as png Image.

Screenshots 📸

Light Mode ☀️ Dark Mode 🌙

Note

- This app was made as an assignment for an insternship.
- The main challenge of the assignment was : to make the Text stay inside of the square canvas. It should not go outside the boundary whenever we drag or move the text.

How I solved this challenge :-

- I understood the problem carefully and analyzed what we have & what can be done.
- As we know, the square canvas have it's own coordinates (starting from 0,0 in the top-left). And the text has its co-ordinates position upon that canvas. When we drag the text, the touch-pointer-gesture assigns new X & Y co-ordinates to the text constantly.

• So, I used my logic & applied constraints on each boundary sides of the square canvas that :
  - if new-coordinates of text try to go outside the square boundary coordinates, then new-coordinates = boundary coordinates.
  - which means the new-coordinates cannot go beyond the boundary-coordinates.

  • Example code snippet :
  if (new-coordinate < boundary-coordinate) {
      new-coordinate = boundary-coordinate
  }


Tech Stack 🛠️

  • Jetpack Compose : Developed easy to use, modern & sleek UI design. Extensively used for designing the Title of the App.

  • Kotlin : Utilized as the primary programming language for the app. Created dynamic features with mutable states & undo redo stacks management.

  • Android Studio : IDE for developing this app.

  • Firebase App Distribution : For Deploying app to the users.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes. Feel free to open issues.

About

A text editor android app through which we can add text upon a square canvas, drag or move the text, and format it with bold, italic, underline, strikethrough, etc. We can also choose fonts and change text size or color.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages