diff --git a/README.md b/README.md index ee3c04b..9b2c6ad 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ repositories { Module build.gradle ```java dependencies { - compile 'com.github.iammert:MaterialIntroView:1.4' + compile 'com.github.iammert:MaterialIntroView:1.5' } ``` diff --git a/materialintro/build.gradle b/materialintro/build.gradle index 123d435..876f9ab 100644 --- a/materialintro/build.gradle +++ b/materialintro/build.gradle @@ -5,7 +5,7 @@ android { buildToolsVersion "23.0.2" defaultConfig { - minSdkVersion 16 + minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionName "1.0" diff --git a/materialintro/src/main/java/co/mobiwise/materialintro/view/MaterialIntroView.java b/materialintro/src/main/java/co/mobiwise/materialintro/view/MaterialIntroView.java index ccf2d4a..b64da2b 100644 --- a/materialintro/src/main/java/co/mobiwise/materialintro/view/MaterialIntroView.java +++ b/materialintro/src/main/java/co/mobiwise/materialintro/view/MaterialIntroView.java @@ -264,12 +264,20 @@ public void onGlobalLayout() { setInfoLayout(); if(isDotViewEnabled) setDotViewLayout(); - getViewTreeObserver().removeOnGlobalLayoutListener(this); + removeOnGlobalLayoutListener(MaterialIntroView.this, this); } } }); + } + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + public static void removeOnGlobalLayoutListener(View v, ViewTreeObserver.OnGlobalLayoutListener listener){ + if (Build.VERSION.SDK_INT < 16) { + v.getViewTreeObserver().removeGlobalOnLayoutListener(listener); + } else { + v.getViewTreeObserver().removeOnGlobalLayoutListener(listener); + } } @Override diff --git a/sample/build.gradle b/sample/build.gradle index 650499e..f739875 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -6,7 +6,7 @@ android { defaultConfig { applicationId "co.mobiwise.sample" - minSdkVersion 16 + minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionName "1.0" @@ -24,6 +24,6 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' - //compile 'com.github.iammert:MaterialIntroView:a4b7947d19' + //compile 'com.github.iammert:MaterialIntroView:1.4' compile project(':materialintro') } diff --git a/sample/src/main/java/co/mobiwise/sample/fragment/MainFragment.java b/sample/src/main/java/co/mobiwise/sample/fragment/MainFragment.java index c954982..84af772 100644 --- a/sample/src/main/java/co/mobiwise/sample/fragment/MainFragment.java +++ b/sample/src/main/java/co/mobiwise/sample/fragment/MainFragment.java @@ -21,7 +21,6 @@ public class MainFragment extends Fragment implements View.OnClickListener{ private static final String INTRO_CARD = "material_intro"; - private static final String INTRO_RESET_BUTTON = "material_reset"; private CardView cardView; private Button button;