I'm want to improve the design of my app. Looking for some patterns, I've found http://www.androidpatterns.com.
For Action Bars pattern, I've found a perfect library (actionbarsherlock.com).
www.androidpatterns.com/uap_pattern/action-bar
i.stack.imgur.com/xODIL.png
But there is a problem my app uses TAbActivy and this actionbarsherlock does't(because this library uses FragmentActivity and its imcompatible with Tabs) work with this, yet.
Now, I wanna apply this patterns. I wanna change Tabs for nice (beaty) buttons.
androidpatterns.com/uap_pattern/segmented-control-2
androidpatterns.com/uap_pattern/slideable-top-navigation
androidpatterns.com/uap_pattern/segmented-control
Follow some actual screenshots of my app:
i.stack.imgur.com/lIfbg.png i.stack.imgur.com/4kMYe.png
To apply this patterns and use actionbarsherlock, what is the best way?
I've found it thow anddev.org/code-snippets-for-android-f33/iphone-tabs-for-android-t14678.html . But I dint like graphs and it load all contect once. It doesnt works like a TabActivity (opens activity separately).
i.stack.imgur.com/y0lEV.png
Related
seems that starting Lollipop the ActionBar "setNavigationMode" method is deprecated. i know that google now offers to use sliding tabs and view pager however I am unable to understand the code completely. is there any alternative that I can use? if there isnt then can someone suggest for a good tutorial on that?
I need to achieve two tabs when each one holds a fragment.
I plan on using the SlidingTabsLayout technique instead of the new ActionBarCompat or Toolbar. It seems you don’t like it when reading from your original post. However there is sample working code at SlidingTabsBasic.
If you download the zip file, you may have to import the project instead of opening it. When you import, find the build.gradle file of the project. So far it seems this is not much difference than the link you posted at Github https://gist.github.com/eluleci/199be9a0d1af42653b5b.
I predict when the new Toolbar is stable, I can integrate some of this code like the ViewPager and PageAdapter.
I am thinking of the same thing since I want to support the new Lollipop. There is a Stackoverflow link at Action bar navigation modes are deprecated in Android L
Let me know what you found or decided. Perhaps we can work together. Have fun!
What is complete replacement of iOS Tabs Replacement in Android.
I Know that Android is Android and we don't Imitate other platforms on Android. I have Studied Pure Android
But All I want to have the replacment of iOS tabs in Android with following features.
1.) Stores Navigation flow for each tab, As in iOS there is navigation controller for each tab and we can have the previous state for each tab while switching from tab to tab.
2.) Desirable but not necessary- Double click on tab button will refresh the view with the root view as per in iOS.
3.) The animation while switching from tab to tab or with in Tab does not swipe the complete Tabs(including the TAB Bar). It means only the content of each Tab should be replaceable with separate Activity or something like this.
4.) In short User Experience must be similar to iOS Tab Bar.
What I have Tried so far.
1.) Added Tabs with TabHost on bottom of screen.But I Haven't got the stack navigation for each Tab separately.
(Something like: https://github.com/AdilSoomro/Iphone-Tab-in-Android)
2.) Also I have an idea of Using Stack (Java Collection Framework.) But that will be a headache to maintain all the stack by my self.
So, Guys In short:
Do you have any ideas of any Third Party Library, that I can use in my project without much problem to achieve all the features mentioned above?
Any help would be appreciated.
Thanks.
This one is best to implement iOS like tabs in Android
Like this:
You can use the native tabs and style it to seem like iOS ones.
Use Fragments, and store/reload the "Natigation flow" at the onPause/onRestore methods in each Fragment or in the FragmentActivity when you change form one fragment to an other.
BTW, please don't do that. If you studied Pure Android, what's the point do you want to achieve? Android is Android and iOS is iOS, do not mix them please.
UPDATE: 3 September 2017
An other, and imho better, approach to do so is make use of the Bottom Navigation. Take a look to materialdocs to learn how to use it.
I am new in Android Development. and going to create a new app. in which i need following type of navigation in Android 2.2 and above.
http://i.stack.imgur.com/wwG1Z.png
I saw a tutorial at http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
But he is Only Swiping Pages. There are no Tabs like In Above image. And also he is updating some text view but i want to switch between activities or layouts.
I have tried many things. ActionBarSherlock it created many errors.
The thing I need is
developer.android.com/training/implementing-navigation/index.html
developer.android.com/shareables/training/EffectiveNavigation.zip
In Above file CollectionDemoActivity is the thing Which I actually looking for Android 2.2 and above.
If someone have project like this please share code.
This is a sample project for using ActionBarSherlock with a ViewPager to have tabs & swipe together. It works, I've used it.
You might want to check out Jake Wharton's other project, Viewpagerindicator. It provides the functionality that you are after. And here is a tutorial for using them together. There are also some excellent guides over at Styling Android.
I have an existing app that is using a Dashboard style pattern where there's a main menu, and clicking icons on the main menu drive start different activities... In order to navigate to a different function, you need to go back to the Dashboard menu and select another icon.
I want to change my application to a tabbed format similar to the one below with Icons:
What type of View is being used below? Is this a FragmentActivity? Also, what is the best approach to go about conversion? I have a bunch of layouts with listviews in linear/relative layouts... Will I be able to reuse any existing code? I want also to be able to use the solution with Android 2.1 and up if possible.
Thanks!
In the image you provided, it looks to be a TabHost that is used (which can be within a normal Activity or a Fragment Activity) and will be available for Android 2.1 and beyond when using the Android Support library. Based upon your description, you most likely have an Activity per each of your items that you will probably want to convert into a different Fragment. This may take a little time, but a Fragment is very similar to a normal activity in many ways, so once you start getting used to it, converting over the old Activities should be a breeze.
If you plan on using these tabs and you follow the Android design UI guidelines, you may want to use the TabHost in conjunction with a ViewPager. There is a great tutorial for this online that also allows for backward compatibility (down to at least 2.1) found here: http://thepseudocoder.wordpress.com/2011/10/13/android-tabs-viewpager-swipe-able-tabs-ftw/
Support library for fragments/viewpager: http://developer.android.com/tools/extras/support-library.html
More info about a TabHost and using Tabs with fragments can be found here:
http://developer.android.com/reference/android/widget/TabHost.html
http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/
You can use TabLayout and a TabActivity to achieve layout in picture. Bad news is these are deprecated as of Android 3.0. Google advises to use fragments instead of these.
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.