Skip to content

Commit

Permalink
添加forceHide方法
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuRi committed Jan 9, 2017
1 parent 0756430 commit 9f4dc9a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion LemonBubble/.idea/misc.xml

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

3 changes: 2 additions & 1 deletion LemonBubble/lemonbubble-samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile project(':lemonbubble')
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
}
2 changes: 2 additions & 0 deletions LemonBubble/lemonbubble-samples/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".TestActivity"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,17 @@ public void onClick(View v) {
button7.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LemonBubble.getRoundProgressBubbleInfo()
.setTitle("无限请求中...")
.setOnMaskTouchContext(new LemonBubbleMaskOnTouchContext() {
@Override
public void onTouch(LemonBubbleInfo bubbleInfo, LemonBubbleView bubbleView) {
bubbleView.hide();
Toast.makeText(getApplicationContext(), "您终止圆形了等待框~", Toast.LENGTH_LONG).show();
}
})
.show(MainActivity.this);
// LemonBubble.getRoundProgressBubbleInfo()
// .setTitle("无限请求中...")
// .setOnMaskTouchContext(new LemonBubbleMaskOnTouchContext() {
// @Override
// public void onTouch(LemonBubbleInfo bubbleInfo, LemonBubbleView bubbleView) {
// bubbleView.hide();
// Toast.makeText(getApplicationContext(), "您终止圆形了等待框~", Toast.LENGTH_LONG).show();
// }
// })
// .show(MainActivity.this);
startActivity(new Intent().setClass(MainActivity.this, TestActivity.class));
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,5 +404,12 @@ public static void hide() {
LemonBubbleView.defaultBubbleView().hide();
}

/**
* 强制关闭当前正在显示的泡泡控件
*/
public static void forceHide() {
LemonBubbleView.defaultBubbleView().forceHide();
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,12 @@ public void run() {
}, 300);// 待所有动画处理完毕后关闭根Dialog
}

/**
* 强制关闭当前正在显示的泡泡控件
*/
public void forceHide() {
_container.dismiss();
this.haveInit = false;
}

}

0 comments on commit 9f4dc9a

Please sign in to comment.