Skip to content

Commit

Permalink
Re-add setSelection to list popup window.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Apr 15, 2013
1 parent a41c1c3 commit d372f63
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
16 changes: 8 additions & 8 deletions actionbarsherlock-samples/known-bugs/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,13 @@
<category android:name="com.actionbarsherlock.sample.knownbugs.OPEN"/>
</intent-filter>
</activity>

<activity android:label="Issue #738" android:name=".Issue738">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="com.actionbarsherlock.sample.knownbugs.OPEN"/>
</intent-filter>
</activity>

<activity android:label="Issue #882" android:name=".Issue882">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="com.actionbarsherlock.sample.knownbugs.OPEN"/>
</intent-filter>
</activity>

<!-- CLOSED BUGS -->

Expand Down Expand Up @@ -86,5 +79,12 @@
<provider android:name=".Issue659SuggestionsProvider"
android:authorities="com.actionbarsherlock.sample.knownbugs.Issue659SuggestionsProvider" />

<activity android:label="Issue #882" android:name=".Issue882">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="com.actionbarsherlock.sample.knownbugs.CLOSED"/>
</intent-filter>
</activity>

</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,23 @@ public void setInputMethodMode(int mode) {
mPopup.setInputMethodMode(mode);
}

/**
* Set the selected position of the list.
* Only valid when {@link #isShowing()} == {@code true}.
*
* @param position List position to set as selected.
*/
public void setSelection(int position) {
DropDownListView list = mDropDownList;
if (isShowing() && list != null) {
list.mListSelectionHidden = false;
list.setSelection(position);
if (list.getChoiceMode() != ListView.CHOICE_MODE_NONE) {
list.setItemChecked(position, true);
}
}
}

public void clearListSelection() {
final DropDownListView list = mDropDownList;
if (list != null) {
Expand Down

0 comments on commit d372f63

Please sign in to comment.