use of android.widget.Spinner in project platform_frameworks_base by android.
the class ScrollingTabContainerView method createSpinner.
private Spinner createSpinner() {
final Spinner spinner = new Spinner(getContext(), null, com.android.internal.R.attr.actionDropDownStyle);
spinner.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT));
spinner.setOnItemClickListenerInt(this);
return spinner;
}
use of android.widget.Spinner in project syncthing-android by syncthing.
the class VersioningDialogActivity method initiateSpinner.
private void initiateSpinner() {
Spinner versioningTypeSpinner = findViewById(R.id.versioningTypeSpinner);
versioningTypeSpinner.setSelection(mTypes.indexOf(getIntent().getExtras().getString("type")));
versioningTypeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (position != mTypes.indexOf(getIntent().getExtras().getString("type"))) {
updateVersioningType(position);
updateFragmentView(position);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
use of android.widget.Spinner in project DVECTN by tanaponudom.
the class Fragment_bt_ag method showCustomDialog.
private void showCustomDialog(final String member_id, String detail, String url) {
// คะแนน
String[] DataSp = { "-", "0", "1", "2", "3" };
AlertDialog.Builder builder = new AlertDialog.Builder(context);
LayoutInflater layoutInflater = LayoutInflater.from(context);
View handleView = layoutInflater.inflate(R.layout.custom_layout_dialog, null);
TextView tv_detail = handleView.findViewById(R.id.tv_detail);
ImageView imageView = handleView.findViewById(R.id.img);
final Spinner spinner = handleView.findViewById(R.id.spScore);
// set detail
tv_detail.setText(detail);
// set image from url
Picasso.with(context).load(url).into(imageView);
ArrayAdapter adt = new ArrayAdapter(context, android.R.layout.simple_spinner_dropdown_item, DataSp);
spinner.setAdapter(adt);
builder.setTitle("ดูรายละเอียด");
builder.setView(handleView);
builder.setPositiveButton("อนุมัติ", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Toast.makeText(context, "อนุมัติ member_id = " + member_id, Toast.LENGTH_SHORT).show();
}
});
builder.setNegativeButton("ไม่อนุมัติ", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Toast.makeText(context, "ไม่อนุมัติ member_id = " + member_id, Toast.LENGTH_SHORT).show();
}
});
builder.show();
}
use of android.widget.Spinner in project android_frameworks_base by crdroidandroid.
the class PopupWindowVisibility method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.popup_window_visibility);
mFrame = findViewById(R.id.frame);
mHide = (Button) findViewById(R.id.hide);
mHide.setOnClickListener(this);
mShow = (Button) findViewById(R.id.show);
mShow.setOnClickListener(this);
Spinner spinner = (Spinner) findViewById(R.id.spinner);
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mStrings);
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(spinnerAdapter);
ArrayAdapter<String> autoAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES);
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.auto);
textView.setAdapter(autoAdapter);
}
use of android.widget.Spinner in project android_frameworks_base by crdroidandroid.
the class ScrollingTabContainerView method createSpinner.
private Spinner createSpinner() {
final Spinner spinner = new Spinner(getContext(), null, com.android.internal.R.attr.actionDropDownStyle);
spinner.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT));
spinner.setOnItemClickListenerInt(this);
return spinner;
}
Aggregations