Git Product home page Git Product logo

Comments (8)

oubowu avatar oubowu commented on June 16, 2024

什么意思?不是很清楚你的描述,能具体点吗?

from pinnedsectionitemdecoration.

oubowu avatar oubowu commented on June 16, 2024

@panda912

from pinnedsectionitemdecoration.

panda912 avatar panda912 commented on June 16, 2024

就是SecondActivity,第一个小标签点击没反应,我试过好多次,第一个点击事件是肯定没反应的,其他的小标签,有时候点击会触发,有时候触发不了 @oubowu

from pinnedsectionitemdecoration.

oubowu avatar oubowu commented on June 16, 2024

原因很简单,mRecyclerView.addItemDecoration(new SmallPinnedHeaderItemDecoration.Builder(R.id.iv_small_pinned_header, BaseHeaderAdapter.TYPE_HEADER).enableDivider(true) .setDividerId(R.drawable.divider).disableHeaderClick(true).setClickIds(R.id.iv_small_pinned_header).setHeaderClickListener(headerClickAdapter).create());
disableHeaderClick(true),我把点击头部禁用了啊

from pinnedsectionitemdecoration.

oubowu avatar oubowu commented on June 16, 2024

我推了下代码,开启了点击,你再看看 @panda912

from pinnedsectionitemdecoration.

panda912 avatar panda912 commented on June 16, 2024

@oubowu
1.好吧,我没有注意到disableHeaderClick,个人感觉setHeaderClickListenerdisableHeaderClick是不是重复了,关掉点击事件直接setHeaderClickListener(null)就好了;
2.我刚才的代码就是disableHeaderClick(true),但是还是有的小标签可以点击,是什么情况呢?

from pinnedsectionitemdecoration.

oubowu avatar oubowu commented on June 16, 2024

因为除了头部那个,其余的都是正常的布局的View来的,粘性头部的原理是在头部绘制出跟那些View一样的布局,它的点击事件啥的是我单独处理的,也就是说其余的小标签是在adapter那里处理的,只有顶部粘性头部是itemdecration处理的

from pinnedsectionitemdecoration.

oubowu avatar oubowu commented on June 16, 2024

disableHeaderClick刚开始我只是想禁掉整个标签的点击事件,不包括里面的子控件,后来想想没必要,名字也有歧义,所以就是把整个标签和其子控件都禁止掉,现在看来确实是重复了 @panda912

from pinnedsectionitemdecoration.

Related Issues (20)

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.