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

Cards over fave/pass buttons #46

Open yacxn opened 9 years ago

yacxn commented 9 years ago

I need to make the card containers above the buttons.

2015-02-27 14 06 59

This is the fragment main view:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:background="@color/secondary"
    tools:context="assembly.giraff.MainViewFragment$PlaceholderFragment">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/ll_buttons"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="10dp"
        android:layout_centerHorizontal="true"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/pass_button"
            android:layout_width="@dimen/button_size"
            android:layout_height="@dimen/button_size"
            android:src="@drawable/pass"
            android:scaleType="fitCenter"
            android:clickable="true" />

        <ImageView
            android:id="@+id/share_button"
            android:layout_width="@dimen/button_size"
            android:layout_height="@dimen/button_size"
            android:src="@drawable/share"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:padding="@dimen/button_padding"
            android:clickable="true"
            android:background="@drawable/share_button_background"
            android:scaleType="centerInside" />

        <ImageView
            android:id="@+id/fave_button"
            android:layout_width="@dimen/button_size"
            android:layout_height="@dimen/button_size"
            android:src="@drawable/fave"
            android:scaleType="fitCenter"
            android:clickable="true" />

    </LinearLayout>

    <assembly.giraff.andtinder.view.CardContainer
        android:id="@+id/card_container"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="10dp"
        android:clipToPadding="false"
        android:layout_above="@+id/ll_buttons" />

</RelativeLayout>

Anyone ?

dorinsimina commented 9 years ago

At least starting with 5.0 you can setup the elevation.

aeroechelon commented 9 years ago

@ssh00 You may want to use a FrameLayout. That type of layout is suitable for layering views atop one another.

dimitrireef commented 9 years ago

Hello how did you set transparent background around the adapter layout