Show Single Item at a time in Recycler view - android-recyclerview

I'm showing list of items in WearableRecyclerView. As of now I am getting like this
But I need to show Single Row(Single Item) in a Page,Scroll down,then show next Item.
Any Help to do this in android app?

You can do it by two way.
option 1: putting recycler view item width and height both to match_parent.which will cover the screen with with one item at a time and need to scroll for see the next item.
option 2: use this library which will do the exact thing that you are looking for.

The code snippet below is used to show one item at a time. After configuration of your recyclerview add the code snippet.
PagerSnapHelper().attachToRecyclerView(nameOfYourRecylerView)

Related

UWP ListView - How to update BringIntoView to show part of next item, in both directions

I am working on a listview of items and I need to allow user to scroll up/down but I need the bring into view handling to bring the item into view as well as a small part of the next item (in scrollviewer extent). This will indicate to user that there is an item above or below in the list.
I have made a simplified sandbox app to work on this and here are screenshots of what I am trying to do. Arrow indicates scroll direction and the red parens indicate the part I cannot get to show up, meaning the partial amount of the next item.
Please ask if you need anything clarified, I understand this is a complex explanation.
What I have tried:
margin (+/-) on ItemsPresenter/ScrollViewer/ListView
handling ListView.SelectionChanged and using math and various logic to determine direction of scroll and then use ScrollViewer.ChangeView call with calculated vertical offset value.
handling ListView.BringIntoViewRequested and set args.Handled = true and issue new request with various BringIntoViewOptions values, including VerticalOffset, VerticalAlignmentRatio, and new TargetRect with adjusted Y value.
I have read several helpful existing questions here on SO that led me to the BringIntoViewOptions attempt. But nothing so far has worked.
None of these have worked. If I could describe what I want it would be to utilize the existing BringIntoView functionality but bring the item far enough into view that the next item shows a little.

Flatlist scrollToIndex produces whitespace on iOS

The design of the application I am working on changes the layout based on the width of the device and there is a Flatlist component that calls scrollToIndex on the selected item so that it does not fall out side of the view when the app changes it's layout. If the last item is selected and scrolltToIndex is called, on iOS it will scroll the item all the way to the top and hide all the items above it. That makes it appear like it is the only item left and the only way to bring back the other items is to manually pull down the list. On android it works perfectly i.e it will only scroll an item high enough to fit as many items below it as possible (if more than height of container, it just scrolls it to the top).
From the FlatList>ScrollToIndex docs:
Note: Cannot scroll to locations outside the render window without specifying the getItemLayout prop.
Because FlatList is virtualized (i.e. efficient because it doesn't render the full list offscreen), it doesn't know the location of all of the elements (since they're not pre-rendered, and hence their size is unknown). It needs you to help by providing element sizes through getItemLayout to scroll beyond what's near visible. I suspect "near visible" may vary device to device with different memory settings. If you don't do this, you can end up with gaps in your list since exact placement is unknown.
So, you'll need to implement getItemLayout or use the less performant (and depricated) ListView component.

single item is showing in recycler view even though the entire screen is empty error?

Even though the entire screen is empty only one element is visible in recycle(r) view list. I have used wrap_content for height but still it is showing single element.But when I scroll that single element second element comes in first's place.Why is it happening ?
Check the item layout of recyclerview,the height of your item maybe is match_parent.It's different from the listview item.

UIMenuController

I wish to display 2 or more UIMenuControllers on the singleTap event. I can display one menuItem but when I try to display 2 of them only the last(latest) one is being displayed.
Firstly, is it even possible to display 2 or more UIMenuControllers on the same View??
Secondly, if yes, could someone please show me where to go on from displaying one menu to 2.
I am using this method to label parts of the screen that activate the menu on singleTap.
I will answer my own question for further reference if anyone else is looking for the same query.
You can have only one UIMenuController at a time. Its a shared menuController hence.
For further reference: http://developer.apple.com/library/ios/#documentation/iPhone/Reference/UIMenuController_Class/UIMenuController.html

Incomplete share list on windows explorer

I try to use below code to find all list view items included, it works well if there are no items out of view in Detail View Mode, but if there are lots of list view items, some of them are invisible, namely there is veritical scroll bar showing up in the right, it only can find the visible items, but it works well in other View Mode, such as List.
is there anything wrong here?
AutomationElementCollection items = list.FindAll(TreeScope.Children,
new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.ListItem));
Logger.WriteWarning("the items totally:"+items.Count); //for exmaple 39/55, not full list items.
here is the screen shot for your reference http://social.msdn.microsoft.com/Forums/en-US/windowsaccessibilityandautomation/thread/d6e58ae1-0eb9-43cf-af51-04102a4dd627.