Spinner with Icon and Text like Phone App on Android (with Bluetooth) -


i want re-create following:

enter image description here

specifically, note bluetooth icon, clicking on brings looks spinner? or dialog somehow located correctly? couldn't find phone app code anywhere, , @ loss how best implement this.

i figured out solution shortly after posting question.

the correct solution use popupwindow. here pretty need do:

    layoutinflater layoutinflater             = (layoutinflater)getbasecontext()             .getsystemservice(layout_inflater_service);     view popupview = layoutinflater.inflate(r.layout.bluetooth_popup, null);      popupview.findviewbyid(r.id.bluetooth).setonclicklistener(this);     popupview.findviewbyid(r.id.speakerphone).setonclicklistener(this);     popupview.findviewbyid(r.id.earpiece).setonclicklistener(this);      popupwindow = new popupwindow(             popupview,             viewgroup.layoutparams.wrap_content,             viewgroup.layoutparams.wrap_content);      // these 2 allow popupwindow dismissed when touch occurs outside     popupwindow.setbackgrounddrawable(new bitmapdrawable());     popupwindow.setoutsidetouchable(true); 

and show anchored view:

popupwindow.showasdropdown(speaker, 0, (int) (-160)); 

hope helps out.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -