daimajia / AndroidImageSlider

An amazing and convenient Android image slider.
MIT License
5.62k stars 1.66k forks source link

OnClick not working on slider inside CollapsingToolbarLayout #412

Open Mkurbanov opened 5 years ago

Mkurbanov commented 5 years ago

Why OnClicklistener not working inside CollapsingToolbarLayout? My 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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.mkurbanov.lebap_kwartira.ScrollingActivity">
    <android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="256dp"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:layout_collapseMode="parallax"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:titleEnabled="false">

            <com.daimajia.slider.library.SliderLayout
                android:id="@+id/header_slider"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:autofillHints="true"
                android:background="@color/colorPrimary"
                android:fitsSystemWindows="true"
                app:layout_collapseMode="parallax" />

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/AppTheme.PopupOverlay" />

        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_dug" />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/fab_margin"
        android:src="@drawable/ic_share_black_48dp"
        android:tint="@color/colorPrimary"
        app:backgroundTint="@color/white"
        app:layout_anchor="@id/app_bar"
        app:layout_anchorGravity="bottom|end"
        app:rippleColor="@color/colorPrimary" />

    <Button
        android:id="@+id/button_call"
        android:layout_width="match_parent"
        android:layout_height="35dp"
        android:layout_alignParentBottom="true"
        android:layout_gravity="bottom|center"
        android:layout_margin="10dp"
        android:background="@drawable/btn_empty_solid"
        android:foreground="?attr/selectableItemBackground"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:text="@string/call"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="@color/white"
        android:textSize="@dimen/text_size" />

</android.support.design.widget.CoordinatorLayout>`