This is a implementation for Android advanced UI pattern undo-bar, used in Gmail app, create by roman nurik
UndoBar was modify from Roman(@romannurik)'s undobar concept (https://code.google.com/p/romannurik-code/), and backport it to Android 2.x and make it easier to use
- Download this libary, import to your IDE (eclipse...) as libary project.
- Using Gradle(from 0.5):
compile 'com.cocosw:undobar:0.7@aar'
- Using Maven(<0.4)
<dependency>
<groupId>com.cocosw</groupId>
<artifactId>undobar</artifactId>
<version>0.4</version>
<type>apklib</type>
</dependency>
- You can use UndoBar by just one line code
UndoBarController.show(getActivity(), "Undo-bar title" , listener, undoToken);
- You can also use UndoBar in builder style.
new UndoBar(getActivity()).message("Undo-bar title").listener(listener).show;
- UndoBar support customize style with background/icon/duration/animation attribution.
- UndoBar provides 3 default styles. You can use them for different purpose like undo,refresh, or just use it as replacement of Toasts.
- UndoBar will switch to KitKat look and feel in API-19 target.
- You can overwrite style in your project to change the look and feel. For example, you can use following lines in your style.xml to always use KitKat style UndoBar.
<style name="UndoBar" parent="UndoBarKitKat"/>
<style name="UndoBarMessage" parent="UndoBarMessageKitKat"/>
<style name="UndoBarButton" parent="UndoBarButtonKitKat"/>
- Feel free to fork it
- Works perfectly with Crouton/Menudrawer/ABS
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.