TransformersLayout

by zaaach

:fire: App金刚区导航菜单,类似淘宝、QQ音乐等APP导航,方格布局横向多行滑动翻页带滚动条

186 Stars 19 Forks Last release: 8 months ago (1.0.5) 24 Commits 5 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Platform Licence API jitpack

TransformersLayout

:fire: APP金刚区导航布局,下方带横向滚动条,很多APP都有使用这种,效果还不错就封装了一下:smile:

整体结构是Recyclerview + 滚动条

Features

  • 每页行数、列数可配置
  • 滚动状态自动恢复
  • 支持数据重新排序,类似viewpager的分页模式
  • item布局样式自定义
  • scrollbar样式可配置

Preview

gif

点击下载APK体验

Install

:mega:项目基于AndroidX构建,参考迁移指南:AndroidX迁移

Step 1: 项目根目录的build.gradle添加如下配置:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2: app添加依赖:

dependencies {
     implementation 'com.github.zaaach:TransformersLayout:x.y.z'
}

记得把

x.y.z
替换为jitpack中的数字

How to use

Step 1: xml布局文件


Step 2: 自定义ViewHolder,第三步需要用到

public class NavAdapterViewHolder extends Holder

Step 3: java代码中调用

List

:smirk:Good luck!!!

支持的attrs属性:

| Attributes | Format | Description | | -------- | ---- | ---- | | tlspanCount | integer | 每页列数,默认5 | | tllines | integer | 每页行数,默认2 | | tlpagingMode | boolean | 分页模式,数据会重新排序,默认false | | tlscrollbarWidth | dimension | reference | scrollbar宽度,默认48dp | | tlscrollbarHeight | dimension | reference | scrollbar高度,默认3dp | | tlscrollbarMarginTop | dimension | reference | scrollbar上间距 | | tlscrollbarRadius | dimension | reference | scrollbar圆角,默认高度的一半 | | tlscrollbarTrackColor | color | reference | scrollbar轨道颜色 | | tl_scrollbarThumbColor | color | reference | scrollbar高亮颜色 |

Change log

2020-2-1

  • 修复数据更新问题

2020-1-21

  • 新方法修复滚动条变长变短问题(很完美)
  • 支持数据重新排序
  • 回调方法变动

2020-1-5

  • 修复滚动条突然变长变短的问题
  • 优化默认圆角大小显示效果

2019-12-13

  • 修复滚动条颜色配置无效的问题

About me

掘金主页: https://juejin.im/user/56f3dfe8efa6310055ac719f

简书主页: https://www.jianshu.com/u/913a8bb93d12

我的淘宝店: https://shop238932691.taobao.com

:smile:是时候来一波三连了~

License

Copyright (c) 2019 zaaach

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.