An implementation of Android's Undo Bar as seen in Google's Gmail app.

Related tags

App Android-UndoBar
Overview

DEPRECATED

Android-UndoBar is deprecated. No more development will be taking place.

Use Google's Snackbar instead.

Android - UndoBar

As seen in Google's Gmail app.

Screenshots

  • pre KitKat

alt text alt text

  • KitKat

alt text alt text

  • Lollipop and later

alt text alt text

Usage

  • It's as simple as:
new UndoBar.Builder(this)//
  .setMessage("X items deleted.")//
  .setListener(this)//
  .show();
  • You can also explicitly use one of the styles shown above. This is useful, for example, if you want to show a consistent Material Design style across all API levels. By default, it uses the style of the device's current API level. Here's an example:
new UndoBar.Builder(this)//
  .setMessage("X items deleted.")//
  .setListener(this)//
  .setStyle(UndoBar.Style.LOLLIPOP)//
  .show();

Example

Check out the sample project for an example implementation.

Download

Grab it via Gradle:

For API Level >= 15:

compile 'com.github.jenzz.undobar:library:1.3:api15Release@aar'

For API Level < 15 (includes nineoldandroids):

compile 'com.github.jenzz.undobar:library:1.3:api8Release@aar'

Still using Eclipse? Check out the master_eclipse branch and import it as a library project.
Note that the Eclipse implementation is v1.1 only and won't receive any future updates.

License

This project is licensed under the MIT License.

Comments
  • Added support for undo bar in any Window

    Added support for undo bar in any Window

    This was made for the purpose of supporting Dialogs (which are often in their own Window, separate from an Activity), but it should work for any given situation.

    Should solve #7.

    enhancement 
    opened by dlew 8
  • Weird behaviour when long-pressing undo button.

    Weird behaviour when long-pressing undo button.

    If the user press the undo button until the dialog is dismissed and then releases it first onHide is called because of the automatic dismiss and then onUndo is called because the user released the button (that no longer exists).

    bug 
    opened by aballano 2
  • Undo Bar never closed

    Undo Bar never closed

    Hey jenzz thanks for the amazing demo but the undo bar is not hiding automatically or manually its just stick on my screen. onHide and onUndo functions are triggered but undo bar sticks on the creen

    opened by Hemant0601 1
  • Notify when the user explicitly hides the UndoBar.

    Notify when the user explicitly hides the UndoBar.

    This is very useful for any app using this library on a Listview, example:

    Imagine a list of elements. Each element can be deleted. When an element is deleted, a new instance of UndoBar is created with a listener, so in the onHide we will really delete the element (make a request to a WS, DB, etc.)* When another element is deleted, we SHOULD hide the previous UndoBar, create a new one with new params and a new listener.

    So the problem here is that if somebody manually hides the UndoBar, the onHide method won't be called, so no action can be performed.

    *This is done this way to avoid multiple calls to a WS if the user changes its mind and clicks undo.

    opened by aballano 1
  • Make UndoBar extendable.

    Make UndoBar extendable.

    It would be ver useful if other devs could extend this class and made some changes to it to extend the functionality or just to adjust it to their needs.

    enhancement 
    opened by aballano 1
  • UndoBar appears underneath Dialogs

    UndoBar appears underneath Dialogs

    If you try to make an UndoBar appear while a Dialog (or DialogFragment) is present, it will appear in the Activity below the Dialog's window, instead of in the same window as the current Dialog. This results in the UndoBar being unclickable (until the Dialog is dismissed) as well as invisible (if the Dialog is large enough).

    bug 
    opened by dlew 1
  • Pass the UndoToken to onHide as well

    Pass the UndoToken to onHide as well

    pass the token to the listener onHide as well (not just in onUndo). this is useful for doing stuff that is not actually undoable and should only be executed after the user had his chance to undo. Also included a little fix to avoid a (very very unlikely) race condition.

    opened by lroessler 1
Releases(v1.3)
Owner
Jens Driller
Android Dev @shazam
Jens Driller
Tidy up your Android status bar before taking screenshots for the Play Store

DEPRECATED This project no longer works on recent versions of Android. Use Android's build-in Demo mode instead. For the curious, more information abo

Emma Vanbrabant 891 Nov 10, 2022
A simple implementation of the Android In-App Billing API.

