Skip to content

Commit

Permalink
Merge pull request #402 from skydoves/fix/arrrow-orientation
Browse files Browse the repository at this point in the history
Add rules for the start and end arrow position of ALIGN_ANCHOR
  • Loading branch information
skydoves committed Jan 6, 2023
2 parents 4e3ad4d + b7481ce commit b17391b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,16 @@ public class Balloon private constructor(
builder.setArrowOrientation(ArrowOrientation.TOP)
}

if (builder.arrowOrientation == ArrowOrientation.START &&
location[0] < anchorRect.right
) {
builder.setArrowOrientation(ArrowOrientation.END)
} else if (builder.arrowOrientation == ArrowOrientation.END &&
location[0] > anchorRect.left
) {
builder.setArrowOrientation(ArrowOrientation.START)
}

initializeBalloonContent()
}

Expand Down

0 comments on commit b17391b

Please sign in to comment.