Skip to content

Commit

Permalink
Merge branch 'minSdk9' of git://github.com/mtotschnig/SimpleDialogFra…
Browse files Browse the repository at this point in the history
…gments into mtotschnig-minSdk9
  • Loading branch information
eltos committed Jul 1, 2017
2 parents b6ba7cf + 4bd77bb commit 353b93d
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions testApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {

defaultConfig {
applicationId "eltos.simpledialogfragments.test"
minSdkVersion 14
minSdkVersion 9
targetSdkVersion 25
versionCode 21
versionName "2.1"
Expand All @@ -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')
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 353b93d

Please sign in to comment.