Eric Kok
12 years ago
10 changed files with 89 additions and 54 deletions
@ -1,16 +1,15 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="match_parent" |
android:layout_height="match_parent" |
||||||
android:paddingTop="@dimen/margin_half" |
android:paddingLeft="@dimen/margin_half" |
||||||
android:paddingBottom="@dimen/margin_half" |
android:paddingRight="@dimen/margin_half" > |
||||||
android:orientation="horizontal" > |
|
||||||
|
|
||||||
<TextView |
<TextView |
||||||
android:id="@+id/separator_text" |
android:id="@+id/separator_text" |
||||||
|
style="@style/SectionHeader" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="wrap_content" |
android:layout_height="wrap_content" |
||||||
android:textIsSelectable="false" |
android:textIsSelectable="false" /> |
||||||
style="@style/SectionHeader" /> |
|
||||||
|
|
||||||
</LinearLayout> |
</FrameLayout> |
@ -0,0 +1,35 @@ |
|||||||
|
package org.transdroid.core.gui.navigation; |
||||||
|
|
||||||
|
import org.androidannotations.annotations.EBean; |
||||||
|
|
||||||
|
import android.view.View; |
||||||
|
import android.view.ViewGroup; |
||||||
|
|
||||||
|
/** |
||||||
|
* List adapter that holds filter items, that is, servers, view types and labels and is displayed as content to a |
||||||
|
* Spinner instead of a ListView. |
||||||
|
* @author Eric Kok |
||||||
|
*/ |
||||||
|
@EBean |
||||||
|
public class FilterListDropDownAdapter extends FilterListAdapter { |
||||||
|
|
||||||
|
@Override |
||||||
|
public View getView(int position, View convertView, ViewGroup parent) { |
||||||
|
// This returns the item shown in the spinner
|
||||||
|
NavigationSelectionView filterItemView; |
||||||
|
if (convertView == null || !(convertView instanceof NavigationSelectionView)) { |
||||||
|
filterItemView = NavigationSelectionView_.build(context).setNavigationFilterManager(navigationFilterManager); |
||||||
|
} else { |
||||||
|
filterItemView = (NavigationSelectionView) convertView; |
||||||
|
} |
||||||
|
filterItemView.bind(); |
||||||
|
return filterItemView; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public View getDropDownView(int position, View convertView, ViewGroup parent) { |
||||||
|
// This returns the item to show in the drop down list
|
||||||
|
return super.getView(position, convertView, parent); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue