TinderLikeCardStack icon indicating copy to clipboard operation
TinderLikeCardStack copied to clipboard

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

Open DongjingZhong opened this issue 4 years ago • 7 comments

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 !

DongjingZhong avatar Aug 14 '21 09:08 DongjingZhong

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 avatar Aug 14 '21 12:08 AsynctaskCoffee

image

its my logcat from example project which is inside library.

AsynctaskCoffee avatar Aug 14 '21 12:08 AsynctaskCoffee

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 . :)

DongjingZhong avatar Aug 14 '21 16:08 DongjingZhong

Let me know what was the problem 🙃

AsynctaskCoffee avatar Aug 14 '21 19:08 AsynctaskCoffee

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 avatar Aug 14 '21 21:08 DongjingZhong

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 !

DongjingZhong avatar Aug 23 '21 11:08 DongjingZhong

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.

AsynctaskCoffee avatar Aug 23 '21 18:08 AsynctaskCoffee