Giter Site home page Giter Site logo

xuehuayous / delegationadapter Goto Github PK

View Code? Open in Web Editor NEW
416.0 11.0 69.0 23.62 MB

一种优雅的方式来使用RecyclerView

Home Page: https://blog.csdn.net/xuehuayous/article/details/80021325

License: Apache License 2.0

Kotlin 100.00%
recyclerview

delegationadapter's People

Contributors

wenkaizhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

delegationadapter's Issues

Java source code hava?

I want to see your source code, but it's not written in Java. Can you provide a Java version?

你好,请教一下关于刷新的场景问题

楼主你好,现在我有一个这样的需求
image

1.这个是后台网页拖拽控件,然后移动端生成对应的控件,我想用大佬的这个框架,但是我要刷新指定的某个item,要怎么刷新,比如我现在加了头部 获取到的position的位置就不准了,更新不了集合的数据。比如现在有个item ,点击这个item 要跳到另外一个activity 选择数据,回到当前activity 显示刚刚选择的数据,怎么去记录点击的item的下标。

2.还有一种这种情况, 比如item 里面还有一个子item 我点击子item的一个button按钮 要调起选择图片,对应的activity 要在onActivityResult 监听选择图片的返回,然后图片显示对应的子item 上面, 要怎么把当前点击的item 的子item 的坐标传回activity 让他记录点击的哪一个下标,好更新对应的数据, 不知道我表达的清楚没

还有一点 我感觉这个框架 好像对应纯展示列表的数据,是很好的实现很方便, 但是要增删改查就有点不太好搞了。

列表分组的情况这个可以处理吗

列表分成了多个组,每组含有相同样式的标题,
多次使用delegationAdapter.addHeaderItem,
delegationAdapter.addDataItems()发现无法分组,列表中的内容会集中在一起

数据源不一样的时候?

当主界面的数据源不是一个对象返回的时候,这个数据源就不一样的,如果不去组装这个数据集合的话,有没有好的方式去处理了

关于局部刷新的问题

比如是一个论坛形式的页面,下面是评论区,评论区里面有选项可以选择最热,最新等选项,那么我如何只替换或者刷新下面这部分,调用notifyDataSetChanged()方法之后,页面会跑到最上面。有什么建议或者参考吗?

可否提供一个java版本的最新版

现在遇到个问题:我用的旧版的java版本,在数据编辑模式下,多类型适配,滑动会出现复用的问题,这个不知道在什么地方可以解决

AdapterDelegatesManager getItemViewType抛出异常是什么原因

2021-01-19 19:52:58.645 30541-30541/com.snail.card E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.snail.card, PID: 30541
java.lang.NullPointerException: No AdapterDelegate added that matches position = 3 item = com.snail.card.recommend.entity.RecommendInfo$Data@fdcd028 in data source.
at com.kevin.delegationadapter.AdapterDelegatesManager.getItemViewType(AdapterDelegatesManager.kt:130)
at com.kevin.delegationadapter.AbsDelegationAdapter.getItemViewType(AbsDelegationAdapter.kt:75)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6186)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
at android.view.View.layout(View.java:22160)
at android.view.ViewGroup.layout(ViewGroup.java:6402)
at com.andview.refreshview.XRefreshView.onLayout(XRefreshView.java:365)
at android.view.View.layout(View.java:22160)
at android.view.ViewGroup.layout(ViewGroup.java:6402)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:22160)
at android.view.ViewGroup.layout(ViewGroup.java:6402)
at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
at android.view.View.layout(View.java:22160)
at android.view.ViewGroup.layout(ViewGroup.java:6402)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1103)
at android.view.View.layout(View.java:22160)
at android.view.ViewGroup.layout(ViewGroup.java:6402)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:22160)
at android.view.ViewGroup.layout(ViewGroup.java:6402)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:22160)
at android.view.ViewGroup.layout(ViewGroup.java:6402)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:810)
at android.view.View.layout(View.java:22160)
at android.view.ViewGroup.layout(ViewGroup.java:6402)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3330)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2826)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1901)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8066)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1041)
at android.view.Choreographer.doCallbacks(Choreographer.java:860)
at android.view.Choreographer.doFrame(Choreographer.java:785)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1026)
at android.os.Handler.handleCallback(Handler.java:914)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:225)
at android.app.ActivityThread.main(ActivityThread.java:7563)
at java.lang.reflect.Method.invoke(Native Method)
2021-01-19 19:52:58.646 30541-30541/com.snail.card E/AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)
2021-01-19 19:52:58.676 30541-30541/com.snail.card I/Process: Sending signal. PID: 30541 SIG: 9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.