Browse files

Extended support to r7. Added TargetApi annotations for methods that …

…are not supported on 11th.
  • Loading branch information...
1 parent 6ff887e commit 41c96c65444ed070f8e1b3e025cc733356623bba @inazaruk committed Jul 28, 2012
View
2 SearchView/search-view-app/AndroidManifest.xml
@@ -4,7 +4,7 @@
android:versionName="1.0" >
<uses-sdk
- android:minSdkVersion="8"
+ android:minSdkVersion="7"
android:targetSdkVersion="15" />
<application
View
1 SearchView/search-view-app/src/com/inazaruk/searchview/MainActivity.java
@@ -40,6 +40,7 @@ private void addCompatSearch(Menu menu) {
sv.setOnQueryTextListener(this);
sv.setSubmitButtonEnabled(true);
sv.setQueryHint("TEST HINT");
+ sv.setImeOptions(0);
item.setActionView(sv);
}
View
2 SearchView/search-view-lib/AndroidManifest.xml
@@ -4,6 +4,6 @@
android:versionName="1.0" >
<uses-sdk
- android:minSdkVersion="8"
+ android:minSdkVersion="7"
android:targetSdkVersion="15" />
</manifest>
View
7 ...h-view-lib/src/com/actionbarsherlock/widget/searchview/internal/ForwardingSearchView.java
@@ -5,6 +5,7 @@
import com.actionbarsherlock.widget.searchview.OnQueryTextListener;
import com.actionbarsherlock.widget.searchview.OnSuggestionListener;
+import android.annotation.TargetApi;
import android.app.SearchableInfo;
import android.content.Context;
import android.content.res.TypedArray;
@@ -62,21 +63,25 @@ public void setSearchableInfo(SearchableInfo searchable) {
mSearchView.setSearchableInfo(searchable);
}
+ @TargetApi(14)
@Override
public void setImeOptions(int imeOptions) {
mSearchView.setImeOptions(imeOptions);
}
+ @TargetApi(16)
@Override
public int getImeOptions() {
return mSearchView.getImeOptions();
}
+ @TargetApi(14)
@Override
public void setInputType(int inputType) {
mSearchView.setInputType(inputType);
}
+ @TargetApi(16)
@Override
public int getInputType() {
return mSearchView.getInputType();
@@ -122,6 +127,7 @@ public void setQueryHint(CharSequence hint) {
mSearchView.setQueryHint(hint);
}
+ @TargetApi(16)
@Override
public CharSequence getQueryHint() {
return mSearchView.getQueryHint();
@@ -182,6 +188,7 @@ public void setMaxWidth(int maxpixels) {
mSearchView.setMaxWidth(maxpixels);
}
+ @TargetApi(16)
@Override
public int getMaxWidth() {
return mSearchView.getMaxWidth();
View
7 ...iew/search-view-lib/src/com/actionbarsherlock/widget/searchview/internal/ISearchView.java
@@ -5,19 +5,24 @@
import com.actionbarsherlock.widget.searchview.OnQueryTextListener;
import com.actionbarsherlock.widget.searchview.OnSuggestionListener;
+import android.annotation.TargetApi;
import android.app.SearchableInfo;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.widget.CursorAdapter;
public interface ISearchView {
+ @TargetApi(14)
void setImeOptions(int imeOptions);
+ @TargetApi(16)
int getImeOptions();
+ @TargetApi(14)
void setInputType(int inputType);
+ @TargetApi(16)
int getInputType();
CharSequence getQuery();
@@ -26,6 +31,7 @@
void setQueryHint(CharSequence hint);
+ @TargetApi(16)
CharSequence getQueryHint();
void setIconifiedByDefault(boolean iconified);
@@ -50,6 +56,7 @@
void setMaxWidth(int maxpixels);
+ @TargetApi(16)
int getMaxWidth();
void setSearchableInfo(SearchableInfo searchable);

0 comments on commit 41c96c6

Please sign in to comment.