verticalHorizontal scroll Listview for android TV app - android

I had a requirement of implementing a Header List view with horizontal scroll items as rows (similar to UI shown by using Browse fragment of leanback library) for android TV app . I browsed on net and used verticalHorizontalscroll view using Two way View example and added a header text.As the app is for android TV , both Horizontal and Vertical scrolling should happen on keys Navigation and should show a selector to the focused item.
The vertical Scrolling and Horizontal scrolling is not happening properly.
VericalScrolling:
while scrolling up and down using Keys the entire row is not scrolling it is showing only half of the row on screen. When i set setItemsCanFocus is true it taking two key presses to scroll entire row. One for scrolling row and one for scrolling the header text.
HorizontalScrolling: Horizontal scrolling is not happening until we set setItemsCanFocus is true only after this it is showing selector on focused item . It is taking multiple Right key presses to scroll one item to right.
Please anyone tell me how can i get smooth scrolling both horizontal and vertical along with selector for TV. Is there any other way i can implement this.
Thanks,

Related

Change focus in RecyclerView in single vertical click

I am building an app for Android TV by using Nested RecyclerView. Root is vertical RecyclerView which has rows with Horizontal RecyclerView.
I want to change the focus on the single click and want to keep the scroll position static. But scrolling is always happening at the bottom of the view for horizontal and vertical both.
I am using the focus listener to scroll to top
verticalRLVLayout.scrollToPositionWithOffset(rowNumber,0);
horizantalRLVLayout.scrollToPositionWithOffset(columnNumber, 0);
This is not working always and i don't see this is the best option.
Is there any way by which if we have fixed height of each row the single click will change the focus always.
Going upward in the RecyclerView, causes new row to slide towards right and focus goes to last visible tile on the previous row. Why this is happening, any idea ?
Thanks

Swipe and tap to enlarge recycler view

I have a recycler view which has its items in a card view. The recycler view gets its data from a sql database within the app . Now I want to implement two features to this recycler view items. First , whenever the individual cards are tapped , I want them to enlarge and display more data and should shrink back when tapped again. It is not like the case of expandable list view where it expands into a child list view. I want the height of the card to increase and just show some more information and buttons. Second I want the items to swipe left . I know there is a feature for that in recycler view , but I want to customise the swipe feature. Swipe from right should be locked , and when swiped from left , It should not go off list completely. It should show two buttons and should go off list only when one of the buttons is clicked. I have been looking , but there is no proper explaination anywhere. Please guide me through this process.
For your first question, set the adapter layout_height to wrap_content and set the buttons visibility to GONE. Implement the OnClick listener in the RecyclerView adapter and set the visibility of the buttons to VISIBLE if GONE and GONE if VISIBLE or use a boolean to alternate the visibility.
For your second question, this might help:
https://www.learn2crack.com/2016/02/custom-swipe-recyclerview.html
How can I make my Android SwipeableCardViews more like the IOS 7 mail app (swipe to show buttons)
https://github.com/daimajia/AndroidSwipeLayout

How to make UI like Google Inbox app in Android

Unscrolled Horizontal RecyclerView
Scrolled Horizontal RecyclerView
I want to make Google Inbox Android app like UI in my APP, I know its
been using `RecyclerView` to achieve this. I have two questions
1. How to make First horizontal card start drawing itself after some
left padding, coz as per hierarchy viewer RecyclerView shows &
Scrolls from end to end then how to align first item with given left
spacing?
2. When we are using this type of nested recycler views, how can i
maintain adapters of horizontal recycler views so that I don't have
to recreate it in each `onBindViewHolder()` callback to avoid
reinflation on every scroll?

Scrolling grid view hides other control on top of activity in android

On scrolling down gridView.
I want to scroll my three tabs on top as shown in second image.
And on scrolling up back shows that again like first image.
I have checked paralloid library, but not sure if it solves this problem or not.
Same functionality i found in google+ android app. In profile page on scrolling tab scroll till they reach on top. after that list view scrolls.
GridView already has scrolling built into it, so its children should scroll separately than its siblings by default. No extra library should be needed for scrolling down, although scrolling horizontally is a separate issue.

vertical and horizontal scrolling like Pulse application

My application requires both horizontal scroll and vertical scroll together. The number of view items in both the direction are dynamic and will be fetched from database 10 at a time (horizontal direction). How can I implement this ?
I tried using listview + horizontal listview (http://www.dev-smart.com/archives/34). But the problem coming is..when I click a button to append next 10 items in a row in horizontal direction. Next stories appended are not being displayed. When i scroll vertically and that particular row is not visible then again when i scroll it back..the next appended stories are visible.
Any solution to my implementation ? or any other suggestion/idea to implement vertical+horizontal scroll which will fulfill my purpose ??

Categories

Resources