Comments (13)
In my case I try to add onClickListener for spinner and I've got the same problem. I've crated workaround with touch listener:
someSpinner.setOnTouchListener { _, event -> onTouchSomeSpinner(event)}
fun onTouchSomeSpinner(event: MotionEvent): Boolean {
if(event.action == MotionEvent.ACTION_UP) {
view.hideKeyBoard()
view.analyticsEvent()
...
}
return false
}
from dialogplus.
version 1.10
from dialogplus.
can you show the whole implementation of dialogplus?
from dialogplus.
WheelView monthWheel = (WheelView)viewGroup.findViewById(R.id.month_wheel);
//
//
//
monthWheel.setScrollCycle(true);
NumberAdapter monthAdapter = new NumberAdapter(monthArray);
monthWheel.setAdapter(monthAdapter);
monthWheel.setOnItemSelectedListener(mWheelViewListener);
monthWheel.setUnselectedAlpha(0.5f);
monthWheel.setOnItemClickListener(new TosAdapterView.OnItemClickListener() {
@OverRide
public void onItemClick(TosAdapterView<?> tosAdapterView, View view, int i, long l) {
}
});
DialogPlus dialogPlus = DialogPlus.newDialog(getActivity())
.setContentHolder(new ViewHolder(viewGroup))
.setGravity(Gravity.BOTTOM)
.setCancelable(true)
.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(DialogPlus dialogPlus, Object o, View view, int i) {
}
})
.create();
dialogPlus.show();
from dialogplus.
When you use ViewHolder, you can't use OnItemClickListener, if you want to have click events of the individual views, use OnClickListener, or if you already handle it by yourself, just remove all click listeners from dialogplus.
from dialogplus.
yes I have removed all click listeners before. But it throw the exception too.
DialogPlus dialogPlus = DialogPlus.newDialog(getActivity())
.setContentHolder(new ViewHolder(viewGroup))
.setGravity(Gravity.BOTTOM)
.setCancelable(true)
.create();
dialogPlus.show();
from dialogplus.
I think that, when I give a custom viewgroup, the dialogplus also set the click event all children. But when I set a spinner in it. spinner can not set click event. android throw a exception. Can I forbidden the click event?
from dialogplus.
Yes, it seems this is the exact reason and unfortunately there is no this option, but we should add this for these situations. You can only avoid this by creating spinner dynamically, dialogplus adds clicklistener only if the view has an id.
from dialogplus.
oh! may be I can remove the id and try find it by the tag or parent find chid?
from dialogplus.
That could also work but out of box, we already avoid to set clicklistener for adapterview. Need to check thorougly for this issue.
from dialogplus.
ok. I try to remove the id and get it work. Thanks.
from dialogplus.
cheers 👍
from dialogplus.
@wood23636 Can you show me your code,I can't solve it, Thanks.
from dialogplus.
Related Issues (20)
- show view on top above dialog plus
- dismiss dialog and open other dialog error HOT 6
- Open dialog in top of the view but it's not allow me to tap on button
- Why use contentView?
- DatePicker month switch arrows doesn't work
- How to make the this dialog to slide up without fading the screen ? HOT 1
- Blinking after dialog close
- Add property to define if the dialog should request focus or not
- 二级 Dialog 不展示,The second dialog does not show HOT 4
- Display dusnuss of show needs to be optimized 显示关闭逻辑一行优化
- onBackPressed not working when focus on edittext in dialog
- Customization HOT 1
- Dynamically change a popover content
- view's Item null in adapter HOT 1
- textbox settext not updating before dialog load
- Change dialog height dynamically
- setOnItemClickListener is not working
- Multi dialog without dismiss
- Dialogue
- UX on Mode Night HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dialogplus.