An android library that handles the closing of your app interactively.

Related tags

Tools Shutdown
Overview

Shutdown

License Android Arsenal Made in Nigeria Build Status

A library that handles the closing of your app interactively.

Shutdown in action

Overview of Shutdown library

  • Shutdown library handles the closing of your app interactively, providing a user the chance to revisit his plan of closing the app.
  • It can also be used to close just an activity and not necessarily the whole app
  • Lightweight
  • Has no dependencies
  • Survives configuration change
  • NO special initialization is required.
  • A single line of code does it all!

Using Shutdown Library in your Android application

Add in your root build.gradle at the end of repositories:

allprojects {
   repositories {
      ...
      maven { url 'https://jitpack.io' }
   }
}

Add the dependency

dependencies {
    implementation 'com.github.emmanuelkehinde:Shutdown:1.1.0'
}

Place this in your activity onBackPressed() method

Shutdown.now(this); 
  • This Displays the default message Press back again to close.
  • A user is expected to press back button again within the next 3 seconds, after which it resets.
  • You can also specify the timeout in milliseconds.

Calling it from a fragment

Shutdown.now(getActivity());

To specify a different Toast message

Shutdown.now(this,"Hey! You are about to leave");

To specify a different Timeout (in milliseconds)

Shutdown.now(this,5000);

To specify a different Toast message and a different Timeout (in milliseconds)

Shutdown.now(this,"Hey! You are about to leave",5000);

If this library helps you in anyway, show your love ❤️ by putting a on this project ✌️ ; or you can buy me a coffee Buy Me a Coffee at ko-fi.com

License

   Copyright (C) 2017 Emmanuel Kehinde

   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

       http://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.

Contributing to Shutdown

All pull requests are welcome, make sure to follow the contribution guidelines when you submit pull request.

You might also like...
Simple library to generate and view PDF in Android
Simple library to generate and view PDF in Android

PDFCreatorAndroid Simple library to generate and view PDF in Android A simple library to create and view PDF with zero dependency Or native code. Add

:inbox_tray: [Android Library] Hunt down all package information
:inbox_tray: [Android Library] Hunt down all package information

Android library to hunt down package information. The library is built for simplicity and approachability. It not only eliminates most boilerplate cod

Android Material Design Theme UI and Tool Library. Support: 4.0.3~O
Android Material Design Theme UI and Tool Library. Support: 4.0.3~O

GitHub OSChina 中文 English Genius-Android Genius-Android: by Material Design style and some commonly used packages. Starting in 2015, The divided into

Android USB host serial driver library for CDC, FTDI, Arduino and other devices.

usb-serial-for-android This is a driver library for communication with Arduinos and other USB serial hardware on Android, using the Android USB Host M

Library that makes it possible to read, edit and write CSV files
Library that makes it possible to read, edit and write CSV files

AdaptiveTableLayout Welcome the new CSV Library AdaptiveTableLayout for Android by Cleveroad Pay your attention to our new library that makes it possi

TaggerString is very light library which allows to build dynamic string resource in much more readable way.

TaggerString TaggerString is very light library which allows to build dynamic string resource in much more readable way. I guess that every Android de

A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation codes like Share, Contacts, Email and etc, which you can easily use.

Android-Intent-Library A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation code

The Kotlin fake data generator library!
The Kotlin fake data generator library!

Fakeit This library is a port of the Ruby gem Faker. It generates realistic fake data — like names, emails, dates, countries — for a variety of scenar

Combines tools for fast android app devlopment

Android - Rapid Test Driven Development Combine tools to generate most of the boilerplate code. Examples how to test different aspects of an android a

Comments
  • Alternative runnable

    Alternative runnable

    Hey alternative method without use runnable

       private static long lastClickTime;
      
       if (lastClickTime + 3000> System.currentTimeMillis()) //finish
       lastClickTime = System.currentTimeMillis();
    
    
    opened by webserveis 1
Releases(1.1.0)
Owner
Emmanuel Kehinde
Software Engineer | Mobile
Emmanuel Kehinde
A simple utility to remove unused resources in your Android app to lower the size of the APK. It's based on the Android lint tool output.

android-resource-remover android-resource-remover is utility that removes unused resources reported by Android Lint from your project. The goal is to

Keepsafe 1.3k Dec 16, 2022
Android Resource Manager application to manage and analysis your app resources with many features like image resize, Color, Dimens and code Analysis

Android Resource Manager application to manage and analysis your app resources with many features like image resize, Color, Dimens and code Analysis

Amr Hesham 26 Nov 16, 2022
A surgical debugging tool to uncover the layers under your app.

Scalpel DEPRECATED! Android Studio 4.0's layout inspector now includes a live-updating 3D view. Use it! A surgical debugging tool to uncover the layer

Jake Wharton 2.8k Jan 3, 2023
The metrics layer for your data

metriql metriql lets you define your business metrics and share them across different data tools. It uses dbt for the transformation layer and integra

metriql 227 Dec 29, 2022
Taskbar puts a start menu and recent apps tray on top of your screen that's accessible at any time

Taskbar puts a start menu and recent apps tray on top of your screen that's accessible at any time, increasing your productivity and turning your Andr

Braden Farmer 551 Dec 31, 2022
Automated-build-android-app-with-github-action - CI/CD Automated Build Android App Bundle / APK / Signed With Github Action

Automated Build Android With Using Github Action Project Github Action Script Us

Faisal Amir 34 Dec 19, 2022
This Android app adds splash screen slides to make a great intro for an app.

IntroApp This Android app adds splash screen slides to make a great intro for an app. Short description Adding Welcome / Intro screens in your app is

Vaibhav Khulbe 16 Oct 1, 2020
Android Library Finder

alfi Android Library Finder Search through thousands of android libraries that can help you scale your projects elegantly Usage Search for something a

César Ferreira 509 Dec 8, 2022
Remote script to create a maven compatible release of an android library (aar)

release-android-library ?? Deprecated ?? This script is deprecated in favour of: novoda/bintray-release Remote script to create a maven compatible rel

Paul Blundell 144 Dec 13, 2022