Different colored buttons android - 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!!

Related

Is there a way to change DatePickers button style?

Not just DatePicker and TimePicker, but a lot of dialogs I use from third party libraries look like this ever since I switched to material design:
Even when using android themes like HoloDark. I've tried changing buttonBarPositiveButtonStyle in the style and a few more related attributes, but none work. I assume the issue is they're using material buttons now which use different styling. But has anyone figured out a way to fix this? Thanks
EDIT: Just to clarify the issue is the button background being right next to eachother and not being transparent. Either adding a slight margin or making the buttons transparent will do for me
you can use your customButton and applay custombutton style
Turns out adding
<item name="android:buttonBarPositiveButtonStyle">#style/Widget.MaterialComponents.Button.TextButton.Dialog</item>
to my theme fixed the issue

Lower case Action Buttons in Android (default/not-custom) Notification

Is there a way to make the buttons on an Android notification lowercase (instead of all capitals), without building a custom notification 'from scratch'?
In this example, the "REPLY" and "ARCHIVE", would become "Reply" and "Archive":
https://i.stack.imgur.com/TW17I.png
Edit
So I don't really know what I am doing here. But one thing that I tried, was to modify various style templates (50+, basically every single one I thought might be involved), to look like this
<style name="TextAppearance.Compat.Notification" parent="#android:style/TextAppearance.StatusBar.EventContent">
<item name="android:textAllCaps">false</item>
</style>
This did not work. However, because I do not know what I am doing exactly, I may have made a mistake. Any advice on this approach is also appreciated.
Lower case is now supported from Android 11, just provide the text in the desired form to NotificationCompat.Action() and the rest will be done by android.

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.

Bigger text icons in Action bar

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

Weird Text overlapping issue

Hi StackOverflow members,
I was playing around with the Open WordSearch project and I applied a custom ttf font and changed a phew things and now I get a weird overlapping of next words on top of previous words I tested the original code and it does not do this. I even reversed all my changes I could think of and it still happens. I experienced this same issue on another project too. It was not happening on my Desire HD buy I found it only on the emulator. Has anybody ever came across this issue? For the life of me I can not figure out were or how it is happening I cant even provide the code for it. Any help would be greatly appreciated.
Best Regards
Jason
I found the problem code this theme resource
<resources>
<style name="Theme.NoBackground" parent="android:Theme">
<item name="android:windowBackground">#null</item>
</style>
</resources>
Do not use this if you have scroll through text objects!

Categories

Resources