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

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.

Related

Implementing Swipe Animation like Pivot Page in PhoneApplicationPage windows phone 8

I am having a lot of Items(Say 100), I want the user to swipe right and left to see the detailed description of Items.
I thought of using a Pivot Control, but that is causing performance problem because of too many items.
Now, In order to make it lightweight, I want to implement the scenario in a Single page and change the DataContext when the user swipes. I know that swipe gestures can be detected from the toolkit project. Now, I want to animate my grid, when swipe gestures happening exactly like Pivot Page or a Normal Scroll behaviour. I searched a bit, and found that it can be done by creating StoryBoard animation but I am less experienced in that. Any code sample will be helpful. Thanks.
i think you can make archive page and when the user select the item jump to the pivot with selected index
Small possible code sample.
In your page code behand, initialize a Dictionary ( where int is the position and pivotitem the pivot )
Load it up with 3 pivots at start
Than if your Pivot control is called AllPivots, do AllPivots.Items.Add(pivotItem) for each pivot inside the dictionary.
Next thing to do is detect how the user is changing the pivots, so if the selectedindex changes of AllPivots, see if the user advances, if so, add the next pivot into the dictionary and also to the AllPivots.Items and remove the first pivot with AllPivots.Items.Remove.
Each time the user goes back or forward look up the next or previous pivot in the dictionay and perform the correct actions or create new pivots on the fly.
Like I said a dirty hack, but maybe worth a try

how to make a UIScrollView track something?

i want my app to be able to track a person when he moves 2 dimensionally upwards. I already have a vertical scroll view, and it works, but when i press a button i want it to track a little stick figure as he walks vertically, how can i control this? i thought of setting the scrollview.contentoffset to a certain position, but it just changes it one time when i want it to change it fluidly. i suppose i could make a timer that updates the contentOffSet every like .001 seconds or something, but i thought there maybe a better way.
Also, while i was searching the UIScrollView's methods, one of them was an isTracking method, which is a boolean, and I'm assuming it returns yes if the scrollview is tracking something, so given that i assume there is a feature in scrollview so that you can track things. Also, if to track things you have to use some other framework thing that would be helpful to know too
THANKYOU FOR ANY HELP!
The property tracking tells if the scroll view is currently tracking the user's movement. So that definitely won't help you out. (See David H's post for a better explanation for what the property indicates.)
However, you could use setContentOffset:animated: and set animated to YES. That results in a smooth transition to the new content offset.
Instead of calculating a reasonable content offset you might find it easier to specify an area that contains the stick figure. If so use scrollRectToVisible:animated:. Obviously animated should be set to YES.
1) don't use contentOffset = x;, use "- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated". Experiment how often you need to send this message, but I'm guessing you can do it no more than 10 times a second and get nice results.
2) isTracking means the user has their finger on the scrollView but has not started dragging it. By testing "isTracking" and "isDragging" you can determine if the user is fiddling with your scrollView or not.

How does the Reeder Mac app animate lists when switching folders?

Initially I was under the impression that it uses the table row slideup/down animations while inserting/deleting new rows but I doubt if it's doing that as it does it so fluidly even with thousands of items in the list (otherwise it would take a lot of time for the deletions/insertions to work).
Am I right in my assumption that it's simply attaching a new instance of the News list at the bottom of the screen, shrinking the above one while the one at the bottom expands to fill up space?
UPDATE:
Please see this video of what I mean: http://dl.dropbox.com/u/4960327/ReederAnim.mov
I can not tell you exactly how Silvio Rizzi made this, but as you see in the playback, a list view is added behind the shown list view, and the front list view fades out (.alpha = 0.0;) while the list view behind it expands its height per row.
When you desicate it frame by frame it becomes quite clear what he does, and it is really not that advanced. But I have to admit, with the white "milky" polished interface, it looks quite neat.
In addition, you can see that while animating, the background list view only renders the top 7 entries (hopefully calculated by dividing the view height with the average height of the cells shown) making the list view quick to load. Then afterwards, he can load an extended array of cells once you start scrolling, or in a background thread starting once the animation is complete.

iOS dynamically filling search results

I am building a small Search app on iPad. I want to show the search results. Do I use UIScrollView or UITableView?
The number of search results are unknown & as the user scrolls vertically I'll want to dynamically keep fetching the results & fill whatever container I will be using. Something like what Google Reader (on web) has.
For this purpose which is better suited? UIScrollView or UITableView? Also please guide me as to how dynamically populate the results?
This is an awesome question. I have a different approach for a solution to this problem. It is not the exact answer; But I would assume that the logic might be helpful -
Algorithm:
Decide on a certain number of records being pulled into the UITableView. (lets say 8 ).
You can use a UIScrollView with a small size (rather than setting it with smaller stepping size & frame).
Using the clipsToBounds property (set it to NO), you can actually track the amount of scroll, and check if it goes out of bounds
After you go beyond the bounds, initialize a new UIScrollView with a fresh-list of tables, and get another 8 data entries, and this can be continued.
Reduce the size, set the property and it would work.
But the problem with this is that ; if you try to touch outside the scrolling area => it will not scroll up/down.
Please refer to this tutorial, which can offer some intel on this idea.
And for setting the Scroll amount for Page control => Refer to this question on Stack Overflow.

How can I display a value in a textbox indicator and a slider in LabVIEW?

Is there a way to link two indicators on a LabVIEW front panel, so that they always have the same value? Right now I'm setting both to the same value every time, but it'd be much easier if there were a way to set up one to mirror the other.
You can make the digital display visible. Right-click on the slider and select "Digital Display" from Visible Items.
There are a few ways to achieve this, depending on how you are trying to display the data.
If you are just trying to update a slider and make a textbox indicator display the numeric value then by right clicking on the slider and selecting 'Visiable Items -> Digital Display' you will have a numeric indicator showing the value of the slider. This can then be repositioned as required. You should see if this meets your requirements as other methods will add complexity to your Block Diagram.
An alternate method would be using a network shared variable and binding the data although I think from your question this would be over kill.
You can also create an event structure to look for a value change event for the slider and update the text indicator accordingly. You would have to be careful how you update the slider as just wiring a value to the slider will not trigger an event for use a property node linked to the slider for the property 'value(signalling)'. Again this may be over the top for your application.
Strictly speaking, no, you can't do that automatically. What you can do is set up an Event Structure and use the Value Changed events for each of the two controls to update the other. Just realize that the slider fires value changed events many times while the user is sliding it around, rather than just one event at the end. That may be what you want in this situation, however.
I think this is not easily done, however there are some possibilities (as discussed).
The general question is why?
You have an indicator with the same info at two places. (or are they actual controls?)
If you have two indicators, just place there terminals next to each other, just remember when you alter one of the two (via a local or by ref) to mimic the action for it's twin.
Using a value change event for both controls should work, just remember that you might get race conditions if you don't process the event directly.
Could describe a little bit further why you need two controls for the same action/value?
Ton