简体   繁体   中英

Android Lenovo custom ui

I faced with strange behavior of UI in Android 4.2.1 Lenovo P780 device. It doesn't react on customizing of ActionBar tab style. Also it uses own progress indicator and maybe some other ui widgets.

Below are screenshots from P780 and all other test devices. Styles for ActionBar were generated by http://jgilfelt.github.io/android-actionbarstylegenerator/ . But for Lenovo P780 styles customizing doesn't change anything.

联想设备

所有其他设备-预期行为

Below is a part of Manifest where style was set and styles.xml content

 <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.Example" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

<style name="Theme.Example" parent="@android:style/Theme.Holo">
    <item name="android:actionBarItemBackground">@drawable/selectable_background_example</item>
    <item name="android:popupMenuStyle">@style/PopupMenu.Example</item>
    <item name="android:dropDownListViewStyle">@style/DropDownListView.Example</item>
    <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Example</item>
    <item name="android:actionDropDownStyle">@style/DropDownNav.Example</item>
    <item name="android:actionBarStyle">@style/ActionBar.Solid.Example</item>
    <item name="android:actionModeBackground">@drawable/cab_background_top_example</item>
    <item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_example</item>
    <item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Example</item>
</style>

<style name="ActionBar.Solid.Example" parent="@android:style/Widget.Holo.ActionBar.Solid">
    <item name="android:background">@drawable/ab_solid_example</item>
    <item name="android:backgroundStacked">@drawable/ab_stacked_solid_example</item>
    <item name="android:backgroundSplit">@drawable/ab_bottom_solid_example</item>
    <item name="android:progressBarStyle">@style/ProgressBar.Example</item>
</style>

<style name="ActionBar.Transparent.Example" parent="@android:style/Widget.Holo.ActionBar">
    <item name="android:background">@drawable/ab_transparent_example</item>
    <item name="android:progressBarStyle">@style/ProgressBar.Example</item>
</style>

<style name="ActionBarTabStyle.Example" parent="@android:style/Widget.Holo.ActionBar.TabView">
    <item name="android:background">@drawable/tab_indicator_ab_example</item>
</style>

Lenovo P780 OS/firmware information:

在此处输入图片说明

So finally problem is solved! After migration to new Lollipop support libraries and using styles with AppCompat parent everything works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM