Skip to content

Commit

Permalink
Merge pull request #300 from skydoves/remove/deprecated
Browse files Browse the repository at this point in the history
Remove deprecated functions since 1.3.8
  • Loading branch information
skydoves authored Jan 8, 2022
2 parents f02a994 + 9b482c8 commit 4b88e77
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 182 deletions.
10 changes: 0 additions & 10 deletions balloon/api/balloon.api
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public final class com/skydoves/balloon/Balloon : androidx/lifecycle/DefaultLife
public final fun isShowing ()Z
public fun onDestroy (Landroidx/lifecycle/LifecycleOwner;)V
public fun onPause (Landroidx/lifecycle/LifecycleOwner;)V
public final fun relayShow (Lcom/skydoves/balloon/Balloon;Landroid/view/View;)Lcom/skydoves/balloon/Balloon;
public final fun relayShow (Lcom/skydoves/balloon/Balloon;Landroid/view/View;I)Lcom/skydoves/balloon/Balloon;
public final fun relayShow (Lcom/skydoves/balloon/Balloon;Landroid/view/View;II)Lcom/skydoves/balloon/Balloon;
public static synthetic fun relayShow$default (Lcom/skydoves/balloon/Balloon;Lcom/skydoves/balloon/Balloon;Landroid/view/View;IIILjava/lang/Object;)Lcom/skydoves/balloon/Balloon;
public final fun relayShowAlignBottom (Lcom/skydoves/balloon/Balloon;Landroid/view/View;)Lcom/skydoves/balloon/Balloon;
public final fun relayShowAlignBottom (Lcom/skydoves/balloon/Balloon;Landroid/view/View;I)Lcom/skydoves/balloon/Balloon;
public final fun relayShowAlignBottom (Lcom/skydoves/balloon/Balloon;Landroid/view/View;II)Lcom/skydoves/balloon/Balloon;
Expand Down Expand Up @@ -80,8 +76,6 @@ public final class com/skydoves/balloon/Balloon : androidx/lifecycle/DefaultLife
public final fun setOnBalloonOverlayTouchListener (Lkotlin/jvm/functions/Function2;)V
public final fun setOnBalloonTouchListener (Landroid/view/View$OnTouchListener;)V
public final fun shouldShowUp ()Z
public final fun show (Landroid/view/View;)V
public final fun show (Landroid/view/View;II)V
public final fun showAlignBottom (Landroid/view/View;)V
public final fun showAlignBottom (Landroid/view/View;I)V
public final fun showAlignBottom (Landroid/view/View;II)V
Expand Down Expand Up @@ -508,8 +502,6 @@ public final class com/skydoves/balloon/BalloonExtensionKt {
public static final fun showAtCenter (Landroid/view/View;Lcom/skydoves/balloon/Balloon;II)V
public static final synthetic fun showAtCenter (Landroid/view/View;Lcom/skydoves/balloon/Balloon;IILcom/skydoves/balloon/BalloonCenterAlign;)V
public static synthetic fun showAtCenter$default (Landroid/view/View;Lcom/skydoves/balloon/Balloon;IILcom/skydoves/balloon/BalloonCenterAlign;ILjava/lang/Object;)V
public static final synthetic fun showBalloon (Landroid/view/View;Lcom/skydoves/balloon/Balloon;)V
public static final synthetic fun showBalloon (Landroid/view/View;Lcom/skydoves/balloon/Balloon;II)V
}

