Skip to content

Commit

Permalink
Merge pull request #33 from TorryDo/release/v0.5.3
Browse files Browse the repository at this point in the history
Release/v0.5.3
  • Loading branch information
TorryDo committed Apr 29, 2023
2 parents bc01c9c + f918a6d commit cbf4485
Show file tree
Hide file tree
Showing 15 changed files with 324 additions and 201 deletions.
17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class ExpandableView(
gravity = Gravity.TOP
flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND
dimAmount = builder.dim // default = 0.5f
softInputMode = WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE

builder.viewStyle?.let {
windowAnimations = it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ internal constructor(
private var bottomBackground: FloatingBottomBackground? = null

init {
ScreenInfo.getScreenSize(builder.context).also {
ScreenInfo.widthPx = it.width
ScreenInfo.heightPx = it.height
}
ScreenInfo.statusBarHeightPx = ScreenInfo.getStatusBarHeight(builder.context)
ScreenInfo.softNavBarHeightPx = ScreenInfo.getSoftNavigationBarSize(builder.context)
ScreenInfo.onOrientationChanged(builder.context)

bubbleView = FloatingBubbleView(
builder.addFloatingBubbleListener(CustomBubbleListener())
Expand Down Expand Up @@ -78,7 +73,7 @@ internal constructor(
fun requestStop()
}

// internal func ---------------------------------------------------------------------------------
//region public methods ------------------------------------------------------------------------

internal fun showIcon() {
bubbleView.show()
Expand All @@ -98,7 +93,9 @@ internal constructor(
bottomBackground?.remove()
}

// private func --------------------------------------------------------------------------------
//endregion

//region Private func --------------------------------------------------------------------------

private inner class CustomBubbleListener : Listener {

Expand All @@ -108,7 +105,7 @@ internal constructor(
override fun onMove(x: Float, y: Float) {
when (builder.behavior) {
BubbleBehavior.DYNAMIC_CLOSE_BUBBLE -> {
bubbleView.updateLocation(x, y)
bubbleView.updateLocationUI(x, y)
val (bubbleX, bubbleY) = bubbleView.rawLocationOnScreen()
closeBubbleView?.animateCloseIconByBubble(bubbleX.toInt(), bubbleY.toInt())
}
Expand All @@ -130,7 +127,7 @@ internal constructor(

} else {
isBubbleAnimated = false
bubbleView.updateLocation(x, y)
bubbleView.updateLocationUI(x, y)
}
}
}
Expand Down Expand Up @@ -180,7 +177,9 @@ internal constructor(
) == 0.0f
}

// builder -------------------------------------------------------------------------------------
//endregion

//region Builder -------------------------------------------------------------------------------

class Builder(internal val context: Context) {

Expand Down Expand Up @@ -420,4 +419,6 @@ internal constructor(
}
}

//endregion

}

0 comments on commit cbf4485

Please sign in to comment.