Search in sources :

Example 91 with Spinner

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());
}
Also used : Button(android.widget.Button) Spinner(android.widget.Spinner) TextView(android.widget.TextView) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 92 with Spinner

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);
}
Also used : Spinner(android.widget.Spinner) ArrayAdapter(android.widget.ArrayAdapter)

Example 93 with Spinner

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;
}
Also used : HorizontalScrollView(android.widget.HorizontalScrollView) ScrollView(android.widget.ScrollView) Spinner(android.widget.Spinner) List(java.util.List) AdapterView(android.widget.AdapterView) HorizontalScrollView(android.widget.HorizontalScrollView) ScrollView(android.widget.ScrollView) View(android.view.View) AdapterView(android.widget.AdapterView) HorizontalScrollView(android.widget.HorizontalScrollView)

Example 94 with Spinner

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);
}
Also used : Spinner(android.widget.Spinner) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 95 with Spinner

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);
}
Also used : ProgressBarDrawable(com.facebook.drawee.drawable.ProgressBarDrawable) Spinner(android.widget.Spinner) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) AdapterView(android.widget.AdapterView) CompoundButton(android.widget.CompoundButton) SwitchCompat(android.support.v7.widget.SwitchCompat)

Aggregations

Spinner (android.widget.Spinner)160 View (android.view.View)70 AdapterView (android.widget.AdapterView)58 TextView (android.widget.TextView)51 ArrayAdapter (android.widget.ArrayAdapter)50 LinearLayout (android.widget.LinearLayout)29 EditText (android.widget.EditText)20 Intent (android.content.Intent)19 Button (android.widget.Button)19 RecyclerView (android.support.v7.widget.RecyclerView)18 CompoundButton (android.widget.CompoundButton)16 ViewGroup (android.view.ViewGroup)13 ImageView (android.widget.ImageView)13 DialogInterface (android.content.DialogInterface)12 CheckBox (android.widget.CheckBox)11 ListView (android.widget.ListView)11 ArrayList (java.util.ArrayList)11 AutoCompleteTextView (android.widget.AutoCompleteTextView)9 AlertDialog (android.app.AlertDialog)7 LayoutInflater (android.view.LayoutInflater)7