hoang8f / android-flat-button

FButton - a flat button library for Android
Apache License 2.0
1.4k stars 327 forks source link

Android Studio, layout inflating error #19

Open VeeruPV opened 9 years ago

VeeruPV commented 9 years ago

Hey there, I have used this wonderful library before in eclipse. Now i am moving to android studio. I have added the gradle settings and the library is imported and I could even see it in the Android Studios design.

A screenshot where you can see the xml, the design and the logcat error message

image

But it throws inflating exception when i run the project. Here is my layout

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fbutton="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="match_parent" android:paddingLeft="0dp" android:paddingRight="0dp" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" android:background="@drawable/welcome_bg" tools:context="com.mface.mcall.ui.authorization.landing.LandingActivity" > <TextView android:id="@+id/version" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:textColor="@color/almost_black" android:text="@string/app_name" android:textSize="12sp"/>

<info.hoang8f.widget.FButton
    android:id="@+id/btnEmail"
    fbutton:buttonColor="@color/emerald"
    fbutton:shadowEnabled="false"
    fbutton:cornerRadius="0dp"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/version"
    android:text="Sign in @ Email"
    android:textColor="@color/white"
    android:textSize="18sp"
    android:paddingTop="15dp"
    android:paddingBottom="15dp"
    android:layout_marginBottom="15dp"
    android:onClick="showLogin"/>
<RelativeLayout
    android:id="@+id/connect_facebook_button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/btnEmail"
    android:layout_marginTop="10dp"
    android:layout_marginBottom="15dp"
    android:paddingTop="15dp"
    android:paddingBottom="15dp"
    android:background="@color/midnight_blue"
    android:clickable="true"
    android:onClick="connectFacebookOnClickListener">
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:orientation="horizontal">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/button_icon_margin"
            android:src="@drawable/icon_facebook"
            />
        <TextView
            android:id="@+id/connect_facebook_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="Connect With Facebook"
            android:textColor="@android:color/white"
            android:textSize="@dimen/button_text_size"/>
    </LinearLayout>
</RelativeLayout>

<info.hoang8f.widget.FButton  android:id="@+id/btnFacebook"
    fbutton:buttonColor="@color/midnight_blue"
    fbutton:shadowEnabled="false"
    fbutton:cornerRadius="0dp"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/btnEmail"
    android:text="Sign in With Facebook"
    android:textColor="@color/white"
    android:textSize="18sp"
    android:paddingTop="15dp"
    android:paddingBottom="15dp"
    android:layout_marginBottom="15dp"
    android:visibility="gone"/>

<RelativeLayout android:id="@+id/rlNameHolder"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="false"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="176dp"
    android:background="@drawable/rounded_corner"
    android:padding="20dp">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imgAppName"
        android:layout_centerHorizontal="true"
        android:src="@drawable/ic_launcher" />

</RelativeLayout>

Any suggestions?

hoang8f commented 9 years ago

Hi @VeeruPV Could you give me more details of the error's stack trace ? I am using this library With Android Studio and it works fine.