Java Code Examples for android.widget.AbsSpinner

The following are top voted examples for showing how to use android.widget.AbsSpinner. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: talkback   File: AccessibilityNodeInfoUtils.java   View source code 5 votes vote down vote up
@Override
public boolean accept(AccessibilityNodeInfoCompat node) {
    if (node.isScrollable()) {
        return nodeMatchesAnyClassByType(node,
                AbsListView.class, AbsSpinner.class, ScrollView.class,
                HorizontalScrollView.class, CLASS_TOUCHWIZ_TWABSLISTVIEW) ||
                nodeMatchesClassByName(node, CLASS_RECYCLER_VIEW_CLASS_NAME);
    }

    return false;
}
 
Example 2
Project: itsnat_droid   File: AttrDescView_widget_ListViewAndAbsSpinner_entries.java   View source code 5 votes vote down vote up
@Override
public void setAttribute(View view, DOMAttr attr, AttrLayoutContext attrCtx)
{
    CharSequence[] entries = getTextArray(attr.getResourceDesc(),attrCtx.getXMLInflaterContext());

    ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(attrCtx.getContext(), android.R.layout.simple_list_item_1, entries);
    if (view instanceof ListView)
        ((ListView)view).setAdapter(adapter);
    else if (view instanceof AbsSpinner)
        ((AbsSpinner)view).setAdapter(adapter);
}
 
Example 3
Project: FullRobolectricTestSample   File: ShadowAbsSpinner.java   View source code 5 votes vote down vote up
@Implementation
public void setSelection(int position) {
  directlyOn(realAbsSpinner, AbsSpinner.class, "setSelection", int.class).invoke(position);
  SpinnerAdapter adapter = realAbsSpinner.getAdapter();
  if (getItemSelectedListener() != null && adapter != null) {
    getItemSelectedListener().onItemSelected(realAbsSpinner, null, position, adapter.getItemId(position));
  }
}
 
Example 4
Project: SimpleMediaScanner   File: ScheduleFragment.java   View source code 5 votes vote down vote up
public DailyRadioOnCheckedChangeListener(Context context,
                                         AbsSpinner hourSpinner) {
    mContext = context;
    mHourSpinner = hourSpinner;
    mEnableProc = new EnableProc();
    mDisableProc = new DisableProc();
}
 
Example 5
Project: SimpleMediaScanner   File: ScheduleFragment.java   View source code 5 votes vote down vote up
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Context context = getActivity();
    mHourAdapter = makeIntegerAdapter(context, 24);

    String name = Context.LAYOUT_INFLATER_SERVICE;
    Object service = context.getSystemService(name);
    LayoutInflater inflater = (LayoutInflater)service;
    View view = inflater.inflate(R.layout.fragment_schedule, null);
    mHourSpinner = (AbsSpinner)view.findViewById(R.id.hour_spinner);
    mHourSpinner.setAdapter(mHourAdapter);
    mMinuteSpinner = (AbsSpinner)view.findViewById(R.id.minute_spinner);
    initializeSpinner(context, mMinuteSpinner, 60);
    mDailyRadio = (CompoundButton)view.findViewById(R.id.daily_radio);
    mDailyRadio.setChecked(true);
    CompoundButton.OnCheckedChangeListener l;
    l = new DailyRadioOnCheckedChangeListener(context, mHourSpinner);
    mDailyRadio.setOnCheckedChangeListener(l);

    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setNegativeButton(R.string.negative,
                              new NegativeButtonOnClickListener());
    builder.setPositiveButton(R.string.positive,
                              new PositiveButtonOnClickListener());
    builder.setTitle("New schedule");
    builder.setView(view);

    return builder.create();
}
 
Example 6
Project: AndroidViewHelper   File: AbsSpinnerHelper.java   View source code 4 votes vote down vote up
public AbsSpinnerHelper(AbsSpinner view) {
    super(view);
}
 
Example 7
Project: AndroidViewHelper   File: AbsSpinnerHelper.java   View source code 4 votes vote down vote up
public AbsSpinner getView(){
return mView;
}
 
Example 8
Project: AndroidViewHelper   File: AbsSpinnerWrapper.java   View source code 4 votes vote down vote up
public AbsSpinnerWrapper(AbsSpinner view) {
    super(view);
    mView = view;
}
 
Example 9
Project: AndroidViewHelper   File: AndroidViewHelper.java   View source code 4 votes vote down vote up
public static AbsSpinnerHelper absSpinner(@NonNull Activity activity, @IdRes int viewId) {
    return new AbsSpinnerHelper((AbsSpinner) findView(activity, viewId));
}
 
Example 10
Project: AndroidViewHelper   File: AndroidViewHelper.java   View source code 4 votes vote down vote up
public static AbsSpinnerHelper absSpinner(@NonNull View view, @IdRes int viewId) {
    return new AbsSpinnerHelper((AbsSpinner) findView(view, viewId));
}
 
Example 11
Project: FullRobolectricTestSample   File: ShadowAbsSpinner.java   View source code 4 votes vote down vote up
@Implementation
public void setSelection(int position, boolean animate) {
  directlyOn(realAbsSpinner, AbsSpinner.class, "setSelection", int.class, boolean.class)
      .invoke(position, animate);
  animatedTransition = animate;
}
 
Example 12
Project: 12306-android-Decompile   File: Logger.java   View source code 4 votes vote down vote up
private String getTlType(Object paramObject)
{
  String str = "";
  if ((paramObject instanceof ToggleButton))
    str = "toggleButton";
  do
  {
    return str;
    if ((paramObject instanceof RadioButton))
      return "radioButton";
    if ((paramObject instanceof CheckBox))
      return "checkBox";
    if ((paramObject instanceof Button))
      return "button";
    if ((paramObject instanceof DatePicker))
      return "datePicker";
    if ((paramObject instanceof Scroller))
      return "scroll";
    if ((paramObject instanceof HorizontalScrollView))
      return "scroll";
    if ((paramObject instanceof ScrollView))
      return "scroll";
    if ((paramObject instanceof DialerFilter))
      return "dialerFilter";
    if ((paramObject instanceof ProgressBar))
      return "slider";
    if ((paramObject instanceof RadioGroup))
      return "radioButton";
    if ((paramObject instanceof Gallery))
      return "gallery";
    if ((paramObject instanceof AbsSpinner))
      return "selectList";
    if ((paramObject instanceof TabHost))
      return "tabContainer";
    if ((paramObject instanceof TabWidget))
      return "tabBar";
    if ((paramObject instanceof TextView))
      return "textBox";
    if ((paramObject instanceof TimePicker))
      return "timePicker";
    if ((paramObject instanceof Canvas))
      return "view";
    if ((paramObject instanceof ImageSwitcher))
      return "imageSwitcher";
    if ((paramObject instanceof Activity))
      return "page";
    if ((paramObject instanceof TabHost.TabSpec))
      return "tabBarItem";
  }
  while (!(paramObject instanceof WebView));
  return "webView";
}
 
Example 13
Project: 12306-android-Decompile   File: Logger.java   View source code 4 votes vote down vote up
private String getTlType(Object paramObject)
{
  String str = "";
  if ((paramObject instanceof ToggleButton))
    str = "toggleButton";
  do
  {
    return str;
    if ((paramObject instanceof RadioButton))
      return "radioButton";
    if ((paramObject instanceof CheckBox))
      return "checkBox";
    if ((paramObject instanceof Button))
      return "button";
    if ((paramObject instanceof DatePicker))
      return "datePicker";
    if ((paramObject instanceof Scroller))
      return "scroll";
    if ((paramObject instanceof HorizontalScrollView))
      return "scroll";
    if ((paramObject instanceof ScrollView))
      return "scroll";
    if ((paramObject instanceof DialerFilter))
      return "dialerFilter";
    if ((paramObject instanceof ProgressBar))
      return "slider";
    if ((paramObject instanceof RadioGroup))
      return "radioButton";
    if ((paramObject instanceof Gallery))
      return "gallery";
    if ((paramObject instanceof AbsSpinner))
      return "selectList";
    if ((paramObject instanceof TabHost))
      return "tabContainer";
    if ((paramObject instanceof TabWidget))
      return "tabBar";
    if ((paramObject instanceof TextView))
      return "textBox";
    if ((paramObject instanceof TimePicker))
      return "timePicker";
    if ((paramObject instanceof Canvas))
      return "view";
    if ((paramObject instanceof ImageSwitcher))
      return "imageSwitcher";
    if ((paramObject instanceof Activity))
      return "page";
    if ((paramObject instanceof TabHost.TabSpec))
      return "tabBarItem";
  }
  while (!(paramObject instanceof WebView));
  return "webView";
}
 
Example 14
Project: assertj-android   File: AbsSpinnerAssert.java   View source code 4 votes vote down vote up
public AbsSpinnerAssert(AbsSpinner actual) {
  super(actual, AbsSpinnerAssert.class);
}