teogor / ceres

🪐 Ceres is a comprehensive Android development framework designed to streamline your app development process. Powered by the latest technologies like Jetpack Compose, Hilt, Coroutines, and Flow, Ceres empowers developers to build modern and efficient Android applications.
https://source.teogor.dev/ceres
Apache License 2.0
65 stars 4 forks source link

Creation of core-common module and addition of KeepScreenOnKt and ContextUtilsKt functions #144

Closed teogor closed 1 year ago

teogor commented 1 year ago

This pull request introduces the core-common module, which includes utility functions for working with Compose and Android Context. The key additions are:

  1. KeepScreenOnKt provides the KeepScreenOn Composable function, which allows users to keep the screen on within a Composable based on a provided predicate. This utility helps manage screen wake locks in Compose-based apps.

  2. ContextUtilsKt offers the following functions:

    • getActivity(Context): Retrieves the associated Activity from a given Context.
    • getActivity(Composer, Int): Retrieves the associated Activity from a Composer using a resource ID.

These utility functions enhance the flexibility and usability of Compose-based projects by simplifying common tasks related to Context and screen wake lock management.

closes #143