WebView selector drawable - android

how can I change the focus color/drawable in WebView via Java or XML, that is visible on screen below (the orange thing around href)?

I'm afraid you can't do that. This is the default focus style installed on the phone.
this can only be modified by the website itself using css styling.

Related

Android change look of custom keyboard

I have successfully made a very basic custom keyboard for Android based off of this tutorial. The problem is, this keyboard looks very odd and outdated for Android lollipop:
Image of the current keyboard:
I have been looking at other keyboards such as the default OS keyboard and this one:
And they look much better for Android.
How can I modify the color scheme and style of my keyboard to look better?
It is also worth noting I am making a keyboard that is very similar to the second example (it will just have a few extra buttons).
If you want a lot of control and be able to do things dynamically, I suggest you ditch the xml layout and KeyboardView class and make your own custom keyboard view

How can I change the Android text selection mode theme?

I don't really know what the visual elements are called, I called them text selection mode indicators. Some screenshots, taken from Chrome and Opera on the same android device.
The first is the current theme of the text selection mode indicators (from Chrome, same as my app):
And the desired theme (Opera):
One can see how, within the desired theme, they are large enough to not be useless to anyone not using a stylus.
Any keywords that I can use in researching this myself are more than welcome! :)
it is called text cursor drawable
you can change it easily using a drawable
<EditText
android:id="#+id/rt1"
android:textCursorDrawable="#drawable/cursor_tuy"
.
.
/>

How to get WebView to ignore css

I am trying to load a local HTML page in an Android Webview. This page contains some layouting using CSS. But I also noticed that the Webview has a setBackgroundColor() method in which you can set a background color. however this does not work when the CSS file also set a background color.
Does anyone know how to make the Android Webview to ignore these CSS style when I set my own background color?
What you could do is add style to your page with javascript:
webview.loadUrl("javascript:document.body.style.background = color;");
Call this after you have loaded your url or html.
PS I think if you ignored the CSS you would the get the default white background even if you set setBackGroundColor()
setBackGroundColor is a method that all Views have, that's the only reason WebView has it imo.

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.

Android: Overriding the scrollbar drawable in an application

Is there a way to replace the scrollbar drawable in an application (i.e. I have a customized scrollbar view that I would like to use instead of the default gray scrollbar that comes with the Android framework). I looked through I believe all of the android attributes and none seem to support it (at least the simplest way I know how which I would assume would be setting a drawable to some android attribute).
If not and say it requires a change in the framework, where would I start looking for it (in the framework)?
Thanks
MB
Custom scrollbar thumb:
android:scrollbarThumbHorizontal="..."
android:scrollbarThumbVertical="..."
Custom scrollbar track (scrollbar background):
android:scrollbarTrackHorizontal="..."
android:scrollbarTrackVertical="..."

Categories

Resources