Google In-App Billing Library v4+ A simple implementation of the Android In-App Billing API. It supports: in-app purchases (both consumable and non-co

Moisoni Ioan 79 Dec 12, 2022
Android News App built in kotlin with implementation of MVVM architecture, android navigation components and retrofit. Displays news to users allowing them to share and save news.

News-App Android news app built in kotlin that fetches news data from news api with Retrofit and displays news to users. This App follow MVVM architec

Raj Manjrekar 16 Dec 29, 2022
Wandroid project based on Kotlin + JetPack + concurrent implementation of MVVM architecture for playing Android App

Wandroid project based on Kotlin + JetPack + concurrent implementation of MVVM architecture for playing Android App

null 32 Feb 13, 2022
The implementation of https://dribbble.com/shots/2067564-Replace

FlyRefresh The Android implementation of Replace, designed by Zee Youn. I implement this as a FlyRefresh layout. The content of the layout can be any

吴晶 2.9k Nov 29, 2022
Implementation of Instagram with Material Design (originally based on Emmanuel Pacamalan's concept)

InstaMaterial Updated Current source code contains UI elements from Design Support Library. If you still want to see how custom implementations of e.g

Mirosław Stanek 5k Dec 27, 2022
Simple Mvp Implementation

Froggy Simple Mvp Implementation Download Gragle: compile 'ru.bullyboo.mvp:froggy:1.0.2' Maven: <dependency> <groupId>ru.bullyboo.mvp</groupId>

Rostislav Sharafutdinov 15 Mar 17, 2019
📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.

NotyKT ??️ NotyKT is the complete Kotlin-stack note taking ??️ application ?? built to demonstrate a use of Kotlin programming language in server-side

Shreyas Patil 1.4k Jan 8, 2023
Implementation of the application using the latest Android Tech Stack and the GitHub REST API.

GitHub Viewer Implementation of the application using the latest Android Tech Stack and the GitHub REST API. <!-- Github login. You can change the use

Vitaliy Zarubin 53 Jan 3, 2023
A project for the implementation of the car animation feature in most ride-sharing/ food delivery apps

CarAnimation This is a test project to practice the implementation of the car animation feature in most ride-sharing/ food delivery apps. Slowly build

Samurai 45 Dec 23, 2022
Implementation of useful hooks inspired by React for Compose

useCompose React inspired hooks for Compose Installation Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the

Pavitra Golchha 20 Nov 14, 2022
New-SplashScreen-API - SplashScreen API Implementation Sample

SplashScreen API Implementation Sample Installation - Usage <style name="Theme.A

Arda Kazancı 0 Jan 3, 2022
Cql-cds-hooks - HL7 CDS HOOKS Implementation with CQL support

CQL CDS HOOKS HL7 CDS HOOKS implementation with CQL (Clinical Quality Language)

PHAST 1 Jan 27, 2022
Glickotlin - Kotlin implementation of the Glicko2 algorithm

Glickotlin Glickotlin is a Kotlin implementation of the Glicko2 algorithm. Glick

Jules Tréhorel 0 Jan 29, 2022
Firebase Authentication and realtime database implementation in Android Kotlin

Androidfirebaseauthentication Firebase is Google’s mobile platform that helps you develop high-quality apps and provides hosted backend services such

Samwel Nyandoro 1 Mar 21, 2022
Multi Roots TreeView implementation for Android Platform with a lot of options and customization

TreeView Multi Roots TreeView implementation for Android Platform with a lot of options and customization Demo Features: - No Custom Views. - Easy use

Amr Hesham 74 May 10, 2022
A powerful library for easy implementation of HMS Location Kit.

AdvancedLocation A powerful library for easy implementation of HMS Location Kit. ?? Request location with couple lines of code (no more boilerplate) C

null 2 Aug 4, 2022
React Native Stone SDK Implementation (Support for both Mobile and POS versions)

react-native-stone-pos Stone Android POS Native Module Installation Stone has a private packageCloud repository, so we need to have your token before

8Sistemas 9 Dec 10, 2022
Turtle Graphics 🐢 implementation for Android Platform with Code Editor, Preview Screen and packages

Turtle Graphics Download Turtle is an Android Application inspired from the original Turtle Graphics and Logo, Logo is an educational programming lang

Amr Hesham 15 Dec 30, 2022