Remove icon from searchview in ActionBar - android

I am using action bar support v7 library. When I expand search view I get look like this.
I dont want this search icon on left. Instead I want to place it in hint like image below.
I want to do this programmatically. How can I achieve this?
Thanks.

I think I figured out what the answer is.
To expand searchview by default if I use
mSearchView.setIconifiedByDefault(false);
it will show search bar like first image
If I use mSearchView.onActionViewExpanded(); then it shows like second image.

Related

How do I implement a custom bottomnavigation like this

I need to implement a custom bottomnavigation like in the image. My peculiar issue is that when a menu item from the bottomNav is clicked the bottomnav has to reposition the text above and add an image of a dot below it like as shown in the image.
This means that small solutions to selected state like using a custom selector cannot solve this.
Is there a way to inflate a selected layout to show how the bottomNav should look when selected? What methods or other ways do you suggest I tackle this issue?
Try This Git library It's not 100% same as want, but good
https://github.com/iammert/ReadableBottomBar
Ah! Totally forgot to answer this after I solved it.
I was initially showing an Icon and label combination in the bottomnavigation. I was looking for a way to hide the icon on click and show a dot on the bottom which was the wrong way to go and would be complex.
I ended up adding the icon and label as a group drawable vector instead of individually. So for each bottomnavigation option, I had a drawable selector xml with state for selected and unselected.

What would be a good way to show activity title without actionbar?

Im making an app for android, without actionbar.
What is best practice for showing titles without actionbar?
The best practice is basically never using an action bar. This gives you a complete device screen to play with.
You can use images or different text styles for showing the title. You can also use interesting icons.
To remove action bar -
Go to res > values > styles.xml
Here is an illustration of styles file -
You can use the Toolbar (it's like the action bar, but more flexible). For example, action bar needs to be on top of the screen, but toolbar can have place anywhere in the layout.
You title can be shown as text or a beautiful asset.
If, for some reason, you don't want to use the toolbar, you can think about something like having a scrollView with the title on top of it.
Use a regular LinearLayout with a TextView inside. Style according to your needs, and set the text in the xml, or programmaticaly using TextView's setText() method.

The best way to customize a action bar menu?

I'm new in android programming, I want to create the GUI of my app, when making that the action bar must be customized to looks like :
here i have "three" things:
the button shape in the non-clicking state.
the button shape in the clicking state.
the buttons separator shape.
while searching i found somethings like Android-actionbar and ActionBar-Sherlock and i'm also familiar with how to customize the action bar and how to add buttons imagess and change it upon clicking, NOW, i don't know if there's is possibility to achieve my work using any of these methods, OR IF NOT, what's the best way.
You should take a look at both these links.
PagerTabStrip
ViewPagerIndicator

Setting custom image view as action bar's menu icon

I would like to add one of the menu icons of the action bar as below.
I need an icon and a bubble on top of that and I need to display a number on that at run time.
Is it possible to do? I have Googled regarding this, but couldn't find exact way to do.
Thanks in advance.
what you want is call "badge"
A simple way to "badge" any given Android view at runtime without having to cater for it in layout.
try this Lib
https://github.com/jgilfelt/android-viewbadger
You will have to define custom layout for your action bar as mentioned in the tutorial here
and to display counter above the Imageview android notification class can be used.

Title Bar like that of Youtube app

I want this type of custom title bar
But can anyone tell me what the portion marked with red is made of? I mean are they tabs or image buttons or something else? Please don't give me links on how to apply a custom title bar, I already know it. But I don't know what the red-marked portion is (tabs or image buttons etc) And how can I have that vertical line between Search and Make Video option (in the portion that's marked red) I'm using Gingerbread.
I tried using search engines but how can I search when I don't know the name of the thing I want to search :s
They are called ActionBar Action Items. See: http://developer.android.com/guide/topics/ui/actionbar.html\
As for dividers, take a look at: ActionBar MenuItem Divider
You should to use ActionBarSherlock.
http://actionbarsherlock.com/
This is for add actionbar in devices android <3.x.

Categories

Resources