Skip to content

A text - editor which allows you to save formatted text with different styles and images. Build with kotlin and follows MVVM architecture and single activity architecture.

Notifications You must be signed in to change notification settings

sDevPrem/text-editor

Repository files navigation

Text Editor

A text - editor which allows you to save formatted text with different styles and images. Build with kotlin and follows MVVM, Clean architecture for data flow and single activity architecture for UI.

Features

  1. Formatting supported:
    • Bold
    • Italics
    • Underline
    • Font Size
    • Font-Family
    • Insert Images
  2. Create, Update and Delete formatted notes with images.
  3. Dark and Light Mode support

Screenshot

Screenshot_1695014891 Screenshot_1695014888 Screenshot_1695014882

How to use

Write, select and format that text using any formatting feature at the bottom.

Project Structure

  • data: Contains database entity and database related classes.
  • di: Contains Hilt Module.
  • Domain: Contains common use cases like converting database note to a format that can be understandable to UI layer and vice-versa.
  • ui: Contains UI related classes like fragment.

Editor Architecture

Editor

EditorFragment is the UI where user edits and formats their notes. It maintains a list of Range of Style in the EditorViewModel which updates whenever user enters or removes any text in the editor accordingly to remain updated with the editor spans. When user selects a text and click on the formatting options, it creates a range for that formatting according to the selection.

When user finishes editing, it creates and sends the NoteWithStyle to the domain layer which converts it to a suitable Note format which can be stored in the database. The domain layer depends on Asset Providers which helps it to convert images and fonts to a suitable Style when fetching the notes from the database.

Build With

Kotlin: As the programming language.

Jetpack Navigation : For navigation between screens.

Room : To store and manage running statistics.

Hilt : For injecting dependencies.

Data Binding and View Binding: For easy integration of data with UI.

Timber: For logging.

Gson: To parse object to json and vice-versa.

About

A text - editor which allows you to save formatted text with different styles and images. Build with kotlin and follows MVVM architecture and single activity architecture.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages