use of android.widget.Spinner in project standup-timer by jwood.
the class ConfigureStandupTimerTest method test_state_is_saved_when_timer_is_started.
@MediumTest
public void test_state_is_saved_when_timer_is_started() {
TextView t = (TextView) a.findViewById(R.id.num_participants);
t.setText("13");
Spinner s = a.getMeetingLengthSpinner();
s.setSelection(2);
Spinner s2 = (Spinner) a.findViewById(R.id.team_names);
s2.setSelection(0);
Button b = (Button) a.findViewById(R.id.start_button);
b.performClick();
a.loadState();
assertEquals(13, a.getNumParticipants());
assertEquals(15, a.getMeetingLength());
assertEquals(0, a.getTeamNamesPos());
}
use of android.widget.Spinner in project cw-advandroid by commonsguy.
the class ContactSpinners method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
initListAdapters();
Spinner spin = (Spinner) findViewById(R.id.spinner);
spin.setOnItemSelectedListener(this);
ArrayAdapter<String> aa = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, options);
aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spin.setAdapter(aa);
}
use of android.widget.Spinner in project stetho by facebook.
the class AccessibilityUtil method isTopLevelScrollItem.
/**
* Determines whether the provided {@link View} and {@link AccessibilityNodeInfoCompat} is a
* top-level item in a scrollable container.
*
* @param view The {@link View} to evaluate
* @param node The {@link AccessibilityNodeInfoCompat} to evaluate
* @return {@code true} if it is a top-level item in a scrollable container.
*/
public static boolean isTopLevelScrollItem(@Nullable AccessibilityNodeInfoCompat node, @Nullable View view) {
if (node == null || view == null) {
return false;
}
View parent = (View) ViewCompat.getParentForAccessibility(view);
if (parent == null) {
return false;
}
if (node.isScrollable()) {
return true;
}
List actionList = node.getActionList();
if (actionList.contains(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD) || actionList.contains(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD)) {
return true;
}
// containers, but Spinner is a special case.
if (parent instanceof Spinner) {
return false;
}
return parent instanceof AdapterView || parent instanceof ScrollView || parent instanceof HorizontalScrollView;
}
use of android.widget.Spinner in project fresco by facebook.
the class DraweeRotationFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
mSimpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
final Spinner spinner = (Spinner) view.findViewById(R.id.spinner);
final SimpleRotationOptionsAdapter adapter = new SimpleRotationOptionsAdapter();
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
final SimpleRotationOptionsAdapter.Entry spinnerEntry = (SimpleRotationOptionsAdapter.Entry) adapter.getItem(position);
setRotationOptions(spinnerEntry.rotationOptions);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
spinner.setSelection(0);
}
use of android.widget.Spinner in project fresco by facebook.
the class ImageFormatProgressiveJpegFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
ProgressBarDrawable progressBarDrawable = new ProgressBarDrawable();
progressBarDrawable.setColor(getResources().getColor(R.color.progress_bar_color));
progressBarDrawable.setBackgroundColor(getResources().getColor(R.color.progress_bar_background));
mSimpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
mSimpleDraweeView.getHierarchy().setProgressBarImage(progressBarDrawable);
mDebugOutput = (TextView) view.findViewById(R.id.debug_output);
mDebugOutputScrollView = (ScrollView) view.findViewById(R.id.debug_output_scroll_view);
final SwitchCompat switchProgressiveRenderingEnabled = (SwitchCompat) view.findViewById(R.id.switch_progressive_enabled);
switchProgressiveRenderingEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mProgressiveRenderingEnabled = isChecked;
}
});
mProgressiveRenderingEnabled = switchProgressiveRenderingEnabled.isChecked();
final Spinner spinner = (Spinner) view.findViewById(R.id.spinner);
spinner.setAdapter(new SimpleUriListAdapter());
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
final Entry spinnerEntry = SPINNER_ENTRIES[spinner.getSelectedItemPosition()];
setImageUri(spinnerEntry.uri);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
spinner.setSelection(0);
}
Aggregations