6

I need to find what style/theme is used by the webview for the view that pops when the user clicks a combo box in the html page.

enter image description here

On certain phones, the text gets chopped and I need to reduce the text size or allow each line to span multiple lines.

I have tried 5 styles so far, without success:

<style name="teststyle1" parent="@android:style/Widget.DropDownItem.Spinner">
    <item name="android:singleLine">false</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">#FF00FF</item>
    <item name="android:checkMark">@drawable/another_btn_radio</item>
</style>

<style name="teststyle2" parent="@android:style/Widget.TextView.SpinnerItem">
    <item name="android:singleLine">false</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">#FF00FF</item>
    <item name="android:checkMark">@drawable/another_btn_radio</item>
</style>

<style name="teststyle3" parent="@android:style/Widget.DropDownItem">
    <item name="android:singleLine">false</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">#FF00FF</item>
    <item name="android:checkMark">@drawable/another_btn_radio</item>
</style>

<style name="teststyle4" parent="@android:style/Widget.Spinner">
    <item name="android:singleLine">false</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">#FF00FF</item>
    <item name="android:checkMark">@drawable/another_btn_radio</item>
</style>

<style name="teststyle5" parent="@android:style/Widget.Spinner">
    <item name="android:singleLine">false</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">#FF00FF</item>
    <item name="android:checkMark">@drawable/another_btn_radio</item>
</style>

Any help would be greatly appreciated.

Richard Lalancette
  • 2,401
  • 24
  • 29
  • Wait a second ... maybe I am missing something here but you said "... pops when the user clicks a combo box in ***the html page***." Why would you look at ANDROID styling (xml files), if this is on an HTML page (css, html)? – Jack Jul 23 '12 at 14:01
  • The call made by HTML invokes a native view. If you check the screen shot, you can see this is a native picker. – Richard Lalancette Jul 23 '12 at 21:49
  • Do you have an URL for a page that uses that combo box? I am not seeing the native picker that you have on the screenschot on some HTML pages with combo box that I tried with the standard emulator. Is it possible that your phone has implemented a special handling for it? – Joe Jul 24 '12 at 13:14

3 Answers3

1

Allow Multiple lines would be better. If you only set the size. It would be changed if you want to add some words sometime.

1

This change is actually going to be done on the HTML side of things not in android. Use the webkit-appearance CSS tag to specify an appearance style then you can work with the wrapping using CSS.

URL: http://css-infos.net/property/-webkit-appearance

Gimballon
  • 81
  • 7
0

Look at AndroidManifest.xml at the <activity> tag for whichever activity those screens are from. Under the android:theme property is where you set the theme, or in this case find out what the current one is! It looks like it might be Theme.Dark but I'm not sure off the top of my head

Or if you're just trying to change the list items in that view to fit the title, a change of font size is all you need. You can set it in the layout or programmatically in the Activity with:

TextView view = (TextView) findViewById('R.id.your_view');
view.setTextSize(12);
// ^^^ will set font size to 12dp, you can use 'setTextSize(pt,12)' for different units

I'd look at AndroidManifest.xml and look at the activity's theme, it looks like it's a system styling. Source:

http://developer.android.com/guide/topics/ui/themes.html


More Links to look at




Another Stab At This


Is this project on Github? Could you post your logic for the registration view?

Community
  • 1
  • 1
starscream_disco_party
  • 2,816
  • 5
  • 26
  • 42
  • I need the style or a way to find what style is used. I do not have a direct access to the view, since it is the webview that is launching that view. – Richard Lalancette Jul 23 '12 at 19:58
  • You can look in the `AndroidManifest.xml`, find the `` tag that belongs to the `Activity` that the `WebView` is in and see if they have a theme specified with `android:theme="@android:style/Theme.Dark`. So it may look something like this: ``. – starscream_disco_party Jul 23 '12 at 22:10
  • 1
    I also did some digging around for you and found the XML for the Gingerbread Dark Theme. Hope this helps: https://android.googlesource.com/platform/frameworks/base.git/+/724ffc36583ad81d33c5d4d2057ed12eece719ad/core/res/res/values/themes.xml – starscream_disco_party Jul 23 '12 at 22:14
  • I need something along the lines of @android:style/Widget.DropDownItem.Spinner, but I can't put my finger on it :(. Appreciate the effort here JustLikeThat. – Richard Lalancette Jul 24 '12 at 12:44
  • So wait, you want to add a `Spinner` to show loading? Or you need to change the attributes of `@android:style/Widget.DropDownItem.Spinner`? Could you refine your question and append it as an update, please? (what you've done, what you still need or need that you didn't know about) I'll post some more links for you to look at too... – starscream_disco_party Jul 24 '12 at 20:07
  • Appreciate your effort here JustLikeThat. Thank you! We ended giving up on trying to fix this for now. – Richard Lalancette Aug 23 '12 at 14:10
  • Absolutely, I'm sorry I haven't posted anything else on this recently, I hadn't seen the update to your post with the styles you've tried. I'll see if I can figure something out for you in the mean time :) – starscream_disco_party Aug 23 '12 at 15:21