Search in sources :

Example 6 with SpinnerAdapter

use of android.widget.SpinnerAdapter in project assertj-android by square.

the class AbstractAbsSpinnerAssert method hasAdapter.

public S hasAdapter(SpinnerAdapter adapter) {
    isNotNull();
    SpinnerAdapter actualAdapter = actual.getAdapter();
    //
    Assertions.assertThat(actualAdapter).overridingErrorMessage("Expected adapter <%s> but was <%s>.", adapter, //
    actualAdapter).isSameAs(adapter);
    return myself;
}
Also used : SpinnerAdapter(android.widget.SpinnerAdapter)

Example 7 with SpinnerAdapter

use of android.widget.SpinnerAdapter in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class CustomInputStylePreference method setSpinnerPosition.

private static void setSpinnerPosition(final Spinner spinner, final Object itemToSelect) {
    final SpinnerAdapter adapter = spinner.getAdapter();
    final int count = adapter.getCount();
    for (int i = 0; i < count; i++) {
        final Object item = spinner.getItemAtPosition(i);
        if (item.equals(itemToSelect)) {
            spinner.setSelection(i);
            return;
        }
    }
}
Also used : SpinnerAdapter(android.widget.SpinnerAdapter)

Example 8 with SpinnerAdapter

use of android.widget.SpinnerAdapter in project ListViewAnimations by nhaarman.

the class AppearanceExamplesActivity method onCreate.

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mAdapter = new MyListAdapter(this);
    setAlphaAdapter();
    assert getActionBar() != null;
    getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    getActionBar().setDisplayShowTitleEnabled(false);
    SpinnerAdapter animSelectionAdapter = new AnimSelectionAdapter(this);
    getActionBar().setListNavigationCallbacks(animSelectionAdapter, this);
}
Also used : SpinnerAdapter(android.widget.SpinnerAdapter) MyListAdapter(com.haarman.listviewanimations.MyListAdapter)

Example 9 with SpinnerAdapter

use of android.widget.SpinnerAdapter in project weiciyuan by qii.

the class BlackMagicActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.blackmagicactivity_layout);
    getActionBar().setDisplayHomeAsUpEnabled(false);
    getActionBar().setDisplayShowHomeEnabled(false);
    getActionBar().setTitle(getString(R.string.hack_login));
    username = (EditText) findViewById(R.id.username);
    password = (EditText) findViewById(R.id.password);
    spinner = (Spinner) findViewById(R.id.spinner);
    SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this, R.array.tail, android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(mSpinnerAdapter);
    spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            String[] array = getResources().getStringArray(R.array.tail_value);
            String value = array[position];
            appkey = value.substring(0, value.indexOf(","));
            appSecret = value.substring(value.indexOf(",") + 1);
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {
        }
    });
}
Also used : SpinnerAdapter(android.widget.SpinnerAdapter) AdapterView(android.widget.AdapterView) View(android.view.View) AdapterView(android.widget.AdapterView)

Aggregations

SpinnerAdapter (android.widget.SpinnerAdapter)9 View (android.view.View)2 AdapterView (android.widget.AdapterView)2 DataSetObserver (android.database.DataSetObserver)1 Bundle (android.os.Bundle)1 ViewGroup (android.view.ViewGroup)1 Spinner (android.widget.Spinner)1 ActionBar (com.actionbarsherlock.app.ActionBar)1 MyListAdapter (com.haarman.listviewanimations.MyListAdapter)1 AdultCategoryWrapFragment (io.recom.howabout.category.adult.fragment.AdultCategoryWrapFragment)1 MusicCategoryWrapFragment (io.recom.howabout.category.music.fragment.MusicCategoryWrapFragment)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 Implementation (org.robolectric.annotation.Implementation)1