I'm trying to create a custom actionBar with a different shape (not rectangular) as shown on the image below, does anyone knows point me on the right direction?
At this point, it is no longer an ActionBar. Something like that would be a custom View.
It is missing a number of key components of the ActionBar such as the application icon and back arrow, and is lacking all of an ActionBar's styling.
You can create a completely custom View class and use that, or make a reusable layout and include it wherever needed using an include tag.
Related
I am looking for a custom component to design a circular remote control view like the image below with different button and background color.
Each button should be touchable with proper press effect. I did find a useful library with this I am able to create somewhat similar design but still there are lots of improvement required like Press effect/ Inner and outer circle padding radius etc. Please help me to find the better option for this.
I think tihs is your answer.
You can download here.
https://code.google.com/p/radial-menu-widget/
You could make your own class extending view. You will then be able to override onDraw() and draw whatever you want.
You could also use default android Button with a custom xml selector defined with a different image ressource for pressed/not pressed states.
my app is using using Sherlock action bar.
my designer gave me a new design.
the app logo need to be in the middle
2 action items to the left and 2 actionitems to the right of the logo
the app logo height is 1.5 the size of the actionbar (it suppose to be a little overflow)
is it possible to create a custom layout for the actionbar to implement this desing ?
or should i remove my actionbar and implement the design my own ?
if item #3 will be optional , does it changes your answers ?
Thanks
I'm sorry, but kick your designer in the...
He doesn't get Android at all and shouldn't design for Android. Either it's an ActionBar and then you should treat is as such and you (or your designer) should follow the common pattern on Android, or it is not.
If it is no ActionBar, please do not use an ActionBar (no matter which library) and create a custom design that deviates enough from an ActionBar so as not to confuse users!
Please forward your designer, and your manager to Android design patterns site at http://developer.android.com/design/patterns/actionbar.html . Also tell them that if they want Google to ever feature them, they pretty much have to adhere to these. With all failed use full screen layout and create a custom control on the top
I agree with other answers: that's not an action bar as defined by Android guidelines.
I'll just add that in case you can't go against the design decisions made (yeah, real-world projects sometimes suck and as a programmer you'll have to do what the client asks).
Go with your own implementation. I suggest simply creating a fragment with the appropriate listener interface (a common Android pattern, let the activity implement the interface, set the fragment's listener in onAttach).
If you want to implement this (and I pretty much agree with the other posters, that this is non-standard, and probably shouldn't be done).
You won't be able to create this style ActionBar with the standard APIs (or ActionBarSherlock for that matter) - since your UI is non-standard
You could create a RelativeLayout, with your icon in the center (centerInParent="true"). Then in the same layout, you could create a background, with width set to "fill_parent", and the height to 2/3 the size of your center icon (calculating this value in DP).
Then you can create ImageButtons for your 2 ActionItems to the left and to the right, then just put them in your layout relative to the center icon.
Bottom line, you probably should re-think your UI, to make this more standard to the design patterns specified by Android. If you still want to do it the way your designer asks, you will need to do a custom layout (using a RelativeLayout as I suggested is one way to accomplish the UI you are looking for).
You could create a RelativeLayout, with your icon in the center
centerInParent="true"
Then in the same layout, you could create a background, with width set to fill_parent, and the height to 2/3 the size of your center icon (calculating this value in DP).
I am trying to create a rather radical tab redesign for my Android app. I want the tabs to be differently sized both in width and height, as well as having the focused tab have a shadow over the content as well as other tabs. However, I do not know how to change the height of tabs or the shadow cast by the focused tab. Can anyone help? Here's what I'm trying to achieve:
If you want to customize your Tabhost with your custom style means, you've to customize it. For this case we can do with one feature -
1) Inflating the customized xml file to main TabWidget's using LayoutInflater
2) Do the changes whatever you need in your inflated xml file. For, this please refer below existing answer from stackoverflow. This will surely help you.
Customized TabHost
I want to implement a header which has gradient background and a right icon, as is facebook & foursquared android apps. I couldn't find any tutorials about this.
I looked into foursquared source code but couldn't find how they implement this. If you can show me a way to implement this in that foursquare source code, it would be helpful.
You can take a look at GreenDroid https://github.com/cyrilmottier/GreenDroid.
Just make a custom component that consist of a LinearLayout or RelativeLayout where you set the background of it to your gradient color, and then just add the desired components of the header as child views of your layout.
Then include this layout in all your activities layout at the top.
Check out the iosched app source code. They build an action bar using a style.
Here's the layout for the home activity:
http://code.google.com/p/iosched/source/browse/android/res/layout/activity_home.xml
Here's the include for the action bar:
http://code.google.com/p/iosched/source/browse/android/res/layout/actionbar.xml
Here is the style that defines the action bar:
http://code.google.com/p/iosched/source/browse/android/res/values/styles.xml
I actually want to apply a custom title bar (kind of like the Action Bar), but since i'm developing for Froyo, I actually need to have it in a xml file. The trivial way to do this is to just write the code to create the title bar in each of the activities.
I did search around for some efficient ways and found this on SO
Similar Problem
There are 2 solutions proposed over there, but I am having problems in implementing them.
To include the layout of your title bar in the layout of all the Activities. My question is say I have a sample layout as follows, where should the include tag go and do I need to use Theme.NoTitleBar theme for the application in order to get it working?
To subclass Activity and then derive all of my Activities from that. Should the custom Title bar creation method be defined in the onCreate method of the subclassed Activity. Because if I do this, the custom title bar does appear, but it appears blank. No buttons,etc.. are present on it.
Thanks in advance for any help you provide
The tag belongs inside the top level view container (linear layout/relative layout). Yes use NoTitleBar so you don't have the Android provided title bar in your app window.
There is obviously an issue with your code there, with out any code in your post I cannot help you.