All Projects → henryblue → Tvrecyclerview

henryblue / Tvrecyclerview

Licence: apache-2.0
A custom RecyclerView for Android TV end

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Tvrecyclerview

Android Tv Widget
Android tv,盒子,投影仪 控件
Stars: ✭ 536 (+67.5%)
Mutual labels:  android-tv, recyclerview
Chipslayoutmanager
ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layouts behaviour with support of amazing recyclerView features
Stars: ✭ 3,138 (+880.63%)
Mutual labels:  recyclerview
FlexItemDecoration
FlexItemDecoration, can customize the head, bottom, leftmost, rightmost dividing line, but also customize any one of the dividing lines and batch custom multiple dividing lines
Stars: ✭ 52 (-83.75%)
Mutual labels:  recyclerview
Recyclerviewevent
RecyclerView onItemClick、onItemLongClick、drag、swipe、divider、reuse disorder RecyclerView 梳理:点击&长按事件、分割线、拖曳排序、滑动删除、优雅解决 EditText 和 CheckBox 复用错乱问题
Stars: ✭ 265 (-17.19%)
Mutual labels:  recyclerview
RecyclerELE
Android Library for easy addition of Empty, Loading and Error views in a RecyclerView
Stars: ✭ 27 (-91.56%)
Mutual labels:  recyclerview
Citypicker
🔥🔥🔥城市选择、定位、搜索及右侧字母导航,类似美团 百度糯米 饿了么等APP选择城市功能
Stars: ✭ 2,973 (+829.06%)
Mutual labels:  recyclerview
adapster
Android library designed to enrich and make your RecyclerView adapters more SOLID
Stars: ✭ 17 (-94.69%)
Mutual labels:  recyclerview
Byrecyclerview
🔥 RecyclerView 下拉刷新、加载更多、item点击/长按、头布局/尾布局/状态布局、万能分割线、Skeleton骨架图、极简adapter(RV/LV)等
Stars: ✭ 290 (-9.37%)
Mutual labels:  recyclerview
Demo Recyclerviewenteranimation
Demo project for a blog post
Stars: ✭ 289 (-9.69%)
Mutual labels:  recyclerview
Transformerslayout
🔥 App金刚区导航菜单,类似淘宝、QQ音乐等APP导航,方格布局横向多行滑动翻页带滚动条
Stars: ✭ 258 (-19.37%)
Mutual labels:  recyclerview
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (+815%)
Mutual labels:  recyclerview
Jetpack-compose-sample
Forget about bunch of XML files for maintaining UIs. Jetpack Compose is Android’s modern toolkit for building native UI. Here is a small example to get started.
Stars: ✭ 29 (-90.94%)
Mutual labels:  recyclerview
Aiforms.settingsview
SettingsView for Xamarin.Forms
Stars: ✭ 274 (-14.37%)
Mutual labels:  recyclerview
Polet
A solution to compose RecyclerView Decoration
Stars: ✭ 23 (-92.81%)
Mutual labels:  recyclerview
Kiel
Kotlin way of building RecyclerView Adapter 🧩. You do not have to write RecyclerView Adapters again and again and suffer from handling of different view types. Kiel will help you.
Stars: ✭ 297 (-7.19%)
Mutual labels:  recyclerview
ClockScroller
A cool animated RecyclerView clock face scroller handle inspired by the following MaterialUp submission - https://material.uplabs.com/posts/codepen-scrolling-clock
Stars: ✭ 75 (-76.56%)
Mutual labels:  recyclerview
SpannedGridLayoutManager
Android RecyclerView.LayoutManager that resizes and reorders views based on SpanSize
Stars: ✭ 522 (+63.13%)
Mutual labels:  recyclerview
Android Pagination With Recyclerview
Pagination (Endless or Infinite Scrolling) using RecyclerView's onScrollListener
Stars: ✭ 269 (-15.94%)
Mutual labels:  recyclerview
Boardview
A draggable boardview for java android (Kanban style)
Stars: ✭ 309 (-3.44%)
Mutual labels:  recyclerview
Cardslideview
一行代码实现ViewPager卡片效果,比ViewPager2更强大,底层同样是RecyclerView
Stars: ✭ 301 (-5.94%)
Mutual labels:  recyclerview

TvRecyclerView

A custom RecyclerView for Android TV end, It can implement grid and irregular grid two display types.

ScreenShot



Usage

1.First you can add gradle dependency with command :

dependencies {
    ......
    compile 'com.henryblue.library:tvrecyclerview:1.2.4'
   }

To add gradle dependency you need to open build.gradle (in your app folder,not in a project folder) then copy and add the dependencies there in the dependencies block;

2.Add HorizontalGridView in your layout

<app.com.tvrecyclerview.HorizontalGridView
        android:id="@+id/id_grid_first"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="45dp"
        android:paddingRight="45dp"
        android:paddingTop="20dp"
        android:clipChildren="false"
        android:clipToPadding="false" />

3.Set the presenter(adpter create child view)

public class RegularPresenter extends Presenter {
    RegularPresenter(Context context) {
        super(context);
    }
    @Override
    public View onCreateView() {
        ImageView view = new ImageView(getContext());
        view.setSelected(true);
        view.setFocusable(true);
        view.setLayoutParams(new ViewGroup.LayoutParams(423, 138));
        return view;
    }

    @Override
    public void onBindViewHolder(ViewHolder viewHolder, Object item) {
        viewHolder.view.setBackgroundColor(Color.GREEN);
    }

    @Override
    public void onUnbindViewHolder(ViewHolder viewHolder) {
    }
}

4.Set GridObjectAdapter

HorizontalGridView gridView = findViewById(R.id.id_grid_first);
gridView.addItemDecoration(new SpaceItemDecoration());
gridView.setNumRows(2);
GridObjectAdapter adapter = new GridObjectAdapter(new RegularPresenter(this));
gridView.setFocusZoomFactor(FocusHighlightHelper.ZOOM_FACTOR_SMALL);
gridView.setAdapter(adapter);
for (int i = 0; i < 10; i++) {
  adapter.add(new RowItem());
}

For more usage, please refer to the examples in the code. For example how to implement irregular style, please refer here.

XML attributes

Name Type Default Description
android:gravity enum Gravity.TOP&Gravity.LEFT Set the way to gravity (Works in regular mode)
focusOutFront boolean false Allow DPAD key to navigate out at the front of the View
focusOutEnd boolean false Allow DPAD key to navigate out at the end of the view
numberOfRows integer 1 set the number of rows in the HorizontalGridView (Works in regular mode)
numberOfColumns integer 1 set the number of columns in the VerticalGridView (Works in regular mode)

License

Copyright 2016 henryblue

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.

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].