帮酷LOGO
0 0 评论
  • 显示原文与译文双语对照的内容
文章标签:Recyclerview  linearlayout  线性  回收  
ItemDecoration for RecyclerView using LinearLayoutManager for Android

  • 源代码名称:RecyclerItemDecoration
  • 源代码网址:http://www.github.com/magiepooh/RecyclerItemDecoration
  • RecyclerItemDecoration源代码文档
  • RecyclerItemDecoration源代码下载
  • Git URL:
    git://www.github.com/magiepooh/RecyclerItemDecoration.git
  • Git Clone代码到本地:
    git clone http://www.github.com/magiepooh/RecyclerItemDecoration
  • Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/magiepooh/RecyclerItemDecoration
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
  • RecyclerItemDecoration

    DownloadAndroid Arsenal

    RecyclerItemDecoration允许你在recyclerview中的多个项目之间绘制 Divider,而不考虑项的位置 !

    使用不同的recyclerView时,只有一个简单的Divider 或者不同类型的分割符。 当你想在recyclerview项目之间画不同的划分时,你必须考虑项的位置;通常你需要在代码中使用 switch 事件或者语句来声明ItemDecoration的行为。 例如每次项目的位置更改时,都必须重写ItemDecoration的行为。

    你不需要考虑项的位置 ! 你需要关注他们的 ViewType

    图像

    demo_verticaldemo_horizontal

    支持
    • LinearLayoutManager
      • 竖直
      • 水平
      • 水平( 反向)
    Gradle
    
    compile 'com.github.magiepooh:recycler-itemdecoration:1.1.1@aar'
    
    
    
    
    :如何使用
    RecyclerView.ItemDecoration decoration =ItemDecorations.vertical(this)
    . first(R.drawable.shape_decoration_green_h_16)
    . type(DemoViewType.LANDSCAPE_TILE.ordinal(), R.drawable.shape_decoration_cornflower_lilac_h_8)
    . type(DemoViewType.LANDSCAPE_ITEM.ordinal(), R.drawable.shape_decoration_gray_h_12_padding)
    . type(DemoViewType.LANDSCAPE_DESCRIPTION.ordinal(), R.drawable.shape_decoration_red_h_8)
    . last(R.drawable.shape_decoration_flush_orange_h_16)
    . create();
    recyclerView.addItemDecoration(decoration);
    信用许可证
    
    Copyright (C) 2015 magiepooh
    
    
    Copyright (C) 2013 The Android Open Source Project
    
    
    
    Licensed under the Apache License, Version 2.0 (the"License");
    
    
    you may not use this file except in compliance with the License.
    
    
    You may obtain a copy of the License at
    
    
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    
    
    Unless required by applicable law or agreed to in writing, software
    
    
    distributed under the License is distributed on an"AS IS" BASIS,
    
    
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    
    
    See the License for the specific language governing permissions and
    
    
    limitations under the License.
    
    
    
    


    文章标签:线性  回收  Recyclerview  linearlayout  

    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语