how to achieve image slider in android application? - android

I want to have a login view similar to foursquare, can any one tell me how can i achieve this ? i have this youtube video for reference. http://youtu.be/RmQH0s2f2D8

You can use ViewPager to achieve that.
Here are a few tutorials on it if the one above doesn't suffice.
Android User Interface Design: Horizontal View Paging
Android (support v4) ViewPager tutorial (including source code)
Working with Fragments and ViewPager on Android

You're looking for a ViewPager
The Docs are pretty good in this case, so that should help.
As far as the popup at the bottom of the screen, you can hook it in to a page change listener and animate it up/down depending on the page.

Related

Navigation Drawer + Swipe View like in Play Store / VLC app

I'm trying to implement a navigation like in Play Store app or in the VLC app.
In the Play Store app, they use a navigation drawer where you can choose 'apps'. Then it is possible to swipe through 'views' (categories, home, top paid, ...) ( here is a picture to show what I'm talking about)
In the VLC app, they use a navigation drawer (?) in combination with a swipe view (?) for the audio section.
I was searching for a tutorial, but I couldn't find any suitable yet. Most of these tutorials use Fragment's - as far as I know, these aren't able to contain swipe views?
Could someone please give me a hint (in addition it would be nice to see some code) on how to get on with this? Thanks :)
Look into latest design support library, specifically for TabLayout, where you can specify fixed tabs (up to three usually), or swiping ones (many more).
http://android-developers.blogspot.co.uk/2015/05/android-design-support-library.html
There's also an awesome demo of it in an open source app called Cheesesquare.
https://github.com/chrisbanes/cheesesquare
A FrameLayout hosting a ViewPager could be used to achieve this. Just use a LinearLayout at the top of the layout to display your navigation buttons.
The ViewPager will allow the user to swipe through each fragment it contains, you can also set each button's onClick to have the ViewPager automatically swipe to the relevant fragment.
If you want to use TabLayout, look into Google I/O app on github. More specifically, take a look at SlidingTabLayout and SlidingTabStrip under iosched/android/src/main/java/com/google/samples/apps/iosched/ui/widget. Also take at look at this SO thread

Android implement left to right swipe animation

In android, i want to move from current to previous activity by left to right swipe as in iOS. I want to be able to even hold while swiping such as both activities are visible at the same time.
I want to introduce transition/animation effect just like in Telegram app. So please help how can i do it.
Tutorials or example code will work for me.
Thanks in advance!
You better use the Swipe animation with multiple Fragments inside one Activity: Creating Swipe Views with Tabs
take a look at this tutorial : HOW TO IMPLEMENT HORIZONTAL VIEW SWIPING WITH TABS
If you're already using Google's NavComponent library, you should try a library that I wrote:
https://github.com/massivemadness/Fragula
It's fully integrated with NavComponent, which means the navigation API stays the same, you only need to make some changes in NavGraph and NavHost container.
Here's the result:

Android swipe fragment out of screen

I am quite new to Android development and would like to know how I can realize the effect that individual Fragments can be simply swiped away as it's done in the Android Chrome browser's tab overview. What do I need to google for?
Currently I have a Navigation Drawer as side-menu and a LinearLayout for the main content with a ScrollView inside, where multiple small Fragments go into.
The fastest and esaiest way to achieve that is to use ViewPager.
Tutorial -
http://developer.android.com/training/animation/screen-slide.html
Class Ref -
http://developer.android.com/reference/android/support/v4/view/ViewPager.html
To do that, simply apply a gesture detector on the view you wish to swipe. When you detect the gesture, run an animation to move the view off to the right or left and then make it disappear.

Android horizontal page scrolling

So I am making an application that has a "tips" section on a layout. I envision a section on the screen that shows one tip at a time where you can swipe left or right to see the next/previous tip. How would I go about doing that? Is there some builtin widget/layout that will help me with this?
Use a ViewPager from the support library. Here is the documentation: http://developer.android.com/reference/android/support/v4/view/ViewPager.html

How to Add ViewPager Indicator Headings Like Google+ App

My goal is to create a screen similar in function to the Stream page in the Google+ app (picture below for those unfamiliar). For the paging, I am using a custom ViewGroup so that it has smooth transitions that "follow your finger" rather than just snapping to the destination after the fling gesture has been made.
Question
Currently, I am going the route of using some TranslateAnimations to move the headings ("Nearby," "All circles," and "Incoming" in the screenshot) once a new page has been selected. This creates a couple of problems: the center heading doesn't follow the user's finger (as you can see the "All circles" heading does in the screenshot), and if the user begins on a page other than the middle one, I have not found an easy way to offset all of the animations temporarily without running them first since the animations do not move the actual views.
Am I going about this the correct way, or is there a much simpler way of accomplishing this that I am overlooking?
Thanks
After hours of searching and a little luck with search terms, I came across A Google+ like ViewPager page indicator.
I also came across Android ViewPager Indicator, created by the same developer who wrote ActionBarSherlock. Has a ton of examples, and is pretty easy to integrate with the FragmentPagerAdapter.
Google has published his own solution in support library.
Check:
PagerTitleStrip,
PagerTabStrip
Have just used ViewPagerIndicator solution and its very nice and smooth. You can demo the effect by looking at the demo from the Android Market here
I am not 100% sure, but I think it uses the new ViewPager.
Maybe you should look at the API 4+ Support Demos:
FragmentStatePagerSupport.java
FragmentPagerSupport.java

Categories

Resources