Bigger text icons in Action bar - android

I have this design to achieve:
but the result I got is this:
As you can see I am asked to create the submit button much larger that it actually is, I've tried setting it as an image with no luck, also I've tried entering it as normal text and manipulate the theme but that didn't work either, I'm using the latest and greatest API 21 .. Lollipop.
here's the code to the item in my menu:
<item
android1:title="submit"
android1:id="#+id/userLoginSubmitActionBar"
app:showAsAction="always|withText"/>

Have you tried using android:actionLayout attribute of the <item> tag? It will let you set a custom layout to be displayed. You could use a TextView and set the text size appropriately :)
As for the arrows, if I am not wrong, < means up navigation while <- means presence of a navigation drawer, right?

This is really a hack I suppose but what the hell, here's my solution to my own contribution,
I've set
<item name="android:actionMenuTextAppearance">
to my own custom theme parenting from
<style name="myStyle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
and the damn thing worked like magic ! haha... thank u guys, really, no need for the drum rolls in the background :D

Related

How to change the the spinner arrow in a drop down button? (the shape and locate)

I have been trying to customize a spinner, i try customize a style and/or write one layout. But in the end of the day i just change the background. the closest I got to what I want was:
<style name="Spinner" parent="Widget.AppCompat.Spinner">
<item name="backgroundTint">#A9292A</item>
</style>
and i only can change the side arrow by set the background.
what i trying to do is kinda like this :
EDIT:
I can do this by made my own layout but, this arrow going to be in all lines of the list and static. the arrow don't change for the down
By auther the style it's just change the backgaund an as i trying to put this arrow for the left side the text wil be above it.And also don't change the direction
Don't need give me the answer in strict way. But i hope a road to get.Can anyone help me? Thanks!

Android - how to put 5 different Smiley in Rating Bar

I am creating a form in which i have to put five different smiley icon in rating bar to get feedback from user.
I tried but at a time only one type of icon is being displaying.
I am trying by changing style in style.xml
<style name="customRatingBar" parent="#android:style/Widget.RatingBar">
<item name="android:progressDrawable">#drawable/ratingstars</item>
<item name="android:minHeight">32dip</item>
<item name="android:maxHeight">32dip</item>
</style>
Please suggest me how could we achieve this in android?
Thanks in advance.
Here is a ratingbar which uses face morphing animation to animate different smiley reactions.
SmileyRating github
You can clearly see that the smiley is changing its reaction slowly.
From my experience with RatingBar I would say ditch it completely and implement your own mechanism for getting the feedback. Maybe a horizontal linear layout with 5 circular buttons?
I had the same problem and the only way I found is to make a LinearLayout with the 5 different faces as elements, and manually control touch position to change faces from selected to unselected, emulating how an old plain android RatingBar works.
I recently made a library out if this implementation, maybe it can help you.
An example of the library working with faces:
Checkout this EmojiRatingBar library.

Different colored buttons android

I want to have 2 different colored buttons for my app. I am currently using this in styles.xml but it applies this theme for the whole app:
<item name="android:colorButtonNormal">#color/primaryColor</item>
I tried using this in the button but it makes no difference,
android:backgroundTint="#color/accentColor"
Please help! I would appreciate clear answers as I cannot find the answer anywhere. Thanks!!

Setting android:windowBackground to #null makes scrolling to smear?

i'm using the sherlock actionbar library in order to support many devices . i have a viewPager which has 3 fragments :
one with a listView , each item has a textView and an imageView
the second has a gridView , each item has a textView and an imageView
the third just has a textView for now.
as i've heard in google IO videos (and since Lint tells me) , it's recommended to have the next style being used for all of the activities:
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="#style/Theme.Sherlock">
<item name="android:windowBackground">#null</item>
</style>
</resources>
this has worked for me on many devices .
however , on the emulator , using version 2.3.3 , and on galaxy nexus , when i scroll (either the viewPager or any of the adapterViews) , everything just smears , so i get a lot of white pixels as if nothing was refreshed.
i've even tried to set android:cacheColorHint="#00000000" for all of my adapterViews , but it still occurs.
what is going on? how can i fix this thing ? i like adding the above since it removes the ugly gradient background of galaxy S3 that appears for every app.
You should only set the background to nul if you cover it with something else. Either:
- Set the background to null in the theme and add a new background in your layout
or
- Set the background in your theme to the color/image you want.

Android application - three questions

I am writing an Android application at the moment, no knowledge of java what so ever, except what I have learnt in the last 5 hours. I've managed to implement a two screens and a nice looking layout.
I have three questions:
How do I set the Action Bar on Honeycomb to be transparent like in the Google Maps application? I want to be able to partially see the background graphic through it.
What code to use to empty five edit texts and a textview on button click? I've read something about a viewgroup, but I have no idea how to implement that...
I have a linearlayout with a tablelayout centred horizontally and vertically inside it, and eleven table rows in that. How do I set a partially transparent black as a sort of fill colour for the tablelayout without ruining the background of the linearlayout? Every time I try to set a fill colour it blacks out the entire background image of the layout surrounding it as well.
Plain english would be preferable because I am so new to this.
Thanks heaps for any replys, have a great day.
For the first question, I think you can do like below:
In the onCreate() method, before the setConentView() add:
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
The Android system will automatically set background fill the whole screen.
create a transparent sharp "mysharp.xml"like below:
<?xml version="1.0" encoding="utf-8"?>
<shape>
<solid android:color="#55000000" />
</shape>
set the action background
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.mysharp));
you can also declare action bar overlay in xml by
<item name="android:windowActionBarOverlay">true</item>
just like here http://developer.android.com/resources/samples/HoneycombGallery/res/values/styles.html
Answer to your 1st question: You can implement a theme on the HoneyComb action bar. Check this link for more info. The color would be something like this: #29000000.
The first hex 2-digit(#29) represents alpha channels of color and set opacity. If value is “00” that means 100% transparent. if value is set it will be opaque, it can be any value in 00 to FF.
More links on styling the Action Bar:
http://android-developers.blogspot.com/2011/04/customizing-action-bar.html
Example project is to be found here:
http://p-xr.com/customizing-the-action-bar-in-honeycomb/
In my Android 3 application I used
// Makes Action Bar Transparent
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
actionBar = getActionBar();
actionBar.setBackgroundDrawable(null);
// END
and now the action bar is 100% transparent, Except for the stuff I add to it of course :)
Cheers

Categories

Resources