您好,欢迎光临本网站![请登录][注册会员]  
文件名称: FocusLayoutManager-有焦点item的水平/垂直滚动RecyclerView-LayoutManager。仿Android豆瓣书影音“推荐“频道列表布局.zip
  所属分类: 其它
  开发工具:
  文件大小: 22mb
  下载次数: 0
  上传时间: 2019-09-23
  提 供 者: weixin_********
 详细说明: 有焦点item的水平/垂直滚动RecyclerView-LayoutManager。仿Android豆瓣书影音“推荐“频道列表布局效果截图: GIF:  可自己监听滚动编写效果,如修改成仿MacOS文件浏览: 依赖api com.ccy:FocusLayoutManager:1.0.1 // (or implementation)使用focusLayoutManager =                 new FocusLayoutManager.Builder()                         .layerPadding(dp2px(this, 14))                         .norm alViewGap(dp2px(this, 14))                         .focusOrientation(FocusLayoutManager.FOCUS_LEFT)                         .isAutoSelect(true)                         .maxLayerCount(3)                         .setOnFocusChangeListener(new FocusLayoutManager.OnFocusChangeListener() {                             Override                             public void onFocusChanged(int focusdPosition, int lastFocusdPosition) {                                                              }                         })                         .build(); recyclerView.setLayoutManager(focusLayoutManager);各属性意义见图: 注意:因为item在不同区域随着滑动会有不同的缩放,所以实际layerPadding、normalViewGap会被缩放计算。调整动画效果:new FocusLayoutManager.Builder()                         ......                         .setSimpleTrasitionListener(new FocusLayoutManager.SimpleTrasitionListener() {                              Override                             public float getLayerViewMaxAlpha(int maxLayerCount) {                                 return super.getLayerViewMaxAlpha(maxLayerCount);                             }                             Override                             public float getLayerViewMinAlpha(int maxLayerCount) {                                 return super.getLayerViewMinAlpha(maxLayerCount);                             }                             Override                             public float getLayerChangeRangePercent() {                                 return super.getLayerChangeRangePercent();                             }                             //and more                                                          //更多可重写方法和释义见接口声明                         })                         .build();自定义动画/滚动监听:如果你想在滑动时不仅仅改变item的大小、透明度,你有更多的想法,可以监听TrasitionListener,该监听暴露了很多关键布局数据,......             .setSimpleTrasitionListener(null) //如果默认动画不想要,移除之。or use removeTrasitionlistener(XXX)              .addTrasitionListener(new FocusLayoutManager.TrasitionListener() {                             Override                             public void handleLayerView(FocusLayoutManager focusLayoutManager,                                                         View view, int viewLayer,                                                         int maxLayerCount, int position,                                                         float fraction, float offset) {                                                              }                             Override                             public void handleFocusingView(FocusLayoutManager focusLayoutManager,                                                            View view, int position,                                                            float fraction, float offset) {                             }                             Override                             public void handleNormalView(FocusLayoutManager focusLayoutManager, View view, int position, float fraction, float offset) {                             }                         })各参数意义见接口注释。 实际上SimpleTrasitionListener内部就会被转为TrasitionListener。可参考转换类是怎么做的:TrasitionListenerConvert源码解析https://blog.csdn.net/ccy0122/article/details/90515386
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索:
 输入关键字,在本站1000多万海量源码库中尽情搜索: