Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the effect on cardview show behind it #70

Open
Abdelsattar opened this issue Oct 21, 2016 · 7 comments
Open

the effect on cardview show behind it #70

Abdelsattar opened this issue Oct 21, 2016 · 7 comments

Comments

@Abdelsattar
Copy link

when i add it as parent and try it it just show the effect in the border of the card view behind it not the card view itself

@TechnologyMaster
Copy link

hii I had the same problem. have you find solution ?

@TechnologyMaster
Copy link

Hii @Abdelsattar I found solution . in xml file set this attribute card_view:mrl_rippleOverlay="true" . It will do proper effect .

@Hitexroid
Copy link

Hitexroid commented Jun 8, 2017

All part of parent has ripple , we want to set ripple just for cardview with it's radius

@TechnologyMaster
Copy link

@Abdelsattar it's working perfect for me. In adapter item layout card view is used . so this is worked for me. Have you also added this property ? card_view:mrl_rippleInAdapter="true" if set then in adapter it's effect will work. Hope this Help.

@Hitexroid
Copy link

Hitexroid commented Jun 19, 2017

@TechnologyMaster RecyclerView is not an AdapterView

@Hitexroid
Copy link

Hitexroid commented Dec 20, 2017

i have an idea , extend MaterialRippleLayout to CardView instead of FrameLayout

example :
public class MaterialRippleLayout extends CardView {

but it has a problem , It lefts a dot color in your item during scroll !

@Hitexroid
Copy link

Hitexroid commented Dec 20, 2017

i have another idea too 😃👍

Edit this line (777) of MaterialRippleLayout my mean ---> public MaterialRippleLayout create() {

edit it to public CardView create() {

then

remove these lines (805 ~ 811) ---> my mean 👇

layout.addView(child, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));

            if (parent != null) {
                parent.addView(layout, index, params);
            }

            return layout;

then , paste these code 👇

 CardView cardView = new CardView(context);
            cardView.addView(layout);
            layout.addView(child, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));

            if (parent != null) {
                parent.addView(cardView, index, params);
            }

            return cardView;

now in ViewHolder in Adapter

   public static class ViewHolder extends RecyclerView.ViewHolder {
        CardView cardView;
        View yourView;

        public ViewHolder(View itemView) {
            super(itemView);
            cardView = (CardView) itemView;
            MaterialRippleLayout rippleLayout = (MaterialRippleLayout) cardView.getChildAt(0);
            yourView = (ViewGroup) rippleLayout.getChildAt(0);
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants