I am trying to reverse the title shadow on a button in android like the implementation in the ios. I have no idea where I should start. Does anyone have any idea?
I think you can make your own style for button, using Android style Widget.Button as parent. I didn't try it, so I don't know if it private style or not. In your style you can define textShadow attributes. More about styles you can read there
Related
I need to change button style from "contained" to "outlined" at runtime.
For now the only way I've found to create an outlined button is to set its style to ?attr/materialButtonOutlinedStyle.
Unfortunately I haven't found a way to change the style at runtime, is it possible?
Is there any way to get this effect?
As a view with text inside, it should have "setTextAppearance" function. It's not the ideal option but may help. Also can be useful to look on https://github.com/airbnb/paris.
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
We can construct and customize border of buttons using drawables.but i just want to know is there any alternative way to set border to new AppCompatButton using new AppCompat libraries through styles or something ? I have surfed for it and i haven't found any documents.So developers, let me know if any tricks to do that.
And problem is the default behavior of AppCompatButton will change if we were setting android:background property and we may need to provide click states too while the AppCompatButton have the click effect by default.
I need to edit default AlertDialog theme so that it will look like part of the design of my app. I don't want to create a whole new theme for it. I will just play with its own properties and make small changes. But the problem is I can't manage to reach the source code and I don't know what kind of attributes it has.
What I need to do is basically to give background a little transparency and roundness.
Does anyone know where can I get the AlertDialog style code? And which attributes do I need to edit for transparency and roundness of background?
Thanks.
Here's the style code for AlertDialog: https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml
I don't know how to change it the way you want though.
I am new to Android app. development. I need to change the existing style at runtime or can create new styles at runtime and I need to apply it for my buttons and textviews..
Can any one suggest me?
There are several methods to do so (most of them are provided by the super class TextView):
setTextColor to change the color of foreground
setTypeface to change the font style
setBackgroundResource(int) to change its backgrond
setPadding to add padding
All of them work for EditText, Button and others, since most of them extends the TextView class. So, my suggestion is: RTFM... just kidding... read the documentation to see the available functions.
Yesterday I was trying to do something similar.
This links gave me enough info:
Building Custom Components
Custom Android Button Style and Theme
Understanding Android Themes And Styles