diff --git a/LemonBubble/.idea/misc.xml b/LemonBubble/.idea/misc.xml index 5d19981..fbb6828 100644 --- a/LemonBubble/.idea/misc.xml +++ b/LemonBubble/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/LemonBubble/lemonbubble-samples/build.gradle b/LemonBubble/lemonbubble-samples/build.gradle index 168d5c9..2b1b73c 100644 --- a/LemonBubble/lemonbubble-samples/build.gradle +++ b/LemonBubble/lemonbubble-samples/build.gradle @@ -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' } diff --git a/LemonBubble/lemonbubble-samples/src/main/AndroidManifest.xml b/LemonBubble/lemonbubble-samples/src/main/AndroidManifest.xml index 66f74eb..0ffa8fa 100644 --- a/LemonBubble/lemonbubble-samples/src/main/AndroidManifest.xml +++ b/LemonBubble/lemonbubble-samples/src/main/AndroidManifest.xml @@ -11,9 +11,11 @@ + + \ No newline at end of file diff --git a/LemonBubble/lemonbubble-samples/src/main/java/net/lemonsoft/lemonbubble/samples/MainActivity.java b/LemonBubble/lemonbubble-samples/src/main/java/net/lemonsoft/lemonbubble/samples/MainActivity.java index 95ac099..5626622 100644 --- a/LemonBubble/lemonbubble-samples/src/main/java/net/lemonsoft/lemonbubble/samples/MainActivity.java +++ b/LemonBubble/lemonbubble-samples/src/main/java/net/lemonsoft/lemonbubble/samples/MainActivity.java @@ -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)); } }); diff --git a/LemonBubble/lemonbubble/src/main/java/net/lemonsoft/lemonbubble/LemonBubble.java b/LemonBubble/lemonbubble/src/main/java/net/lemonsoft/lemonbubble/LemonBubble.java index e05d2e8..1988fbf 100644 --- a/LemonBubble/lemonbubble/src/main/java/net/lemonsoft/lemonbubble/LemonBubble.java +++ b/LemonBubble/lemonbubble/src/main/java/net/lemonsoft/lemonbubble/LemonBubble.java @@ -404,5 +404,12 @@ public static void hide() { LemonBubbleView.defaultBubbleView().hide(); } + /** + * 强制关闭当前正在显示的泡泡控件 + */ + public static void forceHide() { + LemonBubbleView.defaultBubbleView().forceHide(); + } + } diff --git a/LemonBubble/lemonbubble/src/main/java/net/lemonsoft/lemonbubble/LemonBubbleView.java b/LemonBubble/lemonbubble/src/main/java/net/lemonsoft/lemonbubble/LemonBubbleView.java index ecbc48f..5ebe0f1 100644 --- a/LemonBubble/lemonbubble/src/main/java/net/lemonsoft/lemonbubble/LemonBubbleView.java +++ b/LemonBubble/lemonbubble/src/main/java/net/lemonsoft/lemonbubble/LemonBubbleView.java @@ -348,4 +348,12 @@ public void run() { }, 300);// 待所有动画处理完毕后关闭根Dialog } + /** + * 强制关闭当前正在显示的泡泡控件 + */ + public void forceHide() { + _container.dismiss(); + this.haveInit = false; + } + }