diff --git a/simpledialogfragment/src/main/java/eltos/simpledialogfragment/color/SimpleColorDialog.java b/simpledialogfragment/src/main/java/eltos/simpledialogfragment/color/SimpleColorDialog.java index 7b7d941..8f498e5 100644 --- a/simpledialogfragment/src/main/java/eltos/simpledialogfragment/color/SimpleColorDialog.java +++ b/simpledialogfragment/src/main/java/eltos/simpledialogfragment/color/SimpleColorDialog.java @@ -19,6 +19,7 @@ import android.content.Context; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; +import android.os.Build; import android.os.Bundle; import android.support.annotation.ArrayRes; import android.support.annotation.ColorInt; @@ -118,11 +119,12 @@ public SimpleColorDialog colorPreset(@ColorInt int color){ /** * Set this to true to show a field with a color picker option + * Option is ignored on Gingebread * * @param allow allow custom picked color if true */ public SimpleColorDialog allowCustom(boolean allow){ - return setArg(CUSTOM, allow); + return setArg(CUSTOM, allow && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB); } @Override diff --git a/testApp/build.gradle b/testApp/build.gradle index aac3b57..26a6555 100644 --- a/testApp/build.gradle +++ b/testApp/build.gradle @@ -6,7 +6,7 @@ android { defaultConfig { applicationId "eltos.simpledialogfragments.test" - minSdkVersion 14 + minSdkVersion 9 targetSdkVersion 25 versionCode 21 versionName "2.1" @@ -22,7 +22,8 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:25.1.1' + compile 'com.android.support:appcompat-v7:25.3.1' + compile 'com.android.support:gridlayout-v7:25.3.1' compile 'com.google.zxing:core:3.2.0' compile project(path: ':simpledialogfragment') } diff --git a/testApp/src/main/java/eltos/simpledialogfragments/MainActivity.java b/testApp/src/main/java/eltos/simpledialogfragments/MainActivity.java index 4f8e060..557ffaf 100644 --- a/testApp/src/main/java/eltos/simpledialogfragments/MainActivity.java +++ b/testApp/src/main/java/eltos/simpledialogfragments/MainActivity.java @@ -286,6 +286,10 @@ public void showColorPicker(View view){ public void showHsvWheel(View view){ + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + Toast.makeText(this, "Not supported on Gingebread", Toast.LENGTH_SHORT).show(); + return; + } SimpleColorWheelDialog.build() .color(color) diff --git a/testApp/src/main/res/layout/activity_main.xml b/testApp/src/main/res/layout/activity_main.xml index 3a76495..ba87094 100644 --- a/testApp/src/main/res/layout/activity_main.xml +++ b/testApp/src/main/res/layout/activity_main.xml @@ -1,10 +1,10 @@ + xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" + tools:context="eltos.simpledialogfragments.MainActivity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/scrollView"> - + app:columnCount="4">