EditText widget in Android - android

While developing for Android version 4.0 and later, I found that the EditText widget has been modified and the upper half of the textbox has disappeared. Well, that is the way later versions of Android OS represents EditText widget.
My question is, is there any way to get those Gingerbread style EditText in Android 4.0 and later versions? If yes then how to do it?

Apply background to EditText using xml or image by setting android:background tag in xml

i think u r using holo theme for your app..otherwise it will come four side edittext only..in holo theme only no upper half..check it in manifest file..

Related

selector drawable not working when applying on a button

selector drawable xml not working when applying it to a button on the screen, whenever i change the background of the button to the drawable xml the button is not being pressed when i run the app and it's color doesn't change, when i change the background to a static color it returns to it's normal behavior and is press-able, any solutions?
selector xml
activity xml
I got this error in the past and from what I lean is that From Android Studio 4.1 many of the components started using the Material Components And sets up the default theme to be based on Theme.material components.DayNight.DarkActionBar.
And because of this, any Button elements in a layout get turned into MaterialButton, and MaterialButton that ignores android:background.
In my case, I solved this with -
app:backgroundTint="#null" //just need this
android:background="#drawable/background_button"
and if this does not work for you, you can check this answer here, which I used in the past, hope it's helps.

android notification background color is not white on lollipop

As we known that Android lollipop force set the notification background color to white, so we can set the style of TextView according to different sdk version by putting style.xml in folder values-v21.
So here comes my question, on some third party ROMs, for example, the EMUI developed by Huawei tech co., the background of notification is not white(nearly black), by setting style to
android:TextAppearance.Material.Notification.Title
the color of the text is almost black, as a result, we cannot see the text clearly. I had been searching the internet for almost two days but find nothing helps.
I am trying to get the color of the notification background and set the text color dynamically, but I don't know how to accomplish this.
Need your help, thanks a lot.
Ok, so I just use the official API to set the notification info, that would inflate the default notification layout (status_bar_latest_event_content.xml)instead of my custom layout.
The rom changed the default background and text-color of the status_bar_latest_event_content.xml, but it wouldn't (or can't) change the custom layout.
mBuilder.setLargeIcon(combineBitmap).setContentText(notifyString).setSubText("fff");
remove the android:targetSdkVersion="21" from manifest.xml. it will work! and from this there is no prob at all in your apk it just a trick i apply this and i found colorful icon in notification and all features will remain same which u earlier use

Needing a example of how to style an EditText control in the Holo theme to be more like pre Holo

I am trying to more or less copy a PSD that has older controls in it with also using the ActionBar in ICS they like the old style that has the actual box instead of the underline. how would i be able to keep the holo theme and revert a control to the old styles?
Just wanted to show you how i made this happen as quick fix..
http://www.androidworks.com/changing-the-android-edittext-ui-widget
This covers the bases on how to style in depth .. and basically i built my own 9.png files..

How do I change android auto-correct text color?

I'm currently using an EditText field with a grey background. My problem is that when auto-correction happens, you can't see the grey auto-corrected words against the grey background. Is there a way to change the default font used by auto-correct?
You can configure the appearance of pretty much everything by theming your application. That would also be the way to go to customize the appearance of your EditText.
Read the Styles and Themes guide at Android Developers.
I recommend you have a look at the themes.xml file of the emulator of your target platform. It's located in android-sdk/platforms/android-X/data/res/values.

How to create and apply styles through programming in android?

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

Categories

Resources