File tree Expand file tree Collapse file tree 4 files changed +22
-12
lines changed
src/main/java/com/ovenbits/quickactionview Expand file tree Collapse file tree 4 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 11apply plugin : ' com.android.application'
22
33android {
4- compileSdkVersion 23
5- buildToolsVersion " 23 .0.3 "
4+ compileSdkVersion 24
5+ buildToolsVersion " 24 .0.1 "
66
77 defaultConfig {
88 applicationId " com.ovenbits.quickactionview.sample"
99 minSdkVersion 15
10- targetSdkVersion 23
10+ targetSdkVersion 24
1111 versionCode 1
1212 versionName " 1.0"
1313 vectorDrawables. useSupportLibrary = true
@@ -26,8 +26,8 @@ android {
2626dependencies {
2727 compile fileTree(include : [' *.jar' ], dir : ' libs' )
2828 testCompile ' junit:junit:4.12'
29- compile ' com.android.support:appcompat-v7:23.3.0 '
30- compile ' com.android.support:design:23.3.0 '
31- compile ' com.android.support:recyclerview-v7:23.3.0 '
29+ compile ' com.android.support:appcompat-v7:24.1.1 '
30+ compile ' com.android.support:design:24.1.1 '
31+ compile ' com.android.support:recyclerview-v7:24.1.1 '
3232 compile project(' :quickactionview' )
3333}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ buildscript {
55 jcenter()
66 }
77 dependencies {
8- classpath ' com.android.tools.build:gradle:2.1.0 '
8+ classpath ' com.android.tools.build:gradle:2.1.2 '
99 classpath ' com.github.dcendents:android-maven-gradle-plugin:1.3'
1010
1111 // NOTE: Do not place your application dependencies here; they belong
Original file line number Diff line number Diff line change 11apply plugin : ' com.android.library'
22
33android {
4- compileSdkVersion 23
5- buildToolsVersion " 23 .0.3 "
4+ compileSdkVersion 24
5+ buildToolsVersion " 24 .0.1 "
66
77 defaultConfig {
88 minSdkVersion 15
9- targetSdkVersion 23
9+ targetSdkVersion 24
1010 versionCode 1
1111 versionName " 1.0.0"
1212 }
@@ -24,7 +24,7 @@ android {
2424dependencies {
2525 compile fileTree(dir : ' libs' , include : [' *.jar' ])
2626 testCompile ' junit:junit:4.12'
27- compile ' com.android.support:appcompat-v7:23.4.0 '
27+ compile ' com.android.support:appcompat-v7:24.1.1 '
2828}
2929
3030apply from : ' https://raw.githubusercontent.com/Commit451/gradle-android-javadocs/1.0.0/gradle-android-javadocs.gradle'
Original file line number Diff line number Diff line change @@ -457,7 +457,9 @@ private void removeView() {
457457
458458 if (mQuickActionViewLayout != null ) {
459459 WindowManager manager = (WindowManager ) mContext .getSystemService (Context .WINDOW_SERVICE );
460- manager .removeView (mQuickActionViewLayout );
460+ if (checkAttachedToWindow (mQuickActionViewLayout )) {
461+ manager .removeView (mQuickActionViewLayout );
462+ }
461463 mQuickActionViewLayout = null ;
462464 mShown = false ;
463465 }
@@ -470,6 +472,14 @@ private void removeView() {
470472 }
471473 }
472474
475+ private boolean checkAttachedToWindow (View view ) {
476+ if (Build .VERSION .SDK_INT >= 19 ) {
477+ return view .isAttachedToWindow ();
478+ }
479+ //Unfortunately, we have no way of truly knowing on versions less than 19
480+ return true ;
481+ }
482+
473483 private void dismiss () {
474484 if (!mShown ) {
475485 throw new RuntimeException ("The QuickActionView must be visible to call dismiss()" );
You can’t perform that action at this time.
0 commit comments