This is a implementation for Android advanced UI pattern undo-bar, used in Gmail app.
UndoBar was modified from Roman(@romannurik)'s undobar concept (https://code.google.com/p/romannurik-code/). I backported it to Android 2.x and made it easier to use.
-
Download this library, import to your IDE (eclipse...) as a library project.
-
Using Gradle(from 0.5)
compile 'com.cocosw:undobar:1.+@aar'
-
Using Maven
<dependency> <groupId>com.cocosw</groupId> <artifactId>undobar</artifactId> <version>*</version> <type>apklib</type> </dependency>
-
You can also use UndoBar with builder style.
new UndoBar(getActivity()).message("Undo-bar title").listener(listener).show();
-
Or you can use UndoBar by just one line code (Deprecated from 1.4)
UndoBarController.show(getActivity(), "Undo-bar title" , listener, undoToken);
-
UndoBar support customize style with background/icon/duration/animation attribution.
-
UndoBar provides 3 default styles. You can use them for different purposes like undo,refresh, or just use it as replacement of toasts.
-
UndoBar will switch to KitKat look and feel in API-19 target and after.
-
UndoBar will determine if tranlucent mode(4.4) is using and adjust its position.
-
You can set theme in your appliation to change the look and feel. For example, you can use following lines in your style.xml to always use material style UndoBar.
<style name="MaterialTheme" parent="android:Theme.Light"> <item name="undoBarStyle">@style/UndoBarMaterialStyle</item> </style>
- Feel free to fork it
Copyright 2011, 2014 Liao Kai
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.