public final class com/skydoves/balloon/BalloonHighlightAnimation : java/lang/Enum {
Expand Down Expand Up @@ -633,8 +625,6 @@ public final class com/skydoves/balloon/IconFormKt {
public final class com/skydoves/balloon/IconGravity : java/lang/Enum {
public static final field BOTTOM Lcom/skydoves/balloon/IconGravity;
public static final field END Lcom/skydoves/balloon/IconGravity;
public static final field LEFT Lcom/skydoves/balloon/IconGravity;
public static final field RIGHT Lcom/skydoves/balloon/IconGravity;
public static final field START Lcom/skydoves/balloon/IconGravity;
public static final field TOP Lcom/skydoves/balloon/IconGravity;
public static fun valueOf (Ljava/lang/String;)Lcom/skydoves/balloon/IconGravity;
Expand Down
64 changes: 0 additions & 64 deletions balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -798,28 +798,6 @@ public class Balloon private constructor(
return balloon
}

/**
* Shows the balloon on the center of an anchor view.
*
* @param anchor A target view which popup will be shown to.
*/
@Deprecated(
message = "show() method will be deprecated since `1.3.8`. Use showAtCenter() instead.",
replaceWith = ReplaceWith(
"showAtCenter(anchor)",
imports = ["com.skydoves.balloon.Balloon.showAtCenter"]
),
)
public fun show(anchor: View) {
show(anchor) {
bodyWindow.showAsDropDown(
anchor,
builder.supportRtlLayoutFactor * ((anchor.measuredWidth / 2) - (getMeasuredWidth() / 2)),
-getMeasuredHeight() - (anchor.measuredHeight / 2)
)
}
}

/**
* Shows the balloon over the anchor view (overlap) as the center aligns.
* Even if you use with the [ArrowOrientationRules.ALIGN_ANCHOR], the alignment will not be guaranteed.
Expand Down Expand Up @@ -894,48 +872,6 @@ public class Balloon private constructor(
centerAlign: BalloonCenterAlign = BalloonCenterAlign.TOP
): Balloon = relay(balloon) { it.showAtCenter(anchor, xOff, yOff, centerAlign) }

/**
* Shows the balloon on the center of an anchor view.
*
* @param anchor A target view which popup will be shown to.
* @param xOff A horizontal offset from the anchor in pixels.
* @param yOff A vertical offset from the anchor in pixels.
*/
@Deprecated(
message = "show() method will be deprecated since `1.3.8`. Use showAsDropDown() instead.",
replaceWith = ReplaceWith(
"showAsDropDown(anchor, xOff, yOff)",
imports = ["com.skydoves.balloon.Balloon.showAsDropDown"]
),
)
public fun show(anchor: View, xOff: Int, yOff: Int) {
show(anchor) { bodyWindow.showAsDropDown(anchor, xOff, yOff) }
}

/**
* Shows the balloon on the center of an anchor view and shows the next balloon sequentially.
* This function returns the next balloon.
*
* @param balloon A next [Balloon] that will be shown sequentially after dismissing this popup.
* @param anchor A target view which popup will be shown to.
* @param xOff A horizontal offset from the anchor in pixels.
* @param yOff A vertical offset from the anchor in pixels.
*
* @return A next [balloon].
*
* @see [Show sequentially](https://github.com/skydoves/Balloon#show-sequentially)
*/
@Deprecated(
message = "relayShow() method will be deprecated since `1.3.8`. Use relayShowAsDropDown() instead.",
replaceWith = ReplaceWith(
"relayShowAsDropDown(anchor, xOff, yOff)",
imports = ["com.skydoves.balloon.Balloon.relayShowAsDropDown"]
),
)
@JvmOverloads
public fun relayShow(balloon: Balloon, anchor: View, xOff: Int = 0, yOff: Int = 0): Balloon =
relayShowAsDropDown(balloon, anchor, xOff, yOff)

/**
* Shows the balloon on an anchor view as drop down with x-off and y-off.
*
Expand Down
23 changes: 0 additions & 23 deletions balloon/src/main/kotlin/com/skydoves/balloon/BalloonExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ package com.skydoves.balloon
import android.view.View
import androidx.annotation.MainThread

/** shows the balloon on the center of an anchor view. */
@Deprecated(
message = "show() method will be deprecated since `1.3.8`. Use showAtCenter() instead.",
replaceWith = ReplaceWith(
"showAtCenter(anchor)",
imports = ["com.skydoves.balloon.showAtCenter"]
),
)
@JvmSynthetic
public fun View.showBalloon(balloon: Balloon): Unit = showAtCenter(balloon)

/** shows the balloon on the center of an anchor view. */
@JvmOverloads
@JvmSynthetic
Expand All @@ -44,18 +33,6 @@ public fun View.showAtCenter(
balloon { balloon.showAtCenter(this, xOff, yOff, centerAlign) }
}

/** shows the balloon on an anchor view with x-off and y-off. */
@Deprecated(
message = "show() method will be deprecated since `1.3.8`. Use showAsDropDown() instead.",
replaceWith = ReplaceWith(
"showAsDropDown(anchor, xOff, yOff)",
imports = ["com.skydoves.balloon.showAsDropDown"]
),
)
@JvmSynthetic
public fun View.showBalloon(balloon: Balloon, xOff: Int, yOff: Int): Unit =
showAsDropDown(balloon, xOff, yOff)

/** shows the balloon on an anchor view as drop down with x-off and y-off. */
@JvmOverloads
@JvmSynthetic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,6 @@ import androidx.fragment.app.Fragment
import com.skydoves.balloon.internal.ActivityBalloonLazy
import com.skydoves.balloon.internal.FragmentBalloonLazy
import com.skydoves.balloon.internal.ViewBalloonLazy
import kotlin.reflect.KClass

/**
* Returns a [Lazy] delegate to access the [ComponentActivity]'s Balloon property.
*
* @param factory A [Balloon.Factory] kotlin class for creating a new instance of the Balloon.
*/
@Deprecated(
message = "Use balloon<T>() instead",
replaceWith = ReplaceWith(
"balloon<T>()",
imports = ["com.skydoves.balloon"]
)
)
@MainThread
@JvmSynthetic
@BalloonInlineDsl
public inline fun <reified T : Balloon.Factory> ComponentActivity.balloon(
factory: KClass<T>
): Lazy<Balloon> {
return ActivityBalloonLazy(this, this, factory)
}

/**
* Returns a [Lazy] delegate to access the [ComponentActivity]'s Balloon property.
Expand All @@ -59,27 +37,6 @@ public inline fun <reified T : Balloon.Factory> ComponentActivity.balloon(): Laz
return ActivityBalloonLazy(context = this, lifecycleOwner = this, factory = T::class)
}

/**
* Returns a [Lazy] delegate to access the [Fragment]'s Balloon property.
*
* @param factory A [Balloon.Factory] kotlin class for creating a new instance of the Balloon.
*/
@Deprecated(
message = "Use balloon<T>() instead",
replaceWith = ReplaceWith(
"balloon<T>()",
imports = ["com.skydoves.balloon"]
)
)
@MainThread
@JvmSynthetic
@BalloonInlineDsl
public inline fun <reified T : Balloon.Factory> Fragment.balloon(
factory: KClass<T>
): Lazy<Balloon> {
return FragmentBalloonLazy(this, factory)
}

/**
* Returns a [Lazy] delegate to access the [Fragment]'s Balloon property.
* The balloon property will be initialized lazily.
Expand All @@ -93,27 +50,6 @@ public inline fun <reified T : Balloon.Factory> Fragment.balloon(): Lazy<Balloon
return FragmentBalloonLazy(fragment = this, factory = T::class)
}

/**
* Returns a [Lazy] delegate to access the custom [View]'s Balloon property.
*
* @param factory A [Balloon.Factory] kotlin class for creating a new instance of the Balloon.
*/
@Deprecated(
message = "Use balloon<T>() instead",
replaceWith = ReplaceWith(
"balloon<T>()",
imports = ["com.skydoves.balloon"]
)
)
@MainThread
@JvmSynthetic
@BalloonInlineDsl
public inline fun <reified T : Balloon.Factory> View.balloon(
factory: KClass<T>
): Lazy<Balloon> {
return ViewBalloonLazy(this, factory)
}

/**
* Returns a [Lazy] delegate to access the custom [View]'s Balloon property.
* The balloon property will be initialized lazily.
Expand Down
18 changes: 0 additions & 18 deletions balloon/src/main/kotlin/com/skydoves/balloon/IconGravity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@ package com.skydoves.balloon

/** IconGravity determines the orientation of the icon. */
public enum class IconGravity {
@Deprecated(
message = "IconGravity.LEFT is deprecated. Use IconGravity.START instead.",
replaceWith = ReplaceWith(
"IconGravity.START",
imports = ["com.skydoves.balloon"]
)
)
LEFT,

@Deprecated(
message = "IconGravity.LEFT is deprecated. Use IconGravity.END instead.",
replaceWith = ReplaceWith(
"IconGravity.END",
imports = ["com.skydoves.balloon"]
)
)
RIGHT,

START,
END,
TOP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ private fun fromHtml(text: String): Spanned? {

/** applies icon form attributes to a ImageView instance. */
@JvmSynthetic
@Suppress("DEPRECATION")
internal fun VectorTextView.applyIconForm(iconForm: IconForm) {
iconForm.drawable?.let {
drawableTextViewParams = VectorTextViewParams(
Expand All @@ -65,7 +64,7 @@ internal fun VectorTextView.applyIconForm(iconForm: IconForm) {
tintColor = iconForm.iconColor.takeIf { it != NO_INT_VALUE }
).apply {
when (iconForm.iconGravity) {
IconGravity.LEFT, IconGravity.START -> {
IconGravity.START -> {
drawableStart = iconForm.drawable
drawableStartRes = iconForm.drawableRes
}
Expand All @@ -77,7 +76,7 @@ internal fun VectorTextView.applyIconForm(iconForm: IconForm) {
drawableBottom = iconForm.drawable
drawableBottomRes = iconForm.drawableRes
}
IconGravity.RIGHT, IconGravity.END -> {
IconGravity.END -> {
drawableEnd = iconForm.drawable
drawableEndRes = iconForm.drawableRes
}
Expand Down

0 comments on commit 4b88e77

Please sign in to comment.