From 6126f722ddf91ac7e72e4bf8bf8c240b49a47d71 Mon Sep 17 00:00:00 2001 From: Xiaocong He Date: Wed, 25 Dec 2013 19:42:44 +0800 Subject: [PATCH] fix #22 className/checkable selector bug --- project.properties | 2 +- src/com/github/uiautomatorstub/Selector.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project.properties b/project.properties index ce39f2d..4ab1256 100644 --- a/project.properties +++ b/project.properties @@ -11,4 +11,4 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-18 +target=android-19 diff --git a/src/com/github/uiautomatorstub/Selector.java b/src/com/github/uiautomatorstub/Selector.java index 6b8890f..8ce964d 100644 --- a/src/com/github/uiautomatorstub/Selector.java +++ b/src/com/github/uiautomatorstub/Selector.java @@ -62,11 +62,11 @@ public class Selector { public UiSelector toUiSelector() { UiSelector s = new UiSelector(); if ((getMask() & Selector.MASK_CHECKABLE) > 0 && android.os.Build.VERSION.SDK_INT >= 18) - s = s.clickable(this.isClickable()); + s = s.checkable(this.isCheckable()); if ((getMask() & Selector.MASK_CHECKED) > 0) s = s.checked(isChecked()); - if ((getMask() & Selector.MASK_CLASSNAME) > 0 && android.os.Build.VERSION.SDK_INT >= 17) - s = s.className(getClassName()); + if ((getMask() & Selector.MASK_CLASSNAME) > 0) + s = s.className(getClassName()); // API level 16 should support it.... wrong in Android Java Doc if ((getMask() & Selector.MASK_CLASSNAMEMATCHES) > 0 && android.os.Build.VERSION.SDK_INT >= 17) s = s.classNameMatches(getClassNameMatches()); if ((getMask() & Selector.MASK_CLICKABLE) > 0)