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

These buttom is not able to get the according user's information #4

Open
DongjingZhong opened this issue Aug 14, 2021 · 7 comments
Open

Comments

@DongjingZhong
Copy link

HI my friend ,during these days ,I was testing your project ,you did an awesome job ,it is so great and beautiful. However ,I have noticed these bottoms ,as follow : the cancle botttom ,shake bottom ,like bottom
image

They can't get the information of the user ,like their user image etc ..
I think that it will awesome if these buttoms can catch these information also .I was trying so many times myselft to modify it but faild ..Is it possible you can take a try of it ?

Thank you so much for your kindly help and patience !

@AsynctaskCoffee
Copy link
Owner

Hi, you can reach models properties from onItemShow callback method. !!You need to cast model as yours!!

override fun onItemShow(position: Int, model: Any) {
        Log.e("SwipeLog", "onItemShow pos: $position model: " + (model as MainTestModel).toString())
    }

I have tested these functions, they work.

@AsynctaskCoffee
Copy link
Owner

image

its my logcat from example project which is inside library.

@DongjingZhong
Copy link
Author

Hi, you can reach models properties from onItemShow callback method. !!You need to cast model as yours!!

override fun onItemShow(position: Int, model: Any) {
        Log.e("SwipeLog", "onItemShow pos: $position model: " + (model as MainTestModel).toString())
    }

I have tested these functions, they work.

Hello my friend ,Thank you so much for your tips .I will take a try . :)

@AsynctaskCoffee
Copy link
Owner

Let me know what was the problem 🙃

@DongjingZhong
Copy link
Author

The problem is ,those bottom can't retrieve the information of every user while swipe the card .I get inspired after your tips.I will try it out again if i can't let those buttons retrieve the information of users.As i am study programming by my own ,it is a bit difficult for me .If I finally make it ,i will share it here later. Thank you so much bro !

@DongjingZhong
Copy link
Author

Hi friend ,sorry to disturb you again .I was actually tring to let these three bottom catch the user information ,like I mentioned before .
image

Last time ,you inspired me that make my own model to catch the user information .I did try ,and I realized that according to your CardListener.kt : fun onItemShow(position: Int, model: Any) this function is what I need . Let me try to explain to you better -----my idea is ,when the user click the "Like" button
image
the logcat is able to get the information of which user been liked,you are able to get the information like (userImage,userName, etc) ..

I actually try very hard on this .But dosen't success .And I have no choice to ask help from you .I like this design very much ,and I would love to use it in my own project . Because I study programming by my own ,therefore sometimes ,I might lack of some knowledage to solve the problem .I am very thankful that you share this awesome project to the public . I would like to know is it possible that you can append about how to let these three buttons
image
catch the onShowItem information (userImage ,userName etc )please ,thank you so much for your patience and your kindness .My best wishes to you !

@AsynctaskCoffee
Copy link
Owner

Hello again bro, could you please upload your code on GitHub and send me your invite on [email protected]. We may code together if you want.

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

2 participants