hi, i'm a newbie. i made this app for 4.0.3 that has some spinners an textviews. it looks fine - everything has a black background.

my target phone is a 2.3.3. spinner has grey/and white backgrounds. changing the background color works for the dropdown view and for the text view on the spinner, but not for the spinner itself. i belive this is because they us 9patches or something.

looking in the platforms file and doing some diffs (please see below), it seems that the most of the xml files are the same except for one small difference. also the level 15 api has some extra files.

is it possible to somehow make my app use these level 15 files (just for the spinners) on a level 10 platform?

or is there a way to use a darker theme on the 2.3.3?

thanks

diff ./android-10/data/res/drawable/search_spinner.xml ./android-15/data/res/drawable/search_spinner.xml

./android-10/data/res/drawable/spinner_background.xml ./android-15/data/res/drawable/spinner_background.xml

./android-10/data/res/drawable/spinner_dropdown_background.xml ./android-15/data/res/drawable/spinner_dropdown_background.xml

./android-10/data/res/layout/simple_spinner_dropdown_item.xml ./android-15/data/res/layout/simple_spinner_dropdown_item.xml
25c25
<     android:layout_height="?android:attr/listPreferredItemHeight"
---
>     android:layout_height="?android:attr/dropdownListPreferredItemHeight"

./android-10/data/res/layout/simple_spinner_item.xml ./android-15/data/res/layout/simple_spinner_item.xml
22c22
<       style="?android:attr/spinnerItemStyle"
---
>     style="?android:attr/spinnerItemStyle"

file: ./android-15/data/res/drawable/spinner_ab_holo_dark.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android";>
    <item android:state_enabled="false"
          android:drawable="@drawable/spinner_ab_disabled_holo_dark" />
    <item android:state_pressed="true"
          android:drawable="@drawable/spinner_ab_pressed_holo_dark" />
    <item android:state_pressed="false" android:state_focused="true"
          android:drawable="@drawable/spinner_ab_focused_holo_dark" />
    <item android:drawable="@drawable/spinner_ab_default_holo_dark" />
</selector>

file: ./android-15/data/res/drawable/spinner_ab_holo_light.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android";>
    <item android:state_enabled="false"
          android:drawable="@drawable/spinner_ab_disabled_holo_light" />
    <item android:state_pressed="true"
          android:drawable="@drawable/spinner_ab_pressed_holo_light" />
    <item android:state_pressed="false" android:state_focused="true"
          android:drawable="@drawable/spinner_ab_focused_holo_light" />
    <item android:drawable="@drawable/spinner_ab_default_holo_light" />
</selector>

file: ./android-15/data/res/drawable/spinner_background_holo_dark.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android";>
    <item android:state_enabled="false"
          android:drawable="@drawable/spinner_disabled_holo_dark" />
    <item android:state_pressed="true"
          android:drawable="@drawable/spinner_pressed_holo_dark" />
    <item android:state_pressed="false" android:state_focused="true"
          android:drawable="@drawable/spinner_focused_holo_dark" />
    <item android:drawable="@drawable/spinner_default_holo_dark" />
</selector>

file: ./android-15/data/res/drawable/spinner_background_holo_light.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android";>
    <item android:state_enabled="false"
          android:drawable="@drawable/spinner_disabled_holo_light" />
    <item android:state_pressed="true"
          android:drawable="@drawable/spinner_pressed_holo_light" />
    <item android:state_pressed="false" android:state_focused="true"
          android:drawable="@drawable/spinner_focused_holo_light" />
    <item android:drawable="@drawable/spinner_default_holo_light" />
</selector>



---
co-chair http://ocjug.org/

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to