I'm not sure a ViewPager is the way to go, but it might.
My goal is to create an App with 3 screens.
A main screen and 2 other screens the are reachable by swiping left and right from the main screen.
i would like to have the screens as Fragments.
I have used a ViewPager, but I would like to get rid of the TabBar, and just stay with the swipe.
I managed to get rid of the Tabs, but the bar remains empty. I want it to be hidden.
Is that possible?
Is there a better way to do it ?
If this question was already answered, I have failed to find it and will appreciate redirection as well.
Thanks a lot,
Giora.
In your AnsroidStudio layout screen, go to the "Design" tab. Click on the theme option and select a theme with "NoActionBar.FullScreen" AFAIK ViewPager does not have any TabBar by default.
Related
I'm using Appcelerator's Titanium Alloy to work on an app that features both a tab-group on the bottom of the screen and a toolbar on the top of the screen. These both will appear after login, and won't change until logged out. I have been able to create both the tab-group and the toolbar, but am having trouble having them both on the screen.
The toolbar that I'm going for is something similar to this:
How to create a header bar with buttons in Titanium JS?
Just a guess, but I think the views of the tab-group and the toolbar are getting overlapped with one another. As such, I'm only able to see one at a time, always the one I set second (i.e. it is on top of the other bar).
Any help/ideas are greatly appreciated.
Thank you!
Edit:
I've looked into adjusting the leftNavButton and rightNavButton properties, but to use this method would require each individual tab to be adjusted, instead of the entire tab group. I'd like to find a way to add these buttons universally, as the top and bottom bars do not change with different views.
You can use the rightNavButtons and leftNavButtons properties of the windows to add buttons to the navigationBar that is showing at the top of the screen in a tabgroup.
So I have a really simple app (picture below). I am using tabs and the scrolling (via swipe or by clicking the tabs) but I was wondering if I could possible change the size of the tabs somewhat dynamically.
For instance, "Home" doesn't need to be as big as "Most Recent", and there is a 4th tab that you cannot see on the screen that would ideally be seen if the tabs were smaller.
How could I go about this? I Googled around but I could not find anything relevant that seemed to work.
You can use title strips instead of tabs to solve this problem pretty easily:
http://developer.android.com/training/implementing-navigation/lateral.html#PagerTitleStrip
I've set up a ViewPager in my App with tabs, but I need to position the tabs underneath a button so the layout would be
TitleBar
Button to search activities on a day
Tabs of each day there are activities
Is that kind of layout possible to do using Tabs or will I need a different approach to solve this?
The way the activity is running is theres a main activity, and the layout is just the button and a FrameLayout, and the the list (where the ViewPager is) is set up in a fragment and the fragment is loaded into the FrameLayout. I don't know if this is the best method for this so if not please add your recommendations of a better method I could use.
EDIT: If I could get it so all the tabs were at the bottom of the screen this would also be fine.
Is that kind of layout possible to do using Tabs
Not with action bar tabs. Not only can you not control where the tabs go, you cannot even control if there will be tabs versus a drop-down list.
will I need a different approach to solve this?
You are welcome to use some other tab solution (ViewPager with a tabbed indicator, FragmentTabHost, etc.) where you have more control.
Note that your proposed design does not adhere to Android design aesthetics. Most apps would not have "Button to search activities on a day", but instead a search action bar item, or perhaps a SearchView in the action bar.
If I could get it so all the tabs were at the bottom of the screen this would also be fine.
This is completely against the Android design guidelines. Don't use bottom tab bars on Android.
I'm scratching my head to find the correct way to implement a dynamic sliding/expanding menu (not sure the name is correct though) in android.
An image showing what i'm trying to achieve :
(source: teneuesdigital.com)
In the image you can see the ipad version behind has an expandable menu. when you click in an item in the root menu, it automatically expands to the right, displaying the sub-menu items. This is repeatable for each sub-menu : each time a new sub-menu appears to the right.
Now, I'm designing this app for both tablets and phones. So the idea is that on tablets the menu would expand to the right, filling the available screen space, BUT on phones, the currently displayed menu ( ListView) should be replaced by the clicked Sub-Menu's List.
I started playing with fragments and ListFragment without success...
I guess fragments are the way to go (but I could be wrong) since the layout is completely different depending on the screen size.
For the Tablet version :
My idea would be to first display the root menu as a first ListFragment, then when an item is clicked, have a new Fragment created and sliding to the right of the first. Would that work ? How would you do it?
For the phone (mdpi) version :
The currently displayed menu fragment is always replaced with the sub-menu fragment ... I guess that's easy enough with fragment transactions.
Now another question I'm asking myself is how do I implement this in the same activity ?
Do I need to detect screen resolution to manage the different FragmentTransaction types depending if we have to expand the menu or replace the currently visible one?
How can this be done in an efficient way?
Many thanks for all your ideas and comments.
As an idea, you can use ListViews with Visibility:gone in A Realtive layout, Or Expandable ListView. I implemented the first one & it is the simplest.
Previously I wanted to use Tabs on top of the page using TabActivity.
As I am working with Honeycomb I used Action Bar Tabs. That worked best for me.
Now, I want to use tab to on Login page, so that user can Log in two diff ways. For this, I thought I will put Tabs at the top of Login layout (center of the page and not top of the page).
Can I do that ? How?
you can have a tabhost with multiple views and even multiple activities in each tab.
Here is a tutorial : http://joshclemm.com/blog/?p=59
The tab host doesn't have to occupy the whole screen you can have something else on top, I sometime put a textview with the title.