While going through a IOS app in my company, I saw the buttons set in a horizontal scroll view in a animated manner which looked really good. When asked the IOS developers they said it is a pre built in function available in xcode. I want to know whether it can be achieved in Android.
Details regarding the scroll view.
There are buttons when scrolled over revolves around. To be more precise it moves in the anti-clockwise direction but doesn't disappear from view.
Thanks in advance for the help.
May be this is what you want or it may help you
http://www.codeproject.com/KB/android/androcarousel.aspx
If my understanding is correct about your question, We have HorizontalScrollView to achieve that in android. You have to do your own animation while scroll. There is no in build animations while scrolling.
Please go through the following link.
Related
What is the easiest way to implement a screen slide in Nativescript like shown in Android Viewpager , but in a vertical direction ? Another example of this functionality would be the rss reader feedly where you can change rss feeds by swiping up/down.
The page should allow vertical scrolling to the top/bottom and then transition after a certain treshold.
I already encountered nativescript-slides, which can only do horizontally sliding.
So is there a "nativescript" way or do i have to implement it as native android/ios feature (for example by this) ? In either case a sample on how to integrate it in nativescript would be great.
Update
Recorded an example:
taken from this Repo with Android native code. The outstanding PR made changes to offer vertical scrolling in the list. But the repo seems to be outdated and a bit buggy.
I can provide more info later but there's a new plugin implementing the native controls for android and iOS for slides/carousel her https://github.com/alexrainman/nativescript-carousel-view and vertical swiping is on his radar, I think he might even be close to completing that.
To give an answer for anybody interested in above nested scrolling animation:
For Android I had to implement the native ReyclerView in Nativescript in favor of the NS buildin ListView. It is an optimized view structure which among other things allows nested (vertical) scrolling and can be used as replacement for an ordinary list.
Together with https://github.com/alexrainman/nativescript-carousel-view works like a charm!
Anyone that ends up here still looking for ways to achieve this.
I spent a lot of time trying to figure out a way to achieve this and tried to find ready plugins for this. Also tried to use the plugin from Alexrainman but eventually gave up since the plugin was not up to date with the current nativescript-version.
My solution:
I used radListView as a basis for this implementation and leveraged the methods and events on the radListView.
By using scrolled-event I gathered data for the use of the scrolling feature: scroll Speed and scroll direction. (These might be also taken from the event data, but since I did not find the event details from the Nativescript-documentation I gave up trying to guess where to find this data on the event-model).
Then I also saved the fixed height of one item on my list (The height I fixed to screenHeight-200).
With all this info, I managed to hook the event "ScrollDragEnded" and add logic that makes my list behave like a vertical slider. Moving on the list by method "scrollToIndex" and figuring out which index to scroll and when by leveraging all the data mentioned above.
This is the way I managed to make a pretty good vertical slide.
Good luck!
I'm looking for a way to scroll my horizontal menu at a specific interval.
I have multiple children visible on screen
The selected state is at center.
The use of snapToInterval in combination with snapToAlignement fills exactly my needs, but these props are only for iOS.
Is there a way to achieve this ? I suppose the PanResponder API could be use but I have no clue how to implement it.
I use 0.28 RN version. Thanks.
<ScrollView
decelerationRate={0}
horizontal
snapToAlignment="center"
snapToInterval={150}
>
{this.props.children}
</ScrollView>
There is a pull request regarding this issue: https://github.com/facebook/react-native/pull/15297
Also there is a library https://github.com/machadogj/react-native-carousel-control?files=1 that support for both Android and iOS swipe, it control the scrolling behaviour itself, but I tried it, it worked, but not that smooth compared with snapToInterval and snapToAlignment.
Another one, but more complex carousel swipe is here: https://github.com/archriss/react-native-snap-carousel
Hopefully, you will get more insights based on these.
I would like to develop an application, which has a part, when I have to print a long text on the screen. My question is: What layout or view or ? are you recommend for Me, if I want to make paging effect? Some text could reserve more pages, and I would like to scroll between these pages with an effect like e-book readers does it. What shall I prefer? Webview? TextView with modifications? Canvas? Or What?
Please give me tips. (I just need some direction to where shall I start now)
Thanks in advance!
I think you're refering to the ViewPager :
http://developer.android.com/training/animation/screen-slide.html
If so, I recommend you to follow this training and come back on StackOverFlow if you have a problem, with some code, or something you've tried and hasn't worked.
Is possible to do a vertical scroller animation in Android without using javascript? Anybody knows a tutorial o a web page with a helpful code? thanks
I'm not sure of what you mean by vertical animation but I think this tutorial can help you.
Animations of views are based on Interpolators that you can set, and one of them is the LinearInterpolator which is detailed here.
EDIT, further to the comments below:
This is something you can do with the scrolling and animation features of the View class, as described here (ctrl-f "Scrolling" and "Animation" in that page).
Should the API level you are using be too low, this is also something you can do with a Thread that modified the position of the TextView embedded in your layout or that uses the scrollXX() functions. This is also described in the page linked above.
Have you looked at the viewflipper control.
I've tried this in the past and it works well. You can also use ViewAnimator class
UPDATE
The google documentation is a bit hard to chew through. You may wish to try this simple tutorial first.
I have implement simple one simple database application in which I have used scrollview.Its work fine.But scrollview is not bounce.
Is it possible to enable bounce in scrollview?
Thanks in advance.
Warning: I don't really know how to do this, I'm just thinking of how I would approach this...
Have you tried to put empty space on both ends of the view? That way it would look like the user is scrolling past the beginning/end. If there's a listener involved maybe you could test to see if the user is in the 0-10% range or the 90-100% range, and if so, "bounce" them back?\
Edit: I found this article: Support Bounce Property for Scrollview in Android