ActionbarSherlock want to insert an image inbetween icon and Tabs - android

I have a tablet layout using ABS.
The Home (app) icon is displayed and my 4 tabs are shown to the right of it.
I'd like to insert an image (for advertising) inbetween the icon and tabs.
Does anybody know if it can be done?
Thanks in advance.

You can't insert an image between the icon and the tabs, but you could:
A. Use a logo drawable which has the icon and ad in it -- then add this by setting the android:logo attribute on your application or activity to your logo drawable.
or
B. Use a custom view and set this on the ActionBar with setCustomView(View view).

Related

How to make the overflow button (the three dots) open settings right away?

I do not want to show a menu for only Settings and About, that's why i want the overflow button to open (immediately when clicked) a unified Settings-About page, the same way Instagram does.
At first i thought i might just do a menu with one action that is set to always Shown and has the overflow button icon (the three dots). But there are a lot of icons for different themes and i also think this wouldn't be correct for devices with a menu button.
Follow this:
Go to style, change your theme DarkActionBar to noActionBar.
Add the android design support to your gradle.
Add toolbar to your xml
Add Imageview or imageviewbutton inside your toolbar
Find the three dot image in drawable using image asset
Add your three dot drawable as src of your imageview.
Set oncClick then intent.

How to change the gap between icon and text?

Picture
To see the picture , please click the link at the top.
Here is a ViewPager + TabLayout。
I use the following code to create the tablayout.
firstTab.setIcon(R.drawable.tab_home_green).setText("HOME");
secondTab.setIcon(R.drawable.tab_explore_grey).setText("EXPLORE");
thirdTab.setIcon(R.drawable.tab_me_grey).setText("MIME");
Now the gap between icon and title is fixed, In the source the gap is private. I want to know how to change the gap value?
How to change the padding of each Tab?
Create and inflate a custom tab's layout.
You can also use view tag in xml for the space between the icon

How to create an icon with overlapping images in android?

In the android app that I am building, I want to create a launcher icon for an album activity. The album activity will be nothing but a grid view displaying all the images.
Now, the launcher icon that I want to build shall show a couple of images partially overlapping one another.
Are there any libraries or standard android views that can help me do this?
Below is how I want the launcher icon to look:
I think (above your discussion ) you want some imageview or imagebutton where your image will set dynamically . when you click this kind of view (icon) it opens another activity ... so you can use layer-list . for more details click

How to make Circular Logo in Action Bar?

My requirement is to make Circular Icon to ActionBar. I used custom view to display circular image(you can see in the screenshot.) I want to use Home icon(In this case, green android icon) as a circular image. How can I make Home icon as a Circular Image??
Note: In my case I'm downloading images from Server and setting it to ActionBar using setLogo() or setIcon() method.
Make the image default logo of your application.
Change it in the manifest file or the drawable folder.
Action bar logo is mostly your application logo by default. So either Change your application logo to circular or whatever. If you want to change the app icon (logo). Use setLogo(int) or setLogo(Drawable) method of ActionBar. Don't forget to call setDisplayUseLogoEnabled(true)

How to make actionbar tab menu with text below the icon?

I have been trying to figure out how to make an actionbar tab menu like the one pictured below. How can I make my tabs display the icon above the text as shown here? When I implement it, it displays the icon to the left of the text. Is there something akin to the compund drawable feature of TextView (android:drawableTop) I can use for the tab?
I am using a custom XML for the Main bar, and actionbarsherlock.
that is the old android tabs view, the new ones have the text on the side next to the image

Categories

Resources