Skip to content

Commit

Permalink
"Auto"
Browse files Browse the repository at this point in the history
  • Loading branch information
Beppi Menozzi authored and Beppi Menozzi committed Dec 23, 2016
1 parent dc3df67 commit b8acb85
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

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

4 changes: 2 additions & 2 deletions balloonpopup_library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "0.2"
versionCode 2
versionName "0.2.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,34 +275,58 @@ public void updateOffset(int newOffsetX, int newOffsetY, boolean restartLifeTime
offsetY = newOffsetY;
draw(restartLifeTime);
}
public void updateOffset(int newOffsetX, int newOffsetY) {
updateOffset(newOffsetX, newOffsetY, true);
}

public void updateGravity(BalloonGravity gravity, boolean restartLifeTime) {
this.gravity = gravity;
draw(restartLifeTime);
}
public void updateGravity(BalloonGravity gravity) {
updateGravity(gravity, true);
}

public void updateText(String newText, boolean restartLifeTime) {
text = newText;
textView.setText(text);
draw (restartLifeTime);
}
public void updateText(String newText) {
updateText(newText, true);
}
public void updateText(int newTextRes, boolean restartLifeTime) {
updateText(ctx.getResources().getString(newTextRes), restartLifeTime);
}
public void updateText(int newTextRes) {
updateText(ctx.getResources().getString(newTextRes), true);
}

public void updateTextSize(int textSize, boolean restartLifeTime) {
this.textSize = textSize;
textView.setTextSize((float) textSize);
draw (restartLifeTime);
}
public void updateTextSize(int textSize) {
updateTextSize(textSize, true);
}

public void updateFgColor(int fgColor, boolean restartLifeTime) {
this.fgColor = fgColor;
textView.setTextColor(fgColor);
draw (restartLifeTime);
}
public void updateFgColor(int fgColor) {
updateFgColor(fgColor, true);
}

public void updateLifeTimeToLive (int milliseconds, boolean restartLifeTime) {
this.timeToLive = milliseconds;
draw (restartLifeTime);
}
public void updateLifeTimeToLive (int milliseconds) {
updateLifeTimeToLive(milliseconds, true);
}

public void restartLifeTime() {
if (popupWindow.isShowing()) {
Expand All @@ -321,6 +345,13 @@ public void run() {
}
}

public void showAgain() {
if (popupWindow.isShowing())
restartLifeTime();
else
draw(true);
}

public static class Builder {
private Context ctx;
private View attachView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,16 @@ public void onClick(View view) {
.bgColor(Color.CYAN)
.fgColor(Color.RED)
.gravity(bg)
.textSize(6)
.offsetX(10)
.offsetY(15)
.positionOffset(10, 15)
.drawable(R.drawable.bg_circle)
.layoutRes(R.layout.customview)
.show();
else
bp.restartLifeTime();

}
});

Expand Down

0 comments on commit b8acb85

Please sign in to comment.