Skip to content

Latest commit

 

History

History
123 lines (90 loc) · 3.23 KB

README.md

File metadata and controls

123 lines (90 loc) · 3.23 KB

FlashLighter

License Kotlin Compose

Flashlighter is a library developed with Compose. This repository introduces a unique flashlighter feature, allowing you to effortlessly control the visibility of your screen content.

Table of contents

Demo

You can hide the full screen under the flashligher

demo_1.mp4

or just a part of screen

demo_2.mp4

shift the flashligher

demo_3.mp4

set any background for your flashligher

demo_4.mp4

or set any color for background of flashligher

demo_5.mp4

Setup

Flashlighter is published on Github Packages:

repositories {
    maven { url = uri("https://lumstep:[email protected]/lumstep/flashlighter") }
    // ...
}

Add the dependency to the module build.gradle.kts:

dependencies {
   implementation("com.lumstep:flashlighter:1.0.0")
   // ...
}

Usage

You can use FlashLighter composable, it can hide your content under the FlashLighter:

FlashLighter (radius = 200f) {
}

Your can specify flashlighter gradient background using:

FlashLighter (
  // ...
  flashLighterBrush = { center: Offset, radius: Float ->
    Brush.radialGradient(
      0.0f to Color.Black.copy(alpha = 0.7f),
      1.0f to Color.White.copy(alpha = 1f),
      radius = radius,
      center = center,
    )
  }
) {
}

Your can specify screen background color using:

FlashLighter (
  // ...
  backgroundBrush = SolidColor(Color.White)
) {
}

Your can apply offset for shifting the flashlight effect using:

FlashLighter (
  // ...
  shiftOffset = Offset(-120f, -120f)
) {
}

Contributions

Contributions are always welcome!. If you'd like to contribute, please feel free to create a PR or open an issue.

License

Copyright 2024 Stepan Prokopenko

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.