zhousuqiang / Tvrecyclerview
TvRecyclerView--针对TV端特性进行的适配与开发
Stars: ✭ 453
Programming Languages
java
68154 projects - #9 most used programming language
Labels
Projects that are alternatives of or similar to Tvrecyclerview
lrud
Left, Right, Up, Down. A spatial navigation library for devices with input via directional controls
Stars: ✭ 31 (-93.16%)
Mutual labels: tv, focus
Vudash
Powerful, Flexible, Open Source dashboards for anything
Stars: ✭ 363 (-19.87%)
Mutual labels: tv
Familiarrecyclerview
一个如你熟悉ListView、GridView一样熟悉的RecyclerView
Stars: ✭ 372 (-17.88%)
Mutual labels: recyclerview
Recycler Fast Scroll
Provides fast scroll and section idexer for recycler view
Stars: ✭ 445 (-1.77%)
Mutual labels: recyclerview
Imageviewer
🔮图片浏览器,支持图片手势缩放、拖拽等操作,`自定义View`的模式显示,自定义图片加载方式,更加灵活,易于扩展,同时也适用于RecyclerView、ListView的横向和纵向列表模式,最低支持版本为Android 3.0及以上...
Stars: ✭ 363 (-19.87%)
Mutual labels: recyclerview
Recyclerview Gallery
Recyclerview-Gallery:This library shows you a gallery using RecyclerView.
Stars: ✭ 420 (-7.28%)
Mutual labels: recyclerview
Multiitem
一个优雅的实现多类型的RecyclerView类库 支持DataBinding Form表单录入 跨多个RecyclerView拖动
Stars: ✭ 381 (-15.89%)
Mutual labels: recyclerview
Klaster
Declare RecyclerView adapters in a functional way, without boilerplate and subclassing. No compromises on flexibility. If it's possible to do something by subclassing, it's possible to do it with this library.
Stars: ✭ 373 (-17.66%)
Mutual labels: recyclerview
Dragselectrecyclerview
TouchListener that can be attached to any RecyclerView and handles multi selection for you
Stars: ✭ 371 (-18.1%)
Mutual labels: recyclerview
Android Extensions
An Android library with modules to quickly bootstrap an Android application.
Stars: ✭ 356 (-21.41%)
Mutual labels: recyclerview
Scrollingpagerindicator
Pager indicator inspired by Instagram. Lightweight and easy to set up.
Stars: ✭ 419 (-7.51%)
Mutual labels: recyclerview
Adapter
A quick adapter library for RecyclerView, GridView, ListView, ViewPager, Spinner
Stars: ✭ 376 (-17%)
Mutual labels: recyclerview
Popupbubble
🅿️ Easily add and customise "New Post" popup button with the feeds (RecyclerView) of your app.
Stars: ✭ 385 (-15.01%)
Mutual labels: recyclerview
欢迎使用 TvRecyclerView
- 针对TV端的特性对RecyclerView进行了适配与开发;
- 优化TwoWayView在TV端的适配和延伸;
- 支持v7包原生的LayoutManager;
- 支持阿里vlayout的布局及其它第三方LayoutManager;
效果
Android Studio 集成
// support版本
implementation 'com.owen:tv-recyclerview:2.1.1.1'
// androidx版本
implementation 'com.owen:tv-recyclerview:3.0.0'
自定义属性
属性 | 值/类型 | 简介 |
---|---|---|
tv_layoutManager | string | 指定LayoutManager |
tv_selectedItemOffsetStart | dimension | 选中的item距离开始(上/左)的偏移量, 与tv_selectedItemIsCentered二选一 |
tv_selectedItemOffsetEnd | dimension | 选中的item距离结尾(右/下)的偏移量, 与tv_selectedItemIsCentered二选一 |
tv_selectedItemIsCentered | boolean | 选中居中, 与上面的偏移量二选一 |
tv_isMenu | boolean | 是否为菜单模式 |
tv_isMemoryFocus | boolean | 是否记忆焦点 |
tv_loadMoreBeforehandCount | int | 提前多少个开始加载更多 |
tv_optimizeLayout | boolean | 布局优化, 常用的LayoutManager作用不是很大,但对MetroGridLayoutManager这种计算量大的布局来说有一定的提升 |
tv_verticalSpacingWithMargins | dimension | 设置布局item间的竖向间距 |
tv_horizontalSpacingWithMargins | dimension | 设置布局item间的横向间距 |
自定义LayoutManager属性 | ||
tv_numColumns | int | 列数, GridLayoutManager及子类所拥有 |
tv_numRows | int | 行数, GridLayoutManager及子类所拥有 |
tv_laneCountsStr | string | 每块区域的列数, MetroGridLayoutManager所拥有, 格式 如:24,60,10 |
tv_isIntelligentScroll | boolean | 根据区域智能滚动, MetroGridLayoutManager所拥有 |
特性
-
[x] 支持快速移动焦点不丢失;
-
[x] 支持Item选中放大不叠压;
-
[x] 多种选中和滚动方式:
//选中指定项 setSelection(int psotion); //选中指定项(平滑的滚动方式) setSelectionWithSmooth(int position) //滚动到指定位置, 可以指定便宜量, 可以指定是否获取焦点 scrollToPositionWithOffset(int position, int offset, boolean isRequestFocus) //平滑的滚动到指定位置, 可以指定便宜量, 可以指定是否获取焦点 smoothScrollToPositionWithOffset(int position, int offset, boolean isRequestFocus)
-
[x] 监听回调
//item选中、点击监听 mRecyclerView.setOnItemListener(new TvRecyclerView.OnItemListener() { @Override public void onItemPreSelected(TvRecyclerView parent, View itemView, int position) { //上次选中 } @Override public void onItemSelected(TvRecyclerView parent, View itemView, int position) { //当前选中 } @Override public void onItemClick(TvRecyclerView parent, View itemView, int position) { //点击 } }); //焦点移动边界监听 mRecyclerView.setOnInBorderKeyEventListener(new TvRecyclerView.OnInBorderKeyEventListener() { @Override public boolean onInBorderKeyEvent(int direction, View focused) { switch (direction) { case View.FOCUS_DOWN: break; case View.FOCUS_UP: break; case View.FOCUS_LEFT: break; case View.FOCUS_RIGHT: break; } //返回true时,事件将会被拦截由你来控制焦点 return false; } }); //加载更多监听 mRecyclerView.setOnLoadMoreListener(new TvRecyclerView.OnLoadMoreListener() { @Override public boolean onLoadMore() { mRecyclerView.setLoadingMore(true); //正在加载数据 mLayoutAdapter.appendDatas(); //加载数据 mRecyclerView.setLoadingMore(false); //加载数据完毕 return true; //是否还有更多数据 } });
更详细的使用请见exmaple
扣 扣 群:484790001(注:加群时请写明来源及目的)
其它作品
焦点框框架TvFocusBorder
Tab框架TvTabLayout
Tv控件TvWidget
作者 owen
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].