Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
MasayukiSuda authored Jun 14, 2016
1 parent 524cc58 commit 662159a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BubbleLayout Extends the FrameLayout.
Add the dependency to your build.gradle.
```
dependencies {
compile 'com.daasuu:BubbleLayout:1.1.0'
compile 'com.daasuu:BubbleLayout:1.1.1'
}
```

Expand Down Expand Up @@ -130,15 +130,22 @@ Button button = (Button) findViewById(R.id.btn_popup);

BubbleLayout bubbleLayout = (BubbleLayout) LayoutInflater.from(this).inflate(R.layout.layout_sample_popup, null);
PopupWindow popupWindow = BubblePopupHelper.create(this, bubbleLayout);
final Random random = new Random();

button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int[] location = new int[2];
v.getLocationInWindow(location);
if (random.nextBoolean()) {
bubbleLayout.setArrowDirection(ArrowDirection.TOP);
} else {
bubbleLayout.setArrowDirection(ArrowDirection.BOTTOM);
}
popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, location[0], v.getHeight() + location[1]);
}
});

```
layout_sample_popup.xml
```xml
Expand Down

0 comments on commit 662159a

Please sign in to comment.