Has anyone managed to bring the items in a V4 PagerTabStrip together, more like Google Play Store?
http://developer.android.com/reference/android/support/v4/view/PagerTabStrip.html
This is what I want:
This is what i get (the space between segments):
These images are not mine but its just to explain what I mean.
Additionally the underline for the Strip, is it possible to have a different color then the selected item underline (v4).
Thanks
Edit: For all those asking if I ever found a solution, I never did. Sorry :-(
I'm also searching the answers to this questions and it seems not exist the api to do such thing in android-support-v4. But as an alternative, we can try this https://github.com/xiaopansky/PagerSlidingTabStrip . Not a perfect but time-saving solution.
So it's been a while on this topic but I believe there are people still searching for this answer so I wanted to put here what I've found.
https://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabStrip.html
On Android's developer website, they have sample code on how to accomplish it yourself. I personally haven't tested it yet so not sure if it supports that exact look and feel or whether it supports customization but at least the code is there for yourself and you can play around with it. I'd really wish that v4 PagerTitleStrip and PagerTabStrip supported the above features by default.
The default PagerTitleStrip has only 3 textviews initialized. So if You wish to remove spacing create a custom PagerTitleStrip class and add more textviews so that space is reduced.
Related
I am building an Android application in which I would like to add a button inside the TabLayout. I understand that it is technically feasible but please confirm if it is the recommended approach in Android.
For the reference, below is the sample screenshot. I am looking for similar implementation but instead of displaying only image, I would like to display a checkbox along with a label.
Please help me understand the recommended approach and also please share if any reference in the official documentation about this.
As there are no answers so far, I would like to share my research's key points.
It is not recommended to use icons or some other buttons within the TabLayout.
The TabLayout should be totally allocated in the full width otherwise the user experience will get negatively impacted when we add more number of tab items.
How can i make the ActionBar Epic as this one ?
Also normally in Google Apps, when we swipe down the action bar actually get shrinked down in size with a beautiful effect, is that effect available for developers? or we have to do it on our own ? And how can we do it?
In this image overhere, there's icon and text above the image, and also a rounded button, i wonder if this sample is documented and i'm missing it, hope guys you'll point that out!
Also how can they add text to the ActionBar??
Hope you'll help! Thanks!
This is all from the new Materials Theme that is going to be available in the next version of Android. You can find out more at the Android L Developer Preview site.
You may use this project available on github to implement your epic actionbar.
Regarding icons/buttons, simply use drawables or 9-patch to get it done.
I am currently trying to get the look of my app right. But I am having problems figuring out how to even set up a way to change themes. For one thing, is there even a way to change styles through code? I checked the method list and I saw nothing. This leads me to my actual question; is there a way that, like CSS, in which you style the parent, and then have it trickle down but also changed depending on the View? I looked at the Android docs, and they did not show any examples of this. Hopefully someone can give me an idea as to how to accomplish this, or if its not possible, to let me know that as well. Thanks in advance.
You should be able to do this using styles and themes. I've implemented this using Jake whartons Sherlock action bar. (I'm not certain if it's necessary) It involves using the comparability library which gives you the ability to use fragments and loaders as well. Look at his democode at http://actionbarsherlock.com/download.html. Look for where themes are mentioned and you will find the information you need. In the demo app you can change the theme in the top right corner and see how it affects the activities look and feel. It also shows many of the features available and the code to write them. I have found this an invaluable resource and it should show you how to theme your app.
I am curious to know if there is anyway I can remove OR change the drop-shadow like effect that android gives below a Tab layout.
As soon as I ask this question, I get the answer in another stackoverflow post. Anyways for the benefit of people who have landed on this post, the answer is to
use a custom theme with its windowContentOverlay set to null
I have been looking for a easy way to add borders to custom made Views (Compounds or whatever), and the only answer I found was that there is no built-in support for that. Instead there are suggestions that you should add Views on top/below the View you want borders on and a bunch of others really messy ways to get borders.
Coming from the .NET-environment that is pretty brutal to have to do ugly workaround and "hacks" to get something as simple as borders.
Thus, I want to suggest that feature to the Android team. I'm not sure how they can have missed it, but it is surely missed =)
So, is there any official way to suggest a feature in the SDK/framework? I have looked around a bit, but can't comment on their blogs, no e-mail addresses as far as I can see.
Put your suggestion at google code.
You can easily create a Drawable subclass that draws whatever border you want and reports the padding for that border, and sets it as the background of the view you want to have drawn with a border. Or set it on a FrameLayout to have the border placed around the other views inside of the frame.
sorry, 8 years later. At the link below there's a Feedback section with a link to Feature Requests
https://source.android.com/source/community.html