Accordion / ExpandableListView on Android - android

I'm trying to create an accordion in Android that has the following features:
Slide animation when opening a tab
Alignment to the top when opening a tab
The ability to be used inside a fragment and not inside an activity
Any idea to how to accomplish all these points? I've seen a lot of libraries that however luck of one or more of this points (and I cannot fix the remaining myself :( ).
Any idea? Also pointers to how-to-guides to how to fix the missing points would be really useful! Thanks

If you are interested on how I solved the problem, you can find the code here: https://github.com/filnik/AndroidSmoothAccordion
It is "quick-and-dirty" but it does the job.

Related

Tab layout swipe direction

Can I change the swipe direction of Tabs in TabLayout by code?
It works fine when my device's language is English, But when I change it to Arabic, A lot of tabs disappear and the swipe's direction still the same (to The Right ).
Note: In Manifest file support RTL option is "true".
You can easily change layoutDirection. i had this problem too and fix by :
tabLayout.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
Just try it!
There are two simple steps you need to follow:
Change the rotation of the View pager,
viewpager.setRotationY(180);
Then again change the direction of the fragment container which is the child of viewpager,
recyclerView.setRotationY(180);
The actual problem you facing is the fact, that ViewPager still does not support RTL.
It's well-known and very old issue - you can find it in Google's issue tracker:
ViewPager RTL swipe direction
So far, I haven't seen any successful examples of RLT's implementation. For, example, there's one from Booking.com, but it doesn't work with TabLayout yet. I'd suggest to dig into it and try to fix the issue there, than start writing it from scratch.
UPD: I forked Booking's RtlViewPager and fix it for TabLayout's. Feel free to try it!
This issue is well known and there is no ETA for a fix.
Use this code tabLayout.setTabMode(TabLayout.MODE_FIXED);

Creating swipeable intro in android

I'm looking for a a tutorial or a start for creating swipeable intros like this image for introducing and helping users in using the app, I know it is based on android swipeable views but all the links I found had tabs, and since these kinds of intros are very popular I though maybe there is a better and more forward way to do it.
Thanks very much
Try to use : Android-ViewPagerIndicator lib(https://github.com/JakeWharton/Android-ViewPagerIndicator)
You need to use a ViewPager and a library called ViewPagerIndicator for the small circle at the bottom.

How to create an Google Currents like layout

Does anybody know how the article layout in the Google Currents Android app is built? I'd like to use some very similar layout for my app.
Example:
The first thing which came to my mind was to build up an the layout with a WebView with multicolumn stlye (http://www.w3.org/TR/css3-multicol/). Am I on the right way or is my suspicion completely wrong.
How do I get the page flip through the swipe/fling gesture and how to get the corresponding page indicator at the bottom?
Thanks in advance! :-)
You must use native views android and not webView because it is not efficient. But if you begun on Android you can actually use a webView is a good learning.
However, if you're interreses the layout android http://developer.android.com/ the website is a very good teaching technique. And what is the view of pourfaire text scroll from right to left, I encourage you to use the library ViewPagerIndicator.
I hope I have helped you!

Android 4.0 - Youtubestyled Tabhost - How is that possible?

What I try to do
Hello Guys, I'm creating an app, and I want that it looks nice and simple to control. In my app I got a Tabhost with 3 Tabs. Every Tab is a fragment with diffrent content. Now its the problem, when I switch the tab. I have to do this over a click on the tabhost.
But if you take a look at the Youtube-App on Android 4.0 its possible to switch the tab over a swipe gesture. And exactly here I stuck, how is that possible.
I searched the web, took a look into the Android Documentation, but I didn't really find anything about this topic. So how is that possible to create something like that?
Question
What do I need to do, that I can switch in my tabhost like its done in the Youtube-App. If you have some great tutorials, code snippets or any other tipps, please post them.
Thx for your help in advance.
safari
Pictures
Here you find some pictures to explain better what I'd like to create. They are ordered chronologically.
They are using a ViewPager for that.
ActionBarSherlock samples contains great examples of ViewPager+Fragments tabs:
http://goo.gl/GpbY4

ViewPager with right/left scroll

could somebody help me and give a example of how can I do a viewpager that can be rotated right/left, something like this: http://1.bp.blogspot.com/-0Sjg8-LaZuo/TkxHAPOkAkI/AAAAAAAACgM/VjNo-nK9fuk/s1600/device-2011-08-18-005327.png
thanks!!!
What you need is this http://viewpagerindicator.com/
Best solution I have seen so far.
Archive that you'll find on this site contains both library and example showing how to implement such type of GUI in you app.

Categories

Resources