Balloon

Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android.

APACHE-2.0 License

Stars
3.7K

Bot releases are visible (Hide)

Balloon - 1.2.1

Published by skydoves about 4 years ago

πŸŽ‰ Released a new version 1.2.1! πŸŽ‰

What's New?

  • Added update(anchor: View), update(anchor: View, xOff: Int, yOff: Int) functionalities.
    Updating popup and arrow position of the popup based on a new target anchor view with additional x-off and y-off. (#68)
  • Updated appcompat version to 1.2.0 stable.
  • Changed android.arch.lifecycle package to androidx.arch.lifecycle internally.
  • Fixed not working properly when setDismissWhenTouchOutside with BalloonAnimation.CIRCULAR. (#85)
Balloon - 1.2.0

Published by skydoves about 4 years ago

πŸŽ‰ Released a new version 1.2.0! πŸŽ‰

What's New?

  • Arrow not placing the first time at the right position (#74)
  • Added a setDismissWhenLifecycleOnPause functionality. (#77)
    The balloon popup will be dismissed when the lifecycle owner is on pause status. This method must be work used with 1setLifecycleOwner.
  • Added setIconGravity(value: IconGravity) functionality for deciding gravity of the icon.
  • Added OnBalloonInitializedListener for listening initialized balloon content. (when balloon popup is shown)
Balloon - 1.1.9

Published by skydoves over 4 years ago

πŸŽ‰ Released a new version 1.1.9! πŸŽ‰

What's New?

  • Now setText receives CharSequence type instead of String type for supporting SpannableStringBuilder. (#70)
  • Added set arrow padding functionalities for making different arrow size of width and height. (#64)
    The width/height size of the arrow must be the same internally, so we can set different width and height size of the arrow using these functions.
setArrowLeftPadding(@Dp value: Int
setArrowRightPadding(@Dp value: Int)
setArrowTopPadding(@Dp value: Int)
setArrowBottomPadding(@Dp value: Int)
  • Added setTextGravity functionality for aligning text. (#65)
  • Added setArrowAlignAnchorPadding/setArrowAlignAnchorPaddingRatio functionalities for giving padding from the end of position when we using with ArrowConstraints.ALIGN_ANCHOR. (#67)
  • Added additional dimension resource type functionalities as a parameter from previous existing functions that receive a parameter as a Dp size.
setWidthResource(@DimenRes value: Int)
setHeightResource(@DimenRes value: Int)
setPaddingResource(@DimenRes value: Int)
setSpaceResource(@DimenRes value: Int)
setArrowSizeResource(@DimenRes value: Int)
setCornerRadiusResource(@DimenRes value: Int)
setIconSizeResource(@DimenRes value: Int)
setIconSpaceResource(@DimenRes value: Int)
setElevationResource(@DimenRes value: Int)
Balloon - 1.1.8

Published by skydoves over 4 years ago

πŸŽ‰ Released a new version 1.1.8! πŸŽ‰

What's New?

  • Option to have arrow point at (center of) anchor view (#47, #61, #58)

We can now determine the constraints of the arrow positioning using the ArrowConstraints.
The default constraint is still ALIGN_BALLOON, we can change the ArrowConstraints using the
setArrowConstraints method.

// Aligning arrow based on the anchor view. 
// if an arrowPosition is 0.5, the arrow will be positioned center of the anchor view.
.setArrowConstraints(ArrowConstraints.ALIGN_ANCHOR)
// Aligning arrow based on the balloon popup.
// if an arrowPosition is 0.5, the arrow will be positioned center of the balloon popup.
.setArrowConstraints(ArrowConstraints.ALIGN_BALLOON) // default
  • Make setDismissWhenTouchOutside option makes focusable false (#53)

  • Add support for setting text with HTML (#54)
    If the setTextIsHtml is true, we can set text with HTML tags using TextForm.

  • Setter for custom layout view instead of resource (#59)
    Now we can set a layout as an instance of a view dynamically, not from resource layout.

  • FragmentBalloonLazy uses viewLifecycleOwner instead of the fragmentLifecycleOwner.

Balloon - 1.1.7

Published by skydoves over 4 years ago

πŸŽ‰Released a new version 1.1.7!πŸŽ‰

What's New?

  • Fixed circular revealed animation not working properly.
  • Added setCircularDuration functionality for changing the duration of circular revealed/unrevealed animation.
  • Added lifecycle-common-java8 dependency for processing lifecycle annotations.
  • Shadow not displaying. setElevation not working (#35)
  • Text/images cut off on sides (#42, #50)
Balloon - 1.1.6

Published by skydoves over 4 years ago

πŸŽ‰Released a new version 1.1.6!πŸŽ‰

What's New?

  • Used ViewBinding instead of Kotlin synthetic for increasing the performance of the inflating views.
  • Setting arrow LEFT messes view for custom layouts (#48)
  • Arrow not it the right place on Android 23 (#45)
  • ClassNotFoundException on App StartUp (#37)
  • Added setFocusable attribute and the default value is true (#49)

setFocusable

Before the balloon can not dismiss automatically when pressed the back button, and we can touchable other views and balloons when a balloon popup is already showing.
From this release, the balloon popup is one target base by default, so if we press the back button, the balloon popup will be dismissed (we don't need to use OnBalloonOutsideTouchListener for dismissing), and it will be dismissed automatically if we touch outside of the balloon popup.
We can control these functionalities using the setFocusable method (like before version).

Balloon - 1.1.5

Published by skydoves over 4 years ago

πŸŽ‰Released a new version 1.1.5!πŸŽ‰

What's New?

Fixed some issues related to measuring size of the balloon (#34)

Balloon - 1.1.4

Published by skydoves over 4 years ago

πŸŽ‰Released a new version 1.1.4!πŸŽ‰

What's new?

  • Fixed issues (#22, #28)
Balloon - 1.1.3

Published by skydoves over 4 years ago

πŸŽ‰ Released a new version 1.1.3! πŸŽ‰

What's new?

  • The minimum API level is changed 16 -> 17.
  • Fixed some issues (#25, #27, #33)
  • Added new functionalities: setElevation, setArrowColor, setArrowColorResource.

setElevation

We can set the shadow of the balloon.

setArrowColor, setArrowColorResource

We can set the specific color of the arrow, regardless of the background color.

Balloon - 1.1.2

Published by skydoves over 4 years ago

πŸŽ‰ Released a new version 1.1.2 ! πŸŽ‰

What's new?

The balloon popup wraps content from now. (#1)
So we can use wrap_content to the custom layouts without using setWidth and setHeight methods.

- setWidth(120)
- setHeight(65)
+ setPadding(8) // sets 8dp padding for all directions (left-top-right-bottom) 

We can use setPaddingLeft, setPaddingTop, setPaddingRight, setPaddingBottom instead of the setPadding.
Also, still we can use the setWidth and setHeight methods instead of the setPadding.

Width and height

We can control the size of the width and height using 3 ways: Padding, Specific size, Screen Ratio.

Padding

Balloon wraps a content. So the balloon's width and height size will be decided by the content.
We can set the size of the balloon using paddings of the content.

balloon.setPadding(6) // sets 6dp padding to all directions (left-top-right-bottom)
balloon.setPaddingLeft(8) // sets 8dp padding to content's left.
balloon.setPaddingTop(12) // sets 12dp padding to content's top.

Specific size

We can set the specific size of the balloon regardless of contents.

balloon.setWidth(220) // sets 220dp size width.
balloon.setHeight(160) // sets 160dp size height.

According to screen ratio

Also, we can set the width according to the ratio of the horizontal screen's size.

balloon.setWidthRatio(0.5f) // sets width as 50% of the horizontal screen's size.
Balloon - 1.1.1

Published by skydoves over 4 years ago

Released a new version 1.1.1.

  • Fixed a bug dismissWhenTouchOutside: #17
  • RTL support: #19
    Now Balloon supports RTL (right-to-left) layout using isRtlSupport functionalities.
    If the parameter is true, the balloon popup's layout will be right-to-left.
    Here is an example.
Balloon - 1.1.0

Published by skydoves over 4 years ago

Released a new version 1.1.0.

Implemented some features:

  • circular un-revealed when dismissing balloon popup.
  • A new animation BalloonAnimation .OVERSHOOT
Balloon - 1.0.9

Published by skydoves almost 5 years ago

Released version 1.0.9.

Features:

  • Implemented dismissWithDelay functionality.
  • Implemented setAutoDismissDuration functionality. (#8)
  • Removed & optimized useless resources.
Balloon - 1.0.8

Published by skydoves almost 5 years ago

Released version 1.0.8.

Features :

  • Fixed add setBalloonAnimationStyle for supporting style resource.
  • Fixed setting and getting preference (persistence) showing times (#12)
  • Refactored BalloonPreferenceManager to BalloonPersistence.
Balloon - 1.0.7

Published by skydoves almost 5 years ago

Released version 1.0.7.

Features :

We can show balloon popup sequentially using relayShow method.
The relayShow method makes that setOnDismissListener of the first balloon is reset to show the
next balloon and returns an instance of the next balloon.

customListBalloon
  .relayShowAlignBottom(customProfileBalloon, circleImageView) // relay to customListBalloon
  .relayShowAlignTop(customTagBalloon, bottomNavigationView, 130, 0) // relay to customProfileBalloon

// show sequentially customListBalloon-customProfileBalloon-customTagBalloon
customListBalloon.showAlignBottom(toolbar_list)
  • Support for XML animations (#10)

We can set animation custom xml style using setBalloonAnimationStyle method.

<style name="ElasticAndFadeOut">
  <item name="android:windowEnterAnimation">@anim/elastic_center</item>
  <item name="android:windowExitAnimation">@anim/fade_out</item>
</style>
setBalloonAnimationStyle(R.style.ElasticAndFadeOut)
Balloon - 1.0.6

Published by skydoves about 5 years ago

Released version 1.0.6.

Features :

  • Pass down View & MotionEvent to listeners (#6)

OnBalloonClickListener

fun onBalloonClick(view: View)

OnBalloonOutsideTouchListener

fun onBalloonOutsideTouch(view: View, event: MotionEvent)
  • Support for setting TypeFace type (#7)
    We can set the Typeface object using setTypeface(value: Typeface) function.
fun setTextTypeface(value: Typeface)
  • Added setting drawable using __Resource functionality.

before

.setTextColor(ContextCompat.getColor(baseContext, R.color.white_87))
.setIconDrawable(ContextCompat.getDrawable(baseContext, R.drawable.ic_edit))
.setBackgroundColor(ContextCompat.getColor(baseContext, R.color.skyBlue))

after

.setTextColorResource(R.color.white_87)
.setIconDrawableResource(R.drawable.ic_edit)
.setBackgroundColorResource(R.color.skyBlue)
Balloon - 1.0.5

Published by skydoves about 5 years ago

Released new version 1.0.5.

  • Added setDismissWhenShowAgain and setDismissWhenClicked to the Balloon.Builder.
  • Added setBackgroundColorResource and setTextColorResource funtions.

Before

.setTextColor(ContextCompat.getColor(baseContext, R.color.white_87))
.setBackgroundColor(ContextCompat.getColor(baseContext, R.color.skyBlue))

After

.setTextColorResource(R.color.white_87)
.setBackgroundColorResource(R.color.yellow)
  • Optimized internal logic
Balloon - 1.0.4

Published by skydoves about 5 years ago

Released version 1.0.4.

Balloon's Show methods and extensions can be used without any onClickListeners or delay.

Balloon - 1.0.3

Published by skydoves about 5 years ago

Released version 1.0.3.

Implemented

  • Balloon.Factory abstract class for creating Balloon instance using lazy delegate.
  • balloon lazy delegate extension on ComponentActivity, Fragment.

Now it is possible to create a balloon instance using balloon keyword.

Before
CustomActivity.kt

class CustomActivity : AppCompatActivity() {
  private val profileBalloon by lazy { BalloonUtils.getProfileBalloon(this, this) }

  // ...
}

After
CustomActivity.kt

class CustomActivity : AppCompatActivity() {
  private val profileBalloon by balloon(ProfileBalloonFactory::class)

  // ...
}

ProfileBalloonFactory.kt

class ProfileBalloonFactory : Balloon.Factory() {

  override fun create(context: Context, lifecycle: LifecycleOwner): Balloon {
    return createBalloon(context) {
      setLayout(R.layout.layout_custom_profile)
      setArrowSize(10)
      setArrowOrientation(ArrowOrientation.TOP)
      setArrowPosition(0.5f)
      setWidthRatio(0.55f)
      setHeight(250)
      setCornerRadius(4f)
      setBackgroundColor(ContextCompat.getColor(context, R.color.background900))
      setBalloonAnimation(BalloonAnimation.CIRCULAR)
      setLifecycleOwner(lifecycle)
    }
  }
}

Balloon - 1.0.2

Published by skydoves about 5 years ago

released version 1.0.2.

implemented missing method onDestroy which dismiss automatically when lifecycle owner is onDestroy.

Package Rankings
Top 10.69% on Repo1.maven.org
Badges
Extracted from project README
Maven Central Maven Central
Related Projects