All Projects → shasin89 → Notificationbanner

shasin89 / Notificationbanner

Licence: mit
Easy to use pop up notification banner for in app local notification.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Notificationbanner

Bgabanner Android
引导界面滑动导航 + 大于等于1页时无限轮播 + 各种切换动画轮播效果
Stars: ✭ 4,060 (+7281.82%)
Mutual labels:  banner
Swiftmessages
A very flexible message bar for iOS written in Swift.
Stars: ✭ 6,363 (+11469.09%)
Mutual labels:  banner
Postcss Banner
PostCSS plugin to add text banner and footer to resulting file
Stars: ✭ 13 (-76.36%)
Mutual labels:  banner
Yjbannerview
【抱歉,暂时不提供开源】A very popular and highly customized banner view, 无限循环滚动轮播图BannerView、焦点图, 支持Cocoapods 及 Carthage. 支持完全自定义
Stars: ✭ 506 (+820%)
Mutual labels:  banner
Popping
A collection of animation examples for iOS apps.
Stars: ✭ 5,587 (+10058.18%)
Mutual labels:  pop
Newpagedflowview
电影票卡片式无限自动轮播图
Stars: ✭ 819 (+1389.09%)
Mutual labels:  banner
Dcurlrouter
通过自定义URL实现控制器之间的跳转
Stars: ✭ 393 (+614.55%)
Mutual labels:  pop
Ftpopovermenu
FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.
Stars: ✭ 988 (+1696.36%)
Mutual labels:  pop
Inbucket
Disposable webmail server (similar to Mailinator) with built in SMTP, POP3, RESTful servers; no DB required.
Stars: ✭ 685 (+1145.45%)
Mutual labels:  pop
Volumebar9
A jailbreak tweak to change the stock volume HUD
Stars: ✭ 10 (-81.82%)
Mutual labels:  banner
Banner
轮播图控件,支持自定义布局,支持两端缩进,类似卡片,支持无限循环和多种主题,可以灵活设置轮播样式、动画、轮播和切换时间、位置、图片加载框架等!
Stars: ✭ 512 (+830.91%)
Mutual labels:  banner
Swiftentrykit
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.
Stars: ✭ 5,706 (+10274.55%)
Mutual labels:  banner
Pop Snapkit
[deprecated] Use SnapKit with the Facebook Pop animation framework.
Stars: ✭ 18 (-67.27%)
Mutual labels:  pop
Pagetransformerhelp
👍 A PageTransformer library for Android ViewPager,have some Banner styles. ViewPager 实现轮播图、实现卡片切换。
Stars: ✭ 478 (+769.09%)
Mutual labels:  banner
Blog App Buffalo
A blogging app built with Buffalo.
Stars: ✭ 27 (-50.91%)
Mutual labels:  pop
Banner
🔥🔥ViewPager,ViewPager2无限轮播功能。自定义Indicator,支持一屏三页,支持仿魅族banner效果。极其简单的使用方式
Stars: ✭ 393 (+614.55%)
Mutual labels:  banner
Ybpopupmenu
快速集成popupMenu
Stars: ✭ 816 (+1383.64%)
Mutual labels:  pop
Generator Buildabanner
Yeoman workflow to get a standard or DoubleClick banner started quickly.
Stars: ✭ 49 (-10.91%)
Mutual labels:  banner
Viewpagerhelper
这个一个 viewpager/viewpager2工具类,能够帮你快速实现导航栏轮播图,app引导页,viewpager/viewpager2 + fragment;内置多种tab指示器,让你告别 viewpager 的繁琐操作,专注逻辑功能
Stars: ✭ 957 (+1640%)
Mutual labels:  banner
Banner View
A banner view implemented by using rxJava2 for android
Stars: ✭ 26 (-52.73%)
Mutual labels:  banner

Notification Banner for Android

A pop up notification banner for in app local notification. Easy to use with default layouts for success, info, warning, and error banners. The library allow to customize the layout with your own design and click events.

Blog: https://medium.com/@shasindranpoonudurai/the-effortless-in-app-notification-banner-library-for-your-android-app-9a9eb3f2bd5c

Top:

demo

Bottom:

demo

Auto dismiss and onClick listener:

demo

Below a view (eg Toolbar):

demo

FullScreen:

demo

Installation

Add the library to your build.gradle:

dependencies {
      compile 'com.github.shasin89:NotificationBanner:{latest-release}'
    }

This library is distributed via jitpack. Add following in your gradle if doesn't exist:

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

Prerequisites

The minimum API level supported by this library is API 14 (ICE_CREAM_SANDWICH).

Usage

In onCreate() of your activity, create a root view object for the banner:

View rootview = findViewById(android.R.id.content);

With the latest release of v1.1.0, you can now call the banner with one line of code:

Option 1: Choose default layouts

Banner.make(View view,Context context, int bannerType, String message, int position);

Option 2: Choose default layouts with auto dismiss after the given duration

Banner.make(View view,Context context, int bannerType, String message, int position, int duration);

Option 3: With custom layout:

Banner.make(View view,Context context, int position, int Customlayout);

Option 4: With custom layout and below a view (eg toolbar):

Banner make(View view,Context context, int position, int Customlayout,boolean asDropDown) 

Option 5: With custom layout and full screen:

Banner make(View view,Context context, int Customlayout,boolean fillScreen)

Example:

Banner.make(rootview,getBaseContext(),Banner.SUCCESS,"This is a successful message",Banner.TOP).show();
Banner.make(rootview,getBaseContext(),Banner.ERROR,"This is an error message",Banner.BOTTOM,2000).show();

For custom layout, pass your layout as shown below:

Banner.make(rootview,getBaseContext(),Banner.TOP,R.layout.banner);

If your custom banner has views that need to be set on runtime, instantiate your view objects as below:

textView = Banner.getInstance().getBannerView().findViewById(R.id.status_text);
relativeLayout = Banner.getInstance().getBannerView().findViewById(R.id.rlCancel);
textView.setText("This is text for the banner");

To listen to click events, you can implement the following code:

 textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getBaseContext(),"Banner has been clicked", Toast.LENGTH_LONG).show();
            }
        });

        relativeLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Banner.getInstance().dismissBanner();
            }
        });

The library allow to set custom animation for the banner. You can set your own animation style as below:

Banner.getInstance().setCustomAnimationStyle(R.style.NotificationAnimationBottom);

If you want to auto dismiss your custom banner, set the duration as below:

Banner.getInstance().setDuration(2000);

Finally, invoke show method:

 Banner.getInstance().show();

Contribution

Pull requests for new features, bug fixes, and suggestions are welcome!

License

MIT License

Copyright (c) 2018 Shasindran Poonudurai

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].