Search in sources :

Example 36 with Spinner

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

Example 37 with 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) {
        }
    });
}
Also used : Spinner(android.widget.Spinner) AdapterView(android.widget.AdapterView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 38 with Spinner

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();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) Spinner(android.widget.Spinner) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ArrayAdapter(android.widget.ArrayAdapter)

Example 39 with Spinner

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

Example 40 with Spinner

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

Aggregations

Spinner (android.widget.Spinner)418 View (android.view.View)185 AdapterView (android.widget.AdapterView)146 TextView (android.widget.TextView)134 ArrayAdapter (android.widget.ArrayAdapter)132 EditText (android.widget.EditText)67 ArrayList (java.util.ArrayList)49 LinearLayout (android.widget.LinearLayout)48 Intent (android.content.Intent)45 Button (android.widget.Button)45 ImageView (android.widget.ImageView)43 CheckBox (android.widget.CheckBox)42 DialogInterface (android.content.DialogInterface)41 ViewGroup (android.view.ViewGroup)27 CompoundButton (android.widget.CompoundButton)27 RecyclerView (android.support.v7.widget.RecyclerView)26 LayoutInflater (android.view.LayoutInflater)26 ListView (android.widget.ListView)25 Test (org.junit.Test)23 Context (android.content.Context)19