Skip to content

Method OnViewHolderInflated Added

Compare
Choose a tag to compare
@ahmedrizwan ahmedrizwan released this 14 Dec 03:56
· 47 commits to master since this release

Added method setOnViewHolderInflated for RxAdapter and RxAdapterForTypes
For example, if you want to change the height of an item dynamically based on viewType - code will be

rxAdapterForTypes.setOnViewHolderInflate(new OnViewHolderInflated() {
            @Override
            public void onInflated(final View view, final ViewGroup parent, final int viewType) {
                if(viewType==1){
                    view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                            parent.getMeasuredHeight()));
                }
            }
});