@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; }
@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); }
@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)); } }
public DailyRadioOnCheckedChangeListener(Context context, AbsSpinner hourSpinner) { mContext = context; mHourSpinner = hourSpinner; mEnableProc = new EnableProc(); mDisableProc = new DisableProc(); }
@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(); }
public AbsSpinnerHelper(AbsSpinner view) { super(view); }
public AbsSpinner getView(){ return mView; }
public AbsSpinnerWrapper(AbsSpinner view) { super(view); mView = view; }
public static AbsSpinnerHelper absSpinner(@NonNull Activity activity, @IdRes int viewId) { return new AbsSpinnerHelper((AbsSpinner) findView(activity, viewId)); }
public static AbsSpinnerHelper absSpinner(@NonNull View view, @IdRes int viewId) { return new AbsSpinnerHelper((AbsSpinner) findView(view, viewId)); }
@Implementation public void setSelection(int position, boolean animate) { directlyOn(realAbsSpinner, AbsSpinner.class, "setSelection", int.class, boolean.class) .invoke(position, animate); animatedTransition = animate; }
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"; }
public AbsSpinnerAssert(AbsSpinner actual) { super(actual, AbsSpinnerAssert.class); }