public void setDropdownSelectedPosition(int position) { mSpinner.setSelection(position); }
public void setDropdownSelectedPosition(int position) { mSpinner.setSelection(position); }
public void onClick(DialogInterface dialog, int which) { setSelection(which); dialog.dismiss(); }
public void onClick(DialogInterface dialog, int which) { setSelection(which); dialog.dismiss(); }
@SuppressWarnings("rawtypes") public void onItemClick(AdapterView parent, View v, int position, long id) { IcsSpinner.this.setSelection(position); dismiss(); } });
@SuppressWarnings("rawtypes") public void onItemClick(AdapterView parent, View v, int position, long id) { IcsSpinner.this.setSelection(position); dismiss(); } });
private void performCollapse() { if (isCollapsed()) return; if (mTabSpinner == null) { mTabSpinner = createSpinner(); } removeView(mTabLayout); addView(mTabSpinner, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT)); if (mTabSpinner.getAdapter() == null) { mTabSpinner.setAdapter(new TabAdapter()); } if (mTabSelector != null) { removeCallbacks(mTabSelector); mTabSelector = null; } mTabSpinner.setSelection(mSelectedTabIndex); }
private void performCollapse() { if (isCollapsed()) return; if (mTabSpinner == null) { mTabSpinner = createSpinner(); } removeView(mTabLayout); addView(mTabSpinner, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT)); if (mTabSpinner.getAdapter() == null) { mTabSpinner.setAdapter(new TabAdapter()); } if (mTabSelector != null) { removeCallbacks(mTabSelector); mTabSelector = null; } mTabSpinner.setSelection(mSelectedTabIndex); }
@Override public void show() { final int spinnerPaddingLeft = IcsSpinner.this.getPaddingLeft(); if (mDropDownWidth == WRAP_CONTENT) { final int spinnerWidth = IcsSpinner.this.getWidth(); final int spinnerPaddingRight = IcsSpinner.this.getPaddingRight(); setContentWidth(Math.max( measureContentWidth((SpinnerAdapter) mAdapter, getBackground()), spinnerWidth - spinnerPaddingLeft - spinnerPaddingRight)); } else if (mDropDownWidth == MATCH_PARENT) { final int spinnerWidth = IcsSpinner.this.getWidth(); final int spinnerPaddingRight = IcsSpinner.this.getPaddingRight(); setContentWidth(spinnerWidth - spinnerPaddingLeft - spinnerPaddingRight); } else { setContentWidth(mDropDownWidth); } final Drawable background = getBackground(); int bgOffset = 0; if (background != null) { background.getPadding(mTempRect); bgOffset = -mTempRect.left; } setHorizontalOffset(bgOffset + spinnerPaddingLeft); setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); super.show(); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); setSelection(IcsSpinner.this.getSelectedItemPosition()); } }