All Projects → BeppiMenozzi → BalloonPopup

BeppiMenozzi / BalloonPopup

Licence: other
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to BalloonPopup

Popupdialog
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
Stars: ✭ 3,709 (+11490.63%)
Mutual labels:  alert, overlay, dialog, popup, alertview
Cdalertview
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift
Stars: ✭ 1,056 (+3200%)
Mutual labels:  alerts, alert, popup-window, popup, alertview
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (+212.5%)
Mutual labels:  alert, dialog, popup, alertview
Alerttoast
Create Apple-like alerts & toasts using SwiftUI
Stars: ✭ 151 (+371.88%)
Mutual labels:  alert, dialog, popup, toast
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+43428.13%)
Mutual labels:  alert, dialog, popup, toast
Aestheticdialogs
📱 An Android Library for 💫fluid, 😍beautiful, 🎨custom Dialogs.
Stars: ✭ 352 (+1000%)
Mutual labels:  dialogs, dialog, popup, android-ui
Razor.SweetAlert2
A Razor class library for interacting with SweetAlert2
Stars: ✭ 98 (+206.25%)
Mutual labels:  alert, dialog, popup, toast
Jbox
jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.
Stars: ✭ 1,251 (+3809.38%)
Mutual labels:  alert, popup-window, dialog, popup
Jalert
jQuery alert/modal/lightbox plugin
Stars: ✭ 73 (+128.13%)
Mutual labels:  alerts, alert, popup-window, popup
Wc Messagebox
基于 Vue 2.0 开发的 Alert, Toast, Confirm 插件, UI仿照 iOS 原生
Stars: ✭ 203 (+534.38%)
Mutual labels:  alert, dialog, toast
Alertview
A library to create simple alerts easily with some customization.
Stars: ✭ 222 (+593.75%)
Mutual labels:  alert, dialog, alertview
Nativepopup
Clone of Apple iOS App's feedback popup, and easily customizable.
Stars: ✭ 247 (+671.88%)
Mutual labels:  alert, dialog, popup
Pmalertcontroller
PMAlertController is a great and customizable alert that can substitute UIAlertController
Stars: ✭ 2,397 (+7390.63%)
Mutual labels:  alert, dialog, popup
Jh flutter demo
a flutter demo
Stars: ✭ 229 (+615.63%)
Mutual labels:  alert, dialog, toast
Tfpopup
🚀🚀🚀TFPopup不生产弹框,它只是弹框的弹出工🚀🚀🚀默认支持多种动画方式一行调用,支持完全自定义动画.
Stars: ✭ 182 (+468.75%)
Mutual labels:  alert, popup, toast
Jquery Confirm
A multipurpose plugin for alert, confirm & dialog, with extended features.
Stars: ✭ 1,776 (+5450%)
Mutual labels:  alert, dialog, popup
react-spring-bottom-sheet
Accessible ♿️, Delightful ✨, & Fast 🚀
Stars: ✭ 604 (+1787.5%)
Mutual labels:  overlay, dialog, popup
eins-modal
Simple to use modal / alert / dialog / popup. Created with pure JS. No javascript knowledge required! Works on every browser and device! IE9
Stars: ✭ 30 (-6.25%)
Mutual labels:  alert, dialog, popup
react-redux-modal-flex
[DEPRECATED] Make easy a modal/popup with Redux
Stars: ✭ 14 (-56.25%)
Mutual labels:  alert, dialog, popup
xxy
xxy xxy.js alert 移动端弹窗 弹窗 上拉加载 下拉刷新 移动端UI 轮播 banner
Stars: ✭ 84 (+162.5%)
Mutual labels:  alert, popup-window, toast

BalloonPopup

Displays a round or squared popup attaching it to a View. Allows animations and automatic display and hide, or persistence of the balloon when updating its value. Uses the Builder pattern for maximum ease.



Setup

In your project's build.gradle file:

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

In your Application's or Module's build.gradle file:

dependencies {
    ...
    compile 'com.github.BeppiMenozzi:BalloonPopup:0.2.8'
    ...
}

Minimal usage

BalloonPopup bp = BalloonPopup.Builder(getApplicationContext(), myView)
                    .text("myText")
                    .show();

To show it again:

bp.showAgain();

To display different text:

bp.updateText(newText);

Examples

In addition to the simple example included, this library is used in my Knob Selector library, that contains useful examples and an interesting way to use this library. Test it out.

Customize

Available methods in the Builder:

  bp = BalloonPopup.Builder(getApplicationContext(), findViewById(R.id.button))
                    .text("text")               // set the text displayed (String or resource)
                    .timeToLive(2000)           // Millseconds before closing the popup. 0 = persistent
                    .animation(fade_and_pop)    // animation style used. Available:
                                                // pop, scale, fade, fade75
                                                // and all the possible combinations.
                                                // When fade75 is used (up to alpha .75) the view is slightly transparent
                    .shape(rounded_square)      // Circle (oval) or rounded square
                    .bgColor(Color.CYAN)        // unused yet
                    .fgColor(Color.RED)         // text color
                    .gravity(bg)                // gravity relative to the attach view
                    .textSize(6)                // text size
                    .offsetX(10)                // offsets to move the position accordingly
                    .offsetY(15)
                    .positionOffset(10, 15)
                    .drawable(R.drawable.bg_circle) // custom background drawable
                    .layoutRes(R.layout.customview) // custom layout for the popup window
                    .show();                    // create, display and return the balloon

Available methods on the balloon:

            bp.isShowing();                     // returns wether the balloon is currently visibile
            bp.restartLifeTime();               // restarts the time to live, postponing the closure
            bp.updateText();                    // updates the text and displays it again
            bp.updateTextSize();                // updates text size and displays it again
            bp.updateFgColor();                 // updates text color and displays it again
            bp.updateBgColor();                 // updates background color: available only from Lollipop (>= 21)
            bp.updateOffset();                  // updates position and displays it again
            bp.updateGravity();                 // updates gravity and displays it again
            bp.updateLifeTimeToLive();          // updates time to live
            bp.showAgain();                     // show again the previous balloon

Most of these methods ask a boolean parameter restartLifeTime. If this is false, in case of update, if the balloon is already showing, its life is not made longer and its closure remains scheduled as before. As default this parameter is true (so whenever an update is done, the time to live is reset).

New in 0.2.8

  • Included alexandre-g additions: ** Allow custom views for dynamically built layouts ** Allow disabling tap-to-dismiss ** Allow to force showing only within screen bounds ** Allow dismissing popup

New in 0.2.2

  • bgcolor for >= Lollipop (21)
  • fixed crash if built inside onCreate()
  • increased minApk from 9 to 11

Known bugs

  • On emulators with version < 4.4.4 / KitKat / Api 19 it can crash.
  • It doesn't scroll when the attached view is in a scrollview.

Author

  • Beppi Menozzi

License

The MIT License (MIT)

Copyright (c) 2016 Beppi Menozzi

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].