Skip to content

TvRecyclerView--针对TV端特性进行的适配与开发

Notifications You must be signed in to change notification settings

FrozenFreeFall/TvRecyclerView

Repository files navigation

欢迎使用 TvRecyclerView

首先感谢lucasr开发出杰出的作品TwoWayView,TvRecyclerView就是在TwoWayView的基础上进行的延伸,即:

  • 修复了一些小bug
  • 针对TV端的特性进行了适配与开发

效果

Android Studio 集成

compile 'com.tv.boost:tv-recyclerview:1.0.1'

特性

  • 支持焦点快速移动

  • 支持Item选中放大时不被叠压(无需手动调用bringChildToFront())

  • 支持横/竖排列

    android:orientation="horizontal"
  • 支持布局指定LayoutManager

    app:tv_layoutManager="SpannableGridLayoutManager"
  • 支持设置选中Item边缘距离/居中

    setSelectedItemAtCentered(boolean isCentered)
    setSelectedItemOffset(int offsetStart, int offsetEnd)
  • 支持设置横竖间距

    setSpacingWithMargins(int verticalSpacing, int horizontalSpacing)
  • 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) {
                
        }
    });

更详细的使用请见exmaple


作者 owen

About

TvRecyclerView--针对TV端特性进行的适配与开发

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages