use of org.holoeverywhere.widget.Spinner in project HoloEverywhere by Prototik.
the class ActionBarView method setNavigationMode.
public void setNavigationMode(int mode) {
final int oldMode = mNavigationMode;
if (mode != oldMode) {
switch(oldMode) {
case ActionBar.NAVIGATION_MODE_LIST:
if (mListNavLayout != null) {
removeView(mListNavLayout);
}
break;
case ActionBar.NAVIGATION_MODE_TABS:
if (mTabScrollView != null && mIncludeTabs) {
removeView(mTabScrollView);
}
}
switch(mode) {
case ActionBar.NAVIGATION_MODE_LIST:
if (mSpinner == null) {
mSpinner = new Spinner(mContext, null, R.attr.actionDropDownStyle);
mListNavLayout = (LinearLayout) LayoutInflater.from(mContext).inflate(R.layout.abc_action_bar_view_list_nav_layout, null);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT);
params.gravity = Gravity.CENTER;
mListNavLayout.addView(mSpinner, params);
}
if (mSpinner.getAdapter() != mSpinnerAdapter) {
mSpinner.setAdapter(mSpinnerAdapter);
}
mSpinner.setOnItemSelectedListener(mNavItemSelectedListener);
addView(mListNavLayout);
break;
case ActionBar.NAVIGATION_MODE_TABS:
if (mTabScrollView != null && mIncludeTabs) {
addView(mTabScrollView);
}
break;
}
mNavigationMode = mode;
requestLayout();
}
}
use of org.holoeverywhere.widget.Spinner in project HoloEverywhere by Prototik.
the class ScrollingTabContainerView method createSpinner.
private Spinner createSpinner() {
final Spinner spinner = new Spinner(getContext(), null, R.attr.actionDropDownStyle);
spinner.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.FILL_PARENT));
spinner.internalSetOnItemClickListener(this);
return spinner;
}
Aggregations