bilibili / MagicaSakura

MagicaSakura 是 Android 多主题框架。~ is an Android multi theme library which supporting both daily colorful theme and night theme.
http://app.bilibili.com
Apache License 2.0
3.55k stars 465 forks source link

dataBinding在布局添加TintToolbar运行报错 #65

Open NeVaDaAAA opened 6 years ago

NeVaDaAAA commented 6 years ago

XML: <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".module.home.MainActivity">

<data>

    <variable
        name="viewModel"
        type="com.ani.dylan.peony.module.home.vm.MainViewModel" />
</data>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <com.bilibili.magicasakura.widgets.TintToolbar
        android:id="@+id/main_toolbar"
        style="@style/Widget.App.Toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/theme_color_primary"
        android:elevation="@dimen/dp_4"
        android:fitsSystemWindows="true"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

    <com.ani.dylan.peony.view.CustomViewPager
        android:id="@+id/main_vp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/main_tab"
        android:layout_below="@+id/main_toolbar" />

    <me.majiajie.pagerbottomtabstrip.PageNavigationView
        android:id="@+id/main_tab"
        android:layout_width="match_parent"
        android:layout_height="55dp"
        android:layout_alignParentBottom="true"
        android:background="@color/white" />

</RelativeLayout>

报错信息: Caused by: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class com.bilibili.magicasakura.widgets.TintToolbar Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class com.bilibili.magicasakura.widgets.TintToolbar

换成V7自带的Toolbar就没有问题。 求各位大佬帮忙看看 感激不禁

NeVaDaAAA commented 6 years ago

机型:OnePlus3 Android版本:8.0.0

项目版本: compileSdkVersion: 28, buildToolsVersion: "28.0.2", applicationId : "com.ani.dylan.peony", minSdkVersion : 21, targetSdkVersion : 28, versionCode : 1, versionName : "1.0",

JChunyu commented 6 years ago

遇到了相同的问题

fg2q1q3q commented 5 years ago

建议暂时先换到0.1.8版本(compile 'com.bilibili:magicasakura:0.1.8@aar'),亲测无此问题