Skip to content

Can't programmatically expand the spinner #1

@calhouncole

Description

@calhouncole

I'm looking to expand the spinner without needing to physically touch it. I've tried the following and nothing seems to work:

        toolbar = (Toolbar) findViewById(R.id.toolbar);
        spinner = (MaterialToolbarSpinner)
                toolbar.findViewById(R.id.mt_spinner);
        spinnerAdapter = new ToolbarSpinnerAdapter(this);
        spinnerAdapter.setUserAgencyList(agencies);
        spinner.setAdapter(spinnerAdapter);
        spinner.setOnItemSelectedListener(this);
        spinner.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                
            }
        });

//                    spinner.performClick();
//                    spinner.callOnClick();
//                    spinner.animate();
//                    spinner.notify();
//                    spinner.post(new Runnable() {
//                        @Override
//                        public void run() {
//                            spinner.performClick();
//                        }
//                    });
//                    spinnerAdapter.getDropDownView(0, null, toolbar);
//                    spinnerAdapter.getDownView(0, null, toolbar);
//                    spinner.requestFocus();
//                    toolbar.getFocusedChild().performClick();
//                    toolbar.performClick();

It seems that the spinner's onClick() method is never called when physically tapping the component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions