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

incoming vs outcoming #101

Closed
op27no2 opened this issue Oct 25, 2017 · 9 comments
Closed

incoming vs outcoming #101

op27no2 opened this issue Oct 25, 2017 · 9 comments

Comments

@op27no2
Copy link

op27no2 commented Oct 25, 2017

Ok I must be missing something in the instructions/sample.

How do you set whether a message is incoming vs outcoming before adding it to the adapter?

Thanks!

@remy554
Copy link

remy554 commented Oct 27, 2017

Same here

@remy554
Copy link

remy554 commented Oct 27, 2017

I just found how it works :
When you create your adapter, the first parameter "senderId" has to be the same id that contains the Author object used as the Sender

@a-pool
Copy link

a-pool commented Nov 1, 2017

@remy554 can you show me how to make it works ? i just want to know how to make it right or left. thank you so much.

@op27no2
Copy link
Author

op27no2 commented Nov 2, 2017

Ok, so it works like this - when you create your adapter you give it a tag that is used to subsequently designate a message as 'self' so that it shows up on the self side.

CustomMessageListAdapter adapter = new CustomMessageListAdapter<>("SELF_TAG", imageLoader);

Message mMes2 = new Message("SELF_TAG", mUser2, "message");
adapter.addToStart(mMes2, true);

Message mMes1 = new Message("NOT_SELF", mUser1, "message2");
adapter.addToStart(mMes1, true);

@tusharuit25
Copy link

//0 for self message update message id if you successfully send it to server
Message mMes2 = new Message("0", mUser2, "message");
adapter.addToStart(mMes2, true);
//message id for others
Message mMes1 = new Message(mssageid, mUser1, "message2");
adapter.addToStart(mMes1, true);

@troy379
Copy link
Contributor

troy379 commented Feb 19, 2018

Glad you've figured it out! :)

@troy379 troy379 closed this as completed Feb 19, 2018
@chnouman
Copy link

@tusharuit25 this not working for me.

@ramtintk
Copy link

@tusharuit25 not working, only the colors change, but they stay on the same side

@tusharuit25
Copy link

//0 for self message update message id if you successfully send it to server at the place of userid inside your message model

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

7 participants