I am new programmin in Android.
I am trying to use a tab layout with tabhost. I have a question:
I possible to use the graphical layout interface to design the different tab screens or do I have to do it in the XML layout directly?
Thanks
I always create GUIs writing XML files by hand, without any graphical tool, so I don't have an answer for your question but I have awesome examples for you -- ActionBar Sherlock samples that are AWESOME example how to build tab-based apps:
https://github.com/JakeWharton/ActionBarSherlock/blob/master/samples/fragments/src/com/actionbarsherlock/sample/fragments/FragmentTabs.java
https://github.com/JakeWharton/ActionBarSherlock/blob/master/samples/fragments/src/com/actionbarsherlock/sample/fragments/FragmentTabsPager.java
https://github.com/JakeWharton/ActionBarSherlock/blob/master/samples/demos/src/com/actionbarsherlock/sample/demos/TabNavigation.java
Moreover, you can get all these examples on google play store and try them out without building them yourself!
https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.demos
https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.fragments
I always base my tab-based apps on one of these sample apps. Awesome stuff!
Related
I'd like an example of a step-by-step implementation of this type of menu on Android Wear.
I can not understand the concept of this implementation
It can be in Xamarin or Java.
Documentation:
https://developer.android.com/training/wearables/ui/ui-nav-actions#java
Expectancy:
ndroid
Glad you are enjoying Xamarin!
There's multiple ways of navigating between fragments, regardless if it's a Watch. One of them is using ViewPagers. If you look into the Android documentation, you will find details of how to make it look really cool and fancy with small changes to the ViewPager code.
As far as examples to the Google Wear app that uses ViewPagers, you can take a look at this and some of the other examples of Android wear applications. Let me know if that helps. Btw, you might have more success simply implementing that code (layout/activity_main.xml, SimpleGridPagerAdapter.cs and MainActivity.cs) in your project, than making those projects works since they're old.
Since you are looking for the usage of the android.support.wear.widget.drawer.WearableDrawerLayout, you can take a look at this, particularly at the activity_main.xml. For implementing the WearableDrawerLayout, you have the following
WearableNavigationDrawerView that acts as the top navigation drawer
FrameLayout that contains your fragment
WearableActionDrawerView that acts as your bottom action drawer
PS: I noticed you are looking for Java examples too, this one seems very simple example to follow. You just have to check the Planets.java, MainActivity.java, and activity_main.xml files in that repo
I have been an ecommerce App in android and facing a lot of problem in UI.I am unable to set the navbars , tabs etc properly which is consuming a lot of my time.Is there any tool to generate code based on our layout like we have for web development?
Excuse me if this is a dumb ques, I am new to android
If you use eclipse to develop you have a simple and basic WYSIWYG editor. If you open a xml layout file it will automatically open. It also supports displaying multiple languages at once. And allows for easy change in configuration, like resolution, phone orientation and themes. Using the tabs on the bottom you can switch between xml layout code and the WYSIWYG editor.
But I do recommend practicing with building layouts just from xml, your layouts will most likely be of much better quality than dragging and dropping in any WYSIWYG editor. I use the WYSIWYG editor only for previewing layouts.
Great tutorial for android layouts can be found on the official developers site: http://developer.android.com/guide/topics/ui/declaring-layout.html
I want to implement two layers of tabs like the image below.
With the use of support library I have been able to make a single layer tab set for all android versions. But since I am new to android and I don't have a good grasp on this I don't know how to make it for two layers.
I need to support Android 2.2 and above.
image from:
Scrollable tabs style in Android
Any help will save some lives here :)
Thanks in advance.
ps: please remember I'm a beginner in Android and explanations may need to go in details :S
I got stuck with Jake Wharton ViewPagerIndicator.
The problem is that when I try to make a Tab indicator - the result I'm getting is extremely different from what I need and I can't get to style it or make it behave as it should.
So, what I ask for is two things:
1) Am I right when I say that TabIndicator is Foursquare-like ViewPagerIndicator? (when all tabs are shown on screen)
2) Can anyone provide me links to some tutorials or samples of using this type of ViewPagerIndicator, cause samples from JWs' site don't want to get working.
Thanks a lot for your attention!
Jake Wharton provides a lot of examples. Have you checked it?
https://github.com/JakeWharton/Android-ViewPagerIndicator
And you can take a preview installing this apk:
https://play.google.com/store/apps/details?id=com.viewpagerindicator.sample&hl=es
moskis is right on about ViewPagerIndicator. Installing that APK helped me a lot when I first started working with it and it is a great library.
However, to answer the first part of your question and what I think you are asking in general, I think ViewPagerIndicator isn't what you need to solve this specific problem. Foursquare's tabs at the top are the standard Android tabs as shown in http://developer.android.com/design/building-blocks/tabs.html.
Standard Android tabs are implemented using a TabHost and TabWidget. There is an official tutorial about creating a tabbed interface at http://developer.android.com/guide/topics/ui/layout/tabs.html
Foursquare achieves a custom look by providing state-list drawables for the tabs and you will probably want to provide your own to get the style that you want for your app.
Note that I don't have access to the Foursquare implementation, but am going off of what I observe whiel using the app. However, I have implemented a tabbed interface for Android in past projects.
The new Youtube app, and the newer version of JuiceDefender, contains a sliding tabbed layout similar to those seen in Windows 7 Phone. This is a UI feature I would like to include in an app I'm am designing but I cannot find any information or tutorials online. Has anyone seen a tutorial on this?
I believe it's implemented as a HorizontalScrollView containing a TabWidget with custom, fixed-width, tab indicator views.
Now, getting the tab content views to be paged horizontally is less easy, and that requires something like adapting Workspace.java in the Launcher.git project in AOSP.
I have found the answer to this question. The Sliding layout I described is a ViewPager, available from the Android Compatibility Package v4, which is available from the SDK installer.
A tutorial for this can be found here :http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-horizontal-view-paging/
Edit
An improvement over the Android Compatibility package is the http://actionbarsherlock.com/ an improvement over the support package that adds more Jelly bean style stuff.
I haven't seen a tutorial like this, but you won't be able to do something like this with just the native widgets as they are. You're really looking at implementing your own custom widgets and views, or at the very least wrapping the included widgets with your own code. Maybe a future api will have such features built in, but at this point you're forced to do everything yourself if you want such an interface.