Skip to content

The repository contains the project https://github.com/mk590901/graph_widget: ported on Jetpack Compose the widget for visualization ECG.

License

Notifications You must be signed in to change notification settings

mk590901/Jetpack-Compose-ECG-Widget

Repository files navigation

Jetpack Compose ECG Widget

Introduction

The presented project is an attempt to implement a widget for visualization of ECG using the Jetpack Compose extension for Android. The new project is a logical continuation of the previously created application in Kotlin: https://github.com/mk590901/Kotlin-ECG-Widget-Viewer. As a matter of fact, that project was created with the goal of developing a certain core: an independent set of classes for use with various graphics libraries. And this idea paid off: the same classes as before are used, in the case of Compose graphics and JetPack coroutines instead of handlers. This once again confirms the idea that the main thing is the business logic of the application. Everything else: graphics, timers, coroutines and threads, comes and goes.

Implementation

  1. The CircularBuffer, GraphMode and Utils classes (and files) remained unchanged.
  2. Changes in the StoreWrapper class are due to the fact that Compose uses its own specific classes to represent graphic elements such as Path and Point (Offset). Therefore, the prepare... procedures have been changed, and variables of the specified types now refer not to android.graphics.Path and android.graphics.Point, but to androidx.compose.ui.graphics.Path and androidx.compose.ui.geometry.Offset. Pay attention on import directives on start of the file.
  3. The widget itself is implemented as the @Composable GraphEcgWidget function in the GraphicEchWidget.kt file.

Movie

compose_ecg.mp4

NB! As before, clicking (touching) on the rendering area causes ECG drawing to stop; clicking again will resume drawing.

About

The repository contains the project https://github.com/mk590901/graph_widget: ported on Jetpack Compose the widget for visualization ECG.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages