• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

soarcn/UndoBar: [Deprecated] Android Library that implements Snackbars (former k ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

soarcn/UndoBar

开源软件地址(OpenSource Url):

https://github.com/soarcn/UndoBar

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

UndoBar

Build Status

This lib is deprecated in favor of Google's Design Support Library which includes a Snackbar and is no longer being developed.

Thanks for all your support!

Android Library that implements Snackbars (former known as Undobar) from Google's Material Design documentation.

UndoBar Sample UndoBar Sample UndoBar Sample UndoBar Sample UndoBar Sample

How to use this library

  • 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>

API

  • 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 will determine if tranlucent mode(4.4) is using and adjust its position.

Style

  • UndoBar provides 3 default styles. You can use them for different purposes like undo,refresh, or just use it as replacement of toasts. For example, you can use retry style in this way.

    new UndoBarController.UndoBar(this).message(loader.getException().getMessage()).style(UndoBarController.RETRYSTYLE).listener(this).show();
  • UndoBar will switch to KitKat L&F in API-19 target and Material design in API20+.

  • 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>
  • You can change undobar style completely by define your own style

        <style name="UndoBarClassicStyle">
            <item name="containerStyle">@style/UndoBarClassic</item>
            <item name="messageStyle">@style/UndoBarMessageClassic</item>
            <item name="buttonStyle">@style/UndoBarButtonClassic</item>
            <item name="dividerStyle">@style/UndoBarDividerClassic</item>
            <item name="inAnimation">@anim/undobar_classic_in_anim</item>
            <item name="outAnimation">@anim/undobar_classic_out_anim</item>
        </style>

Advanced usage

  • Using UndoBarController.AdvancedUndoListener if you need to get notification when UndoBar was cleared or hidden.
  • UndoBar is designed to dynamically add to activity viewgroup, so you need to handle screen-rotation by your self. Check this example to see more.

Contribute

  • Feel free to fork it

License

Copyright 2011, 2015 Kai Liao

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.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap