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;
}
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;
}
}
}
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);
}
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) {
}
});
}
Aggregations