Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated interface ItemProvideTag; Replace reflections with native method; Improve item click event handling #2140

Merged
merged 2 commits into from
Apr 12, 2018

Conversation

chaychan
Copy link
Contributor

BaseItemProvider adds support for annotation or override methods return viewType and layout;
Handle the item click event by setting onItemClickListener,
If onItemClickListener is not set then it will be called back to ItemProvdier's onClick method, then the class can override this method to handle the click event

…mClickListener回调的问题,如有设置onItemClickListener则不回调到itemProvider的onClick方法中,长按事件如同
@chaychan
Copy link
Contributor Author

chaychan commented Apr 11, 2018

@AllenCoder 一直以为pull request的description英文到时整合就会有,原来整合后用的是我commit的log,我commit写的是中文,sorry,下次会注意了。

@AllenCoder
Copy link
Collaborator

目前还需要完善

@AllenCoder
Copy link
Collaborator

#2139

2.Replace reflections with native method;
3.Improve item click event handling
@chaychan chaychan changed the title BaseItemProvider adds support for annotation or override methods return viewType and layout; Handle the item click event by setting onItemClickListener, If onItemClickListener is not set then it will be called back to ItemProvdier's onClick method, then the class can override this method to handle the click event 1.Deprecated interface ItemProvideTag; 2.Replace reflections with native method; 3.Improve item click event handling Apr 12, 2018
@chaychan chaychan changed the title 1.Deprecated interface ItemProvideTag; 2.Replace reflections with native method; 3.Improve item click event handling Deprecated interface ItemProvideTag; Replace reflections with native method; Improve item click event handling Apr 12, 2018
@chaychan
Copy link
Contributor Author

@AllenCoder BaseItemProvider
已经去除注解方法,通过实现方法返回对应的viewType和layout;

点击事件可以通过设置onItemClickListener回调中处理,如果用户想在不同ItemProvider中实现不同的点击处理,则在对应的ItemProvider中重写onClick()方法,长按事件的处理也是如此。

之前ItemProvider中onClick()和onLongClick()为必须实现的方法,现在改成如果用户需要则重写该方法,这样合理一些了。

@AllenCoder AllenCoder merged commit e1c2217 into CymChad:master Apr 12, 2018
@AllenCoder
Copy link
Collaborator

目前点击事件只是支持item的点击和长按事件,itemchild的点击和长按还是不支持的。
所以,如果有itemchild的点击需求,还是需要在adapter里面实现。

@chaychan
Copy link
Contributor Author

如果是ItemChild的点击事件的话,用户可以通过helper.getView(id).setOnClickListener,这样也可以处理

@ittianyu
Copy link

什么时候能发新版,在 module 里面不能用注解方式指定 layout

@chaychan
Copy link
Contributor Author

@AllenCoder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants