How to disable the ripple effect?












0















I have a layout ConstraintLayout which has multiple children, and one child is having the ripple effect




(android:foreground="attr/selectableItemBackground")



and my parent ConstraintLayout also have the same ripple effect. My question is how to disable the child item ripple effect if the parent is already having the ripple, or any conditional way we can use to disable ripple.



when I click on parent item it shows both ripple parent as well as children.



 <android.support.constraint.ConstraintLayout
android:id="@+id/investment_pack_item_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:onClick="@{(v) -> handlers.onClick(v, obj)}">

<android.support.v7.widget.AppCompatImageView
android:id="@+id/logo_iv"
android:layout_width="@dimen/margin_70dp"
android:layout_height="@dimen/margin_70dp"
android:layout_marginStart="@dimen/padding_layout"
android:layout_marginLeft="@dimen/padding_layout"
android:layout_marginTop="@dimen/padding_layout"
app:imgUrl="@{obj.imageUrl}"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
app:shapeType="@{2}"
tools:src="@tools:sample/avatars" />

<include
android:id="@+id/ivp_item_category"
layout="@layout/ivp_item_category_returns_recycler_item"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@+id/logo_iv"
app:layout_constraintRight_toRightOf="parent"
app:obj="@{obj}"
app:type="@{Constants.OTHER_PACKS}" />

<android.support.constraint.Barrier
android:id="@+id/barrier_ivp_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="ivp_item_category,logo_iv" />

<android.support.v7.widget.AppCompatImageView
android:id="@+id/logo_icon"
android:layout_width="@dimen/icon_height_width_xxsmall"
android:layout_height="@dimen/icon_height_width_xxsmall"
android:src="@mipmap/ic_launcher"
app:imgUrl="@{obj.createdBy.imageUrl}"
app:layout_constraintBottom_toBottomOf="@+id/created_by"
app:layout_constraintLeft_toLeftOf="@+id/logo_iv"
app:layout_constraintTop_toTopOf="@+id/created_by"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
app:shapeType="@{2}"
tools:src="@tools:sample/avatars" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/created_by"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding_layout_8dp"
android:layout_marginLeft="@dimen/padding_layout_8dp"
android:layout_marginTop="@dimen/margin_4dp"
android:layout_marginBottom="@dimen/padding_layout"
android:text="@{obj.createdBy.name}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintLeft_toRightOf="@+id/logo_icon"
app:layout_constraintRight_toLeftOf="@+id/risk_image"
app:layout_constraintTop_toBottomOf="@+id/barrier_ivp_1"
tools:text="Aditya Birla Mutual Fund" />

<android.support.v7.widget.AppCompatImageView
android:id="@+id/risk_image"
android:layout_width="@dimen/margin_16dp"
android:layout_height="@dimen/margin_16dp"
android:layout_marginRight="@dimen/padding_layout_8dp"
app:imgSrc="@{RiskView.getRiskImage(obj.riskType.id)}"
app:layout_constraintBottom_toBottomOf="@+id/risk_type"
app:layout_constraintEnd_toStartOf="@+id/risk_type"
app:layout_constraintTop_toTopOf="@+id/risk_type"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
tools:src="@drawable/ic_transaction" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/risk_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_layout_8dp"
android:layout_marginRight="@dimen/padding_layout"
android:includeFontPadding="false"
android:text="@{obj.riskType.displayName}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/logo_icon"
tools:text="Moderate" />

</android.support.constraint.ConstraintLayout>


Include layout



<android.support.constraint.ConstraintLayout
android:id="@+id/lyt_category_returns_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="@{!type.equals(Constants.OTHER_PACKS)}"
android:foreground="?attr/selectableItemBackground"
android:onClick="@{(v) -> handlers.onClick(v, obj)}"
android:padding="@dimen/padding_layout">

<TextView
android:id="@+id/scheme_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ic_forward"
android:drawableRight="@drawable/ic_forward"
android:drawablePadding="@dimen/margin_6dp"
android:text="@{obj.fundName}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
tools:text="Aditya Birla Mutual Fund" />

<TextView
android:id="@+id/fund_category_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_4dp"
android:background="@drawable/rounded_corner_light_grey_bg"
android:clickable="false"
android:gravity="center"
android:paddingLeft="@dimen/padding_layout_8dp"
android:paddingTop="@dimen/padding_4dp"
android:paddingRight="@dimen/padding_layout_8dp"
android:paddingBottom="@dimen/padding_4dp"
android:text="@{obj.fundCategory}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_xs_small"
android:visibility="@{obj.fundCategory != null ? View.VISIBLE : View.GONE}"
app:layout_constraintTop_toBottomOf="@+id/scheme_name"
tools:visibility="gone" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/minimum_investment_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_8dp"
android:text="@string/minimum_investment"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toStartOf="@+id/category_returns_header"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fund_category_2" />

<TextView
android:id="@+id/minimum_investment_value"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_4dp"
android:text="@{Apputility.getFormattedPrice(obj.minimumInvestment.doubleValue(), true, 0)}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
app:layout_constraintLeft_toLeftOf="@+id/minimum_investment_header"
app:layout_constraintTop_toBottomOf="@+id/minimum_investment_header"
tools:text="₹ 1000" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/category_returns_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{type.equals(Constants.OTHER_PACKS)?@string/schemes:@string/allocation}"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toStartOf="@+id/returns_header"
app:layout_constraintStart_toEndOf="@+id/minimum_investment_header"
app:layout_constraintTop_toTopOf="@+id/minimum_investment_header"
tools:text="@string/schemes" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/allocation_percentage"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_4dp"
android:text="@{type.equals(Constants.OTHER_PACKS)?``+obj.schemeCount:``}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/category_returns_header"
app:layout_constraintTop_toBottomOf="@+id/category_returns_header"
tools:text="60"
tools:visibility="visible" />

<com.ui.common.CategoryReturnProgressView
android:id="@+id/category_return_range"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/padding_2dp"
android:layout_marginEnd="@dimen/margin_30dp"
android:layout_marginRight="@dimen/margin_30dp"
app:categoryReturn="@{obj.allocation}"
app:layout_constraintBottom_toBottomOf="@+id/allocation_percentage"
app:layout_constraintLeft_toRightOf="@+id/allocation_percentage"
app:layout_constraintRight_toLeftOf="@+id/returns_header"
app:layout_constraintTop_toTopOf="@+id/allocation_percentage"
app:min="@{obj.allocation}"
app:visibility="@{!type.equals(Constants.OTHER_PACKS)}"
tools:visibility="gone" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/returns_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{(obj.bucket != null)?obj.bucket:@string/returns}"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/category_returns_header"
app:layout_constraintTop_toTopOf="@+id/minimum_investment_header"
tools:text="Returns"
tools:visibility="visible" />

<TextView
android:id="@+id/returns_value"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_4dp"
android:maxLines="1"
android:minEms="3"
android:textSize="@dimen/text_size_small"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/returns_header"
app:return="@{obj.returns}"
app:returnColor="@{obj.returns}"
tools:text="+36.23%" />

</android.support.constraint.ConstraintLayout>









share|improve this question

























  • kindly share some code XML like what kind of attributes you are using and to be exact what kind of child view we are talking?

    – Muhammad waris
    Nov 15 '18 at 14:24













  • @Muhammadwaris added the XML files which I am using.

    – raja mishra
    Nov 16 '18 at 10:00
















0















I have a layout ConstraintLayout which has multiple children, and one child is having the ripple effect




(android:foreground="attr/selectableItemBackground")



and my parent ConstraintLayout also have the same ripple effect. My question is how to disable the child item ripple effect if the parent is already having the ripple, or any conditional way we can use to disable ripple.



when I click on parent item it shows both ripple parent as well as children.



 <android.support.constraint.ConstraintLayout
android:id="@+id/investment_pack_item_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:onClick="@{(v) -> handlers.onClick(v, obj)}">

<android.support.v7.widget.AppCompatImageView
android:id="@+id/logo_iv"
android:layout_width="@dimen/margin_70dp"
android:layout_height="@dimen/margin_70dp"
android:layout_marginStart="@dimen/padding_layout"
android:layout_marginLeft="@dimen/padding_layout"
android:layout_marginTop="@dimen/padding_layout"
app:imgUrl="@{obj.imageUrl}"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
app:shapeType="@{2}"
tools:src="@tools:sample/avatars" />

<include
android:id="@+id/ivp_item_category"
layout="@layout/ivp_item_category_returns_recycler_item"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@+id/logo_iv"
app:layout_constraintRight_toRightOf="parent"
app:obj="@{obj}"
app:type="@{Constants.OTHER_PACKS}" />

<android.support.constraint.Barrier
android:id="@+id/barrier_ivp_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="ivp_item_category,logo_iv" />

<android.support.v7.widget.AppCompatImageView
android:id="@+id/logo_icon"
android:layout_width="@dimen/icon_height_width_xxsmall"
android:layout_height="@dimen/icon_height_width_xxsmall"
android:src="@mipmap/ic_launcher"
app:imgUrl="@{obj.createdBy.imageUrl}"
app:layout_constraintBottom_toBottomOf="@+id/created_by"
app:layout_constraintLeft_toLeftOf="@+id/logo_iv"
app:layout_constraintTop_toTopOf="@+id/created_by"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
app:shapeType="@{2}"
tools:src="@tools:sample/avatars" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/created_by"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding_layout_8dp"
android:layout_marginLeft="@dimen/padding_layout_8dp"
android:layout_marginTop="@dimen/margin_4dp"
android:layout_marginBottom="@dimen/padding_layout"
android:text="@{obj.createdBy.name}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintLeft_toRightOf="@+id/logo_icon"
app:layout_constraintRight_toLeftOf="@+id/risk_image"
app:layout_constraintTop_toBottomOf="@+id/barrier_ivp_1"
tools:text="Aditya Birla Mutual Fund" />

<android.support.v7.widget.AppCompatImageView
android:id="@+id/risk_image"
android:layout_width="@dimen/margin_16dp"
android:layout_height="@dimen/margin_16dp"
android:layout_marginRight="@dimen/padding_layout_8dp"
app:imgSrc="@{RiskView.getRiskImage(obj.riskType.id)}"
app:layout_constraintBottom_toBottomOf="@+id/risk_type"
app:layout_constraintEnd_toStartOf="@+id/risk_type"
app:layout_constraintTop_toTopOf="@+id/risk_type"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
tools:src="@drawable/ic_transaction" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/risk_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_layout_8dp"
android:layout_marginRight="@dimen/padding_layout"
android:includeFontPadding="false"
android:text="@{obj.riskType.displayName}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/logo_icon"
tools:text="Moderate" />

</android.support.constraint.ConstraintLayout>


Include layout



<android.support.constraint.ConstraintLayout
android:id="@+id/lyt_category_returns_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="@{!type.equals(Constants.OTHER_PACKS)}"
android:foreground="?attr/selectableItemBackground"
android:onClick="@{(v) -> handlers.onClick(v, obj)}"
android:padding="@dimen/padding_layout">

<TextView
android:id="@+id/scheme_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ic_forward"
android:drawableRight="@drawable/ic_forward"
android:drawablePadding="@dimen/margin_6dp"
android:text="@{obj.fundName}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
tools:text="Aditya Birla Mutual Fund" />

<TextView
android:id="@+id/fund_category_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_4dp"
android:background="@drawable/rounded_corner_light_grey_bg"
android:clickable="false"
android:gravity="center"
android:paddingLeft="@dimen/padding_layout_8dp"
android:paddingTop="@dimen/padding_4dp"
android:paddingRight="@dimen/padding_layout_8dp"
android:paddingBottom="@dimen/padding_4dp"
android:text="@{obj.fundCategory}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_xs_small"
android:visibility="@{obj.fundCategory != null ? View.VISIBLE : View.GONE}"
app:layout_constraintTop_toBottomOf="@+id/scheme_name"
tools:visibility="gone" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/minimum_investment_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_8dp"
android:text="@string/minimum_investment"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toStartOf="@+id/category_returns_header"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fund_category_2" />

<TextView
android:id="@+id/minimum_investment_value"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_4dp"
android:text="@{Apputility.getFormattedPrice(obj.minimumInvestment.doubleValue(), true, 0)}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
app:layout_constraintLeft_toLeftOf="@+id/minimum_investment_header"
app:layout_constraintTop_toBottomOf="@+id/minimum_investment_header"
tools:text="₹ 1000" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/category_returns_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{type.equals(Constants.OTHER_PACKS)?@string/schemes:@string/allocation}"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toStartOf="@+id/returns_header"
app:layout_constraintStart_toEndOf="@+id/minimum_investment_header"
app:layout_constraintTop_toTopOf="@+id/minimum_investment_header"
tools:text="@string/schemes" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/allocation_percentage"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_4dp"
android:text="@{type.equals(Constants.OTHER_PACKS)?``+obj.schemeCount:``}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/category_returns_header"
app:layout_constraintTop_toBottomOf="@+id/category_returns_header"
tools:text="60"
tools:visibility="visible" />

<com.ui.common.CategoryReturnProgressView
android:id="@+id/category_return_range"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/padding_2dp"
android:layout_marginEnd="@dimen/margin_30dp"
android:layout_marginRight="@dimen/margin_30dp"
app:categoryReturn="@{obj.allocation}"
app:layout_constraintBottom_toBottomOf="@+id/allocation_percentage"
app:layout_constraintLeft_toRightOf="@+id/allocation_percentage"
app:layout_constraintRight_toLeftOf="@+id/returns_header"
app:layout_constraintTop_toTopOf="@+id/allocation_percentage"
app:min="@{obj.allocation}"
app:visibility="@{!type.equals(Constants.OTHER_PACKS)}"
tools:visibility="gone" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/returns_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{(obj.bucket != null)?obj.bucket:@string/returns}"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/category_returns_header"
app:layout_constraintTop_toTopOf="@+id/minimum_investment_header"
tools:text="Returns"
tools:visibility="visible" />

<TextView
android:id="@+id/returns_value"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_4dp"
android:maxLines="1"
android:minEms="3"
android:textSize="@dimen/text_size_small"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/returns_header"
app:return="@{obj.returns}"
app:returnColor="@{obj.returns}"
tools:text="+36.23%" />

</android.support.constraint.ConstraintLayout>









share|improve this question

























  • kindly share some code XML like what kind of attributes you are using and to be exact what kind of child view we are talking?

    – Muhammad waris
    Nov 15 '18 at 14:24













  • @Muhammadwaris added the XML files which I am using.

    – raja mishra
    Nov 16 '18 at 10:00














0












0








0


1






I have a layout ConstraintLayout which has multiple children, and one child is having the ripple effect




(android:foreground="attr/selectableItemBackground")



and my parent ConstraintLayout also have the same ripple effect. My question is how to disable the child item ripple effect if the parent is already having the ripple, or any conditional way we can use to disable ripple.



when I click on parent item it shows both ripple parent as well as children.



 <android.support.constraint.ConstraintLayout
android:id="@+id/investment_pack_item_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:onClick="@{(v) -> handlers.onClick(v, obj)}">

<android.support.v7.widget.AppCompatImageView
android:id="@+id/logo_iv"
android:layout_width="@dimen/margin_70dp"
android:layout_height="@dimen/margin_70dp"
android:layout_marginStart="@dimen/padding_layout"
android:layout_marginLeft="@dimen/padding_layout"
android:layout_marginTop="@dimen/padding_layout"
app:imgUrl="@{obj.imageUrl}"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
app:shapeType="@{2}"
tools:src="@tools:sample/avatars" />

<include
android:id="@+id/ivp_item_category"
layout="@layout/ivp_item_category_returns_recycler_item"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@+id/logo_iv"
app:layout_constraintRight_toRightOf="parent"
app:obj="@{obj}"
app:type="@{Constants.OTHER_PACKS}" />

<android.support.constraint.Barrier
android:id="@+id/barrier_ivp_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="ivp_item_category,logo_iv" />

<android.support.v7.widget.AppCompatImageView
android:id="@+id/logo_icon"
android:layout_width="@dimen/icon_height_width_xxsmall"
android:layout_height="@dimen/icon_height_width_xxsmall"
android:src="@mipmap/ic_launcher"
app:imgUrl="@{obj.createdBy.imageUrl}"
app:layout_constraintBottom_toBottomOf="@+id/created_by"
app:layout_constraintLeft_toLeftOf="@+id/logo_iv"
app:layout_constraintTop_toTopOf="@+id/created_by"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
app:shapeType="@{2}"
tools:src="@tools:sample/avatars" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/created_by"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding_layout_8dp"
android:layout_marginLeft="@dimen/padding_layout_8dp"
android:layout_marginTop="@dimen/margin_4dp"
android:layout_marginBottom="@dimen/padding_layout"
android:text="@{obj.createdBy.name}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintLeft_toRightOf="@+id/logo_icon"
app:layout_constraintRight_toLeftOf="@+id/risk_image"
app:layout_constraintTop_toBottomOf="@+id/barrier_ivp_1"
tools:text="Aditya Birla Mutual Fund" />

<android.support.v7.widget.AppCompatImageView
android:id="@+id/risk_image"
android:layout_width="@dimen/margin_16dp"
android:layout_height="@dimen/margin_16dp"
android:layout_marginRight="@dimen/padding_layout_8dp"
app:imgSrc="@{RiskView.getRiskImage(obj.riskType.id)}"
app:layout_constraintBottom_toBottomOf="@+id/risk_type"
app:layout_constraintEnd_toStartOf="@+id/risk_type"
app:layout_constraintTop_toTopOf="@+id/risk_type"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
tools:src="@drawable/ic_transaction" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/risk_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_layout_8dp"
android:layout_marginRight="@dimen/padding_layout"
android:includeFontPadding="false"
android:text="@{obj.riskType.displayName}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/logo_icon"
tools:text="Moderate" />

</android.support.constraint.ConstraintLayout>


Include layout



<android.support.constraint.ConstraintLayout
android:id="@+id/lyt_category_returns_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="@{!type.equals(Constants.OTHER_PACKS)}"
android:foreground="?attr/selectableItemBackground"
android:onClick="@{(v) -> handlers.onClick(v, obj)}"
android:padding="@dimen/padding_layout">

<TextView
android:id="@+id/scheme_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ic_forward"
android:drawableRight="@drawable/ic_forward"
android:drawablePadding="@dimen/margin_6dp"
android:text="@{obj.fundName}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
tools:text="Aditya Birla Mutual Fund" />

<TextView
android:id="@+id/fund_category_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_4dp"
android:background="@drawable/rounded_corner_light_grey_bg"
android:clickable="false"
android:gravity="center"
android:paddingLeft="@dimen/padding_layout_8dp"
android:paddingTop="@dimen/padding_4dp"
android:paddingRight="@dimen/padding_layout_8dp"
android:paddingBottom="@dimen/padding_4dp"
android:text="@{obj.fundCategory}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_xs_small"
android:visibility="@{obj.fundCategory != null ? View.VISIBLE : View.GONE}"
app:layout_constraintTop_toBottomOf="@+id/scheme_name"
tools:visibility="gone" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/minimum_investment_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_8dp"
android:text="@string/minimum_investment"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toStartOf="@+id/category_returns_header"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fund_category_2" />

<TextView
android:id="@+id/minimum_investment_value"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_4dp"
android:text="@{Apputility.getFormattedPrice(obj.minimumInvestment.doubleValue(), true, 0)}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
app:layout_constraintLeft_toLeftOf="@+id/minimum_investment_header"
app:layout_constraintTop_toBottomOf="@+id/minimum_investment_header"
tools:text="₹ 1000" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/category_returns_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{type.equals(Constants.OTHER_PACKS)?@string/schemes:@string/allocation}"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toStartOf="@+id/returns_header"
app:layout_constraintStart_toEndOf="@+id/minimum_investment_header"
app:layout_constraintTop_toTopOf="@+id/minimum_investment_header"
tools:text="@string/schemes" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/allocation_percentage"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_4dp"
android:text="@{type.equals(Constants.OTHER_PACKS)?``+obj.schemeCount:``}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/category_returns_header"
app:layout_constraintTop_toBottomOf="@+id/category_returns_header"
tools:text="60"
tools:visibility="visible" />

<com.ui.common.CategoryReturnProgressView
android:id="@+id/category_return_range"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/padding_2dp"
android:layout_marginEnd="@dimen/margin_30dp"
android:layout_marginRight="@dimen/margin_30dp"
app:categoryReturn="@{obj.allocation}"
app:layout_constraintBottom_toBottomOf="@+id/allocation_percentage"
app:layout_constraintLeft_toRightOf="@+id/allocation_percentage"
app:layout_constraintRight_toLeftOf="@+id/returns_header"
app:layout_constraintTop_toTopOf="@+id/allocation_percentage"
app:min="@{obj.allocation}"
app:visibility="@{!type.equals(Constants.OTHER_PACKS)}"
tools:visibility="gone" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/returns_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{(obj.bucket != null)?obj.bucket:@string/returns}"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/category_returns_header"
app:layout_constraintTop_toTopOf="@+id/minimum_investment_header"
tools:text="Returns"
tools:visibility="visible" />

<TextView
android:id="@+id/returns_value"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_4dp"
android:maxLines="1"
android:minEms="3"
android:textSize="@dimen/text_size_small"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/returns_header"
app:return="@{obj.returns}"
app:returnColor="@{obj.returns}"
tools:text="+36.23%" />

</android.support.constraint.ConstraintLayout>









share|improve this question
















I have a layout ConstraintLayout which has multiple children, and one child is having the ripple effect




(android:foreground="attr/selectableItemBackground")



and my parent ConstraintLayout also have the same ripple effect. My question is how to disable the child item ripple effect if the parent is already having the ripple, or any conditional way we can use to disable ripple.



when I click on parent item it shows both ripple parent as well as children.



 <android.support.constraint.ConstraintLayout
android:id="@+id/investment_pack_item_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:onClick="@{(v) -> handlers.onClick(v, obj)}">

<android.support.v7.widget.AppCompatImageView
android:id="@+id/logo_iv"
android:layout_width="@dimen/margin_70dp"
android:layout_height="@dimen/margin_70dp"
android:layout_marginStart="@dimen/padding_layout"
android:layout_marginLeft="@dimen/padding_layout"
android:layout_marginTop="@dimen/padding_layout"
app:imgUrl="@{obj.imageUrl}"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
app:shapeType="@{2}"
tools:src="@tools:sample/avatars" />

<include
android:id="@+id/ivp_item_category"
layout="@layout/ivp_item_category_returns_recycler_item"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@+id/logo_iv"
app:layout_constraintRight_toRightOf="parent"
app:obj="@{obj}"
app:type="@{Constants.OTHER_PACKS}" />

<android.support.constraint.Barrier
android:id="@+id/barrier_ivp_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="ivp_item_category,logo_iv" />

<android.support.v7.widget.AppCompatImageView
android:id="@+id/logo_icon"
android:layout_width="@dimen/icon_height_width_xxsmall"
android:layout_height="@dimen/icon_height_width_xxsmall"
android:src="@mipmap/ic_launcher"
app:imgUrl="@{obj.createdBy.imageUrl}"
app:layout_constraintBottom_toBottomOf="@+id/created_by"
app:layout_constraintLeft_toLeftOf="@+id/logo_iv"
app:layout_constraintTop_toTopOf="@+id/created_by"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
app:shapeType="@{2}"
tools:src="@tools:sample/avatars" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/created_by"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding_layout_8dp"
android:layout_marginLeft="@dimen/padding_layout_8dp"
android:layout_marginTop="@dimen/margin_4dp"
android:layout_marginBottom="@dimen/padding_layout"
android:text="@{obj.createdBy.name}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintLeft_toRightOf="@+id/logo_icon"
app:layout_constraintRight_toLeftOf="@+id/risk_image"
app:layout_constraintTop_toBottomOf="@+id/barrier_ivp_1"
tools:text="Aditya Birla Mutual Fund" />

<android.support.v7.widget.AppCompatImageView
android:id="@+id/risk_image"
android:layout_width="@dimen/margin_16dp"
android:layout_height="@dimen/margin_16dp"
android:layout_marginRight="@dimen/padding_layout_8dp"
app:imgSrc="@{RiskView.getRiskImage(obj.riskType.id)}"
app:layout_constraintBottom_toBottomOf="@+id/risk_type"
app:layout_constraintEnd_toStartOf="@+id/risk_type"
app:layout_constraintTop_toTopOf="@+id/risk_type"
app:placeHolder="@{@drawable/bg_grey_rectangle_rounded_corner}"
tools:src="@drawable/ic_transaction" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/risk_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding_layout_8dp"
android:layout_marginRight="@dimen/padding_layout"
android:includeFontPadding="false"
android:text="@{obj.riskType.displayName}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/logo_icon"
tools:text="Moderate" />

</android.support.constraint.ConstraintLayout>


Include layout



<android.support.constraint.ConstraintLayout
android:id="@+id/lyt_category_returns_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="@{!type.equals(Constants.OTHER_PACKS)}"
android:foreground="?attr/selectableItemBackground"
android:onClick="@{(v) -> handlers.onClick(v, obj)}"
android:padding="@dimen/padding_layout">

<TextView
android:id="@+id/scheme_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ic_forward"
android:drawableRight="@drawable/ic_forward"
android:drawablePadding="@dimen/margin_6dp"
android:text="@{obj.fundName}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
tools:text="Aditya Birla Mutual Fund" />

<TextView
android:id="@+id/fund_category_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_4dp"
android:background="@drawable/rounded_corner_light_grey_bg"
android:clickable="false"
android:gravity="center"
android:paddingLeft="@dimen/padding_layout_8dp"
android:paddingTop="@dimen/padding_4dp"
android:paddingRight="@dimen/padding_layout_8dp"
android:paddingBottom="@dimen/padding_4dp"
android:text="@{obj.fundCategory}"
android:textColor="@color/text_color_dark_grey"
android:textSize="@dimen/text_size_xs_small"
android:visibility="@{obj.fundCategory != null ? View.VISIBLE : View.GONE}"
app:layout_constraintTop_toBottomOf="@+id/scheme_name"
tools:visibility="gone" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/minimum_investment_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_8dp"
android:text="@string/minimum_investment"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toStartOf="@+id/category_returns_header"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fund_category_2" />

<TextView
android:id="@+id/minimum_investment_value"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_4dp"
android:text="@{Apputility.getFormattedPrice(obj.minimumInvestment.doubleValue(), true, 0)}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
app:layout_constraintLeft_toLeftOf="@+id/minimum_investment_header"
app:layout_constraintTop_toBottomOf="@+id/minimum_investment_header"
tools:text="₹ 1000" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/category_returns_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{type.equals(Constants.OTHER_PACKS)?@string/schemes:@string/allocation}"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toStartOf="@+id/returns_header"
app:layout_constraintStart_toEndOf="@+id/minimum_investment_header"
app:layout_constraintTop_toTopOf="@+id/minimum_investment_header"
tools:text="@string/schemes" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/allocation_percentage"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_4dp"
android:text="@{type.equals(Constants.OTHER_PACKS)?``+obj.schemeCount:``}"
android:textColor="@color/text_color_black"
android:textSize="@dimen/text_size_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/category_returns_header"
app:layout_constraintTop_toBottomOf="@+id/category_returns_header"
tools:text="60"
tools:visibility="visible" />

<com.ui.common.CategoryReturnProgressView
android:id="@+id/category_return_range"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/padding_2dp"
android:layout_marginEnd="@dimen/margin_30dp"
android:layout_marginRight="@dimen/margin_30dp"
app:categoryReturn="@{obj.allocation}"
app:layout_constraintBottom_toBottomOf="@+id/allocation_percentage"
app:layout_constraintLeft_toRightOf="@+id/allocation_percentage"
app:layout_constraintRight_toLeftOf="@+id/returns_header"
app:layout_constraintTop_toTopOf="@+id/allocation_percentage"
app:min="@{obj.allocation}"
app:visibility="@{!type.equals(Constants.OTHER_PACKS)}"
tools:visibility="gone" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/returns_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{(obj.bucket != null)?obj.bucket:@string/returns}"
android:textColor="@color/text_color_grey"
android:textSize="@dimen/text_size_very_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/category_returns_header"
app:layout_constraintTop_toTopOf="@+id/minimum_investment_header"
tools:text="Returns"
tools:visibility="visible" />

<TextView
android:id="@+id/returns_value"
style="@style/currencyTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_layout_4dp"
android:maxLines="1"
android:minEms="3"
android:textSize="@dimen/text_size_small"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/returns_header"
app:return="@{obj.returns}"
app:returnColor="@{obj.returns}"
tools:text="+36.23%" />

</android.support.constraint.ConstraintLayout>






android xml android-layout ripple






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 9:58







raja mishra

















asked Nov 15 '18 at 14:13









raja mishraraja mishra

123




123













  • kindly share some code XML like what kind of attributes you are using and to be exact what kind of child view we are talking?

    – Muhammad waris
    Nov 15 '18 at 14:24













  • @Muhammadwaris added the XML files which I am using.

    – raja mishra
    Nov 16 '18 at 10:00



















  • kindly share some code XML like what kind of attributes you are using and to be exact what kind of child view we are talking?

    – Muhammad waris
    Nov 15 '18 at 14:24













  • @Muhammadwaris added the XML files which I am using.

    – raja mishra
    Nov 16 '18 at 10:00

















kindly share some code XML like what kind of attributes you are using and to be exact what kind of child view we are talking?

– Muhammad waris
Nov 15 '18 at 14:24







kindly share some code XML like what kind of attributes you are using and to be exact what kind of child view we are talking?

– Muhammad waris
Nov 15 '18 at 14:24















@Muhammadwaris added the XML files which I am using.

– raja mishra
Nov 16 '18 at 10:00





@Muhammadwaris added the XML files which I am using.

– raja mishra
Nov 16 '18 at 10:00












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53321368%2fhow-to-disable-the-ripple-effect%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53321368%2fhow-to-disable-the-ripple-effect%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python