kikoso / Swipeable-Cards

A native library providing a Tinder-like cards effect. A card can be constructed using an image and displayed with animation effects, dismiss-to-like and dismiss-to-unlike, and use different sorting mechanisms.
Apache License 2.0
1.48k stars 364 forks source link

Button is not properly rendered. #59

Open datomnurdin opened 9 years ago

datomnurdin commented 9 years ago

As per subject, I show up all four buttons properly in std_card_inner.xml. (ignore the tabbar).

My code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:id="@+id/global_container"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="#efefef">

    <TextView
        android:id="@+id/title"
        style="@android:style/TextAppearance.Large.Inverse"
        android:textColor="@android:color/primary_text_light"
        android:textSize="24sp"
        android:textStyle="bold"
        android:fontFamily="sans-serif-condensed"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@color/card_bg"
        tools:text="Title"
        android:padding="10dp"/>

    <View
        android:id="@+id/divider_title"
        android:layout_width="fill_parent"
        android:layout_height="2dp"
        android:layout_below="@id/title"
        android:background="@color/card_outline"
        />

    <ImageView
        android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/divider_title"
        android:layout_alignWithParentIfMissing="true"
        android:scaleType="centerCrop"
        tools:src="@drawable/picture1"/>

    <View
        android:id="@+id/divider_bottom"
        android:layout_width="fill_parent"
        android:layout_height="2dp"
        android:layout_below="@id/image"
        android:background="@color/card_outline" />

    <View
        android:layout_width="fill_parent"
        android:layout_height="10dp"
        android:layout_alignBottom="@+id/image_1"
        android:layout_below="@+id/divider_bottom"
        android:background="@color/card_bg"
        />

    <TextView
        android:id="@+id/description"
        style="@android:style/TextAppearance.Inverse"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/image_2"
        android:layout_alignParentLeft="true"
        android:layout_below="@id/image"
        android:layout_toLeftOf="@+id/btn_sep_1"
        android:gravity="center_vertical"
        android:fontFamily="sans-serif-condensed"
        android:ellipsize="end"
        android:padding="10dp"
        android:lines="1"
        android:textColor="@android:color/secondary_text_light"
        tools:text="This is the description, it is a long description, as you can see"/>

    <LinearLayout
        android:id="@+id/like_dislike"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/description"
        android:background="@android:color/white"
        android:gravity="center"
        android:orientation="horizontal"
        android:padding="10dp" >

        <ImageView
            android:id="@+id/undo"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginRight="10dp"
            android:src="@drawable/undo_50" />

        <ImageView
            android:id="@+id/like"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginRight="10dp"
            android:src="@drawable/like_50" />

        <ImageView
            android:id="@+id/dislike"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginLeft="10dp"
            android:src="@drawable/dislike_50" />

        <ImageView
            android:id="@+id/info"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginLeft="10dp"
            android:src="@drawable/info_50" />

    </LinearLayout>
</RelativeLayout>

My output

screenshot_2015-05-19-10-37-14

What I want is like this

o7lxn

Please advice. Thank you.

Reference: http://stackoverflow.com/questions/25967748/swipe-to-choose-android