Android library to help enter, and more importantly, leave, android "Immersive Mode".

Overview

Immersive Lock

Android has various ways to full screen an application including locking the screen to prevent accidentally leaving the app. This is particularly useful when making apps for little people that you don't want to accidentally do online shopping while you are not watching.

Escaping this sticky mode can be tricky though if you didn't pay attention to the original prompts from your Android OS, and each system is slightly different.

This library provides a simpler way to enter and leave this mode by tapping a specific View several times in succession.

Usage

See https://jitpack.io/#babydots/immersivelock/ for adding the Gradle dependency.

    // Create the lock, providing an Android View object that will be set to View.VISIBLE
    // when entering immersive mode. The user will need to tap this several times to leave
    // immersive mode.
    val immersiveLock = ImmersiveLock.Builder(viewUserNeedsToTapToUnlock)

        // Perform actions when leaving immersive load. Note there is no callback for when you
        // *enter* immersive mode, because you are responsible for calling the "startImmersiveMode()"
        // function, and at that point you can perform whatever actions you see fit.
        .onStopImmersiveMode { supportActionBar?.show() }

        // Defaults to ImmersiveLock.DEFAULT_TIME_BETWEEN_TOUCHES (750ms)
        .maxTimeBetweenTouches(750L)

        // Defaults to DEFAULT_TOUCHES_REQUIRED_TO_UNLOCK (5)
        .touchesRequiredToUnlock(5)

        // Defaults to the "screen_unlocked" resource provided with this library, and translated
        // by the wonderful community of translators to the BabyDots android app.
        .unlockedMessageStringRes(R.string.screen_unlocked)

        // Defaults to the "touch_lock_to_unlock" resource provided with this library, and translated
        // by the wonderful community of translators to the BabyDots android app.
        .touchLockToUnlockedMessagePluralRes(R.plurals.touch_lock_to_unlock)

        .build()

    // At some point, enter immersive mode (e.g. in response to tapping a menu item from the ActionBar):
    immersiveLock.startImmersiveMode(this)
    supportActionBar?.hide()

Contributing

Reporting Issues

Please report any issues or suggest features on the issue tracker.

Submitting changes

Pull requests will be warmly received at https://github.com/babydots/babyphone.

Compiling

This app uses a typical gradle folder structure and is written in Kotlin.

  • To build (a debug version): gradle assembleDebug

Alternatively, you can import the project into Android Studio and build from there.

License

This program is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

You might also like...
This is a template to help you get started building amazing Kotlin applications and libraries.

Welcome to the Starter This is a template to help you get started building amazing Kotlin applications and libraries. Over time, examples will be comp

A toy port scanner to help me (and you!) learn Kotlin + Akka.

kotlin-akka-portscan A toy program to help me (and you!) learn Kotlin + Akka. butwhy.gif When I want to learn a new language, I've found it helpful to

LinkHub is a simple and effective link management application that can help you to easily manage your app with no ads!
LinkHub is a simple and effective link management application that can help you to easily manage your app with no ads!

LinkHub LinkHub is a simple and effective link management application that can help you to easily manage your own links with no ads! Download Screensh

Therapeutic is a platform to help easily connect patients or generally anyone struggling to get through tough times with motivating content and  professional therapists.
Therapeutic is a platform to help easily connect patients or generally anyone struggling to get through tough times with motivating content and professional therapists.

Therapeutic Apk - https://github.com/develNerd/Therapeutic/blob/main/androidApp/release/androidApp-release6.apk Therapeutic is a Kotlin Mobile Multipl

Helper functions for making Approvals-Java more Kotlin friendly

Approvals-Kt Helper functions for making Approvals-Java more Kotlin-friendly Usage Verify using Approvals-Kt import com.github.greghynds.approvals.Kot

From 8-10 October 2021 there was VTB MORE tech 3.0, where the DUCK team presented their solution.
From 8-10 October 2021 there was VTB MORE tech 3.0, where the DUCK team presented their solution.

InvestmentGuideVTB Ссылка на репозиторий с бэкендом приложения: https://github.com/disarrik/vtbBackend Процесс сегментация происходит в отдельном окне

Share MPS code snippets. More than just screenshots.

skadi gist Share MPS code snippets. More than just screenshots. Repository Content ide-plugin: MPS Plugin that creates a gist from the IDE written in

Learn-kotlin - Learning more about Kotlin in various content

Kotlin study roadmap https://kotlinlang.org/docs/reference/ Getting Started Basi

To help to promote your android app by prompting users to rate your app in a bottom Sheet.

RateBottomSheet This an Android library to help to promote your Android App by prompting users to rate your app in the Google Play Store with a materi

Owner
Baby Apps
Baby Apps
A custom OTP view to enter a code usually used in authentication

A custom view to enter a code usually used in authentication. Different types of OTPViews. Easy to use and configure your own view and character of OTP using all the attributes.

Simform Solutions 48 Aug 30, 2022
Binding your extras more easier, more simpler for your Android project

Ktan Ktan make your intent / arguments more easier and readable. And most important, will help you bind all extras for your activity / fragment. And a

Ade Fruandta 3 Jan 7, 2023
An library to help android developers working easly with activities and fragments (Kotlin version)

AFM An library to help android developer working easly with activities and fragments (Kotlin) Motivation Accelerate the process and abstract the logic

Massive Disaster 12 Oct 3, 2022
BindsAdapter is an Android library to help you create and maintain Adapter class easier via ksp( Kotlin Symbol Processing).

BindsAdapter BindsAdapter is an Android library to help you create and maintain Adapter class easier via ksp( Kotlin Symbol Processing). Installation

Jintin 5 Jul 30, 2022
Kadrekka is a library that aims to make Kotlin more accessible to the northern italian population

Kadrekka Kadrekka is a library that aims to make Kotlin more accessible to the northern italian population. It provides lots of utility functions to m

Marco 8 May 9, 2021
Web Container: A simple web container library for Android to help fellow developer to open WebView easily

WebContainer Description Web Container is a simple web container library for And

Achmad Ichsan Thaib 8 Nov 22, 2022
Simple FOSS android app to help you plan and manage your savings goals easily and establish the habit of saving money.

GreenStash GreenStash is a simple FOSS android app to help you plan and manage your savings goals easily and establish the habit of saving money. ?? S

Pool-Of-Tears 112 Dec 3, 2022
📦📦Video downloader for Android - Download videos from Youtube, Facebook, Twitter, Instagram, Dailymotion, Vimeo and more than 1000 other sites

youtube-dl-android ?? An Android client for youtube-dl: https://github.com/rg3/youtube-dl Major technologies Language: Kotlin Architecture: MVVM Andro

Cuong Pham 443 Dec 30, 2022
Ktor is an asynchronous framework for creating microservices, web applications and more.

ktor-sample Ktor is an asynchronous framework for creating microservices, web applications and more. Written in Kotlin from the ground up. Application

mohamed tamer 5 Jan 22, 2022
One app for all women that covers everything from safety to health and more. 👩💪

sampoorna Sampoorna is a one-in-all solution concept revolving around the women who fight one on one with various problems. With it's features encapsu

Open Lake 17 Dec 6, 2022