This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface PreviousMessageListQuery { | |
hasMore: boolean; | |
isLoading: boolean; | |
limit: number; | |
reverse: boolean; | |
messageTypeFilter: 0 | 1 | 2 | 3; // 0: ALL, 1: USER, 2: FILE, 3: ADMIN | |
customTypeFilter: string; | |
senderUserIdsFilter: Array<string>; | |
load(limit: number, reverse: boolean, callback: messageListCallback): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MessageListActivity extends AppCompatActivity { | |
private RecyclerView mMessageRecycler; | |
private MessageListAdapter mMessageAdapter; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_message_list); | |
mMessageRecycler = (RecyclerView) findViewById(R.id.reyclerview_message_list); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MessageListAdapter extends RecyclerView.Adapter { | |
private static final int VIEW_TYPE_MESSAGE_SENT = 1; | |
private static final int VIEW_TYPE_MESSAGE_RECEIVED = 2; | |
private Context mContext; | |
private List<BaseMessage> mMessageList; | |
public MessageListAdapter(Context context, List<BaseMessage> messageList) { | |
mContext = context; | |
mMessageList = messageList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class ReceivedMessageHolder extends RecyclerView.ViewHolder { | |
TextView messageText, timeText, nameText; | |
ImageView profileImage; | |
ReceivedMessageHolder(View itemView) { | |
super(itemView); | |
messageText = (TextView) itemView.findViewById(R.id.text_message_body); | |
timeText = (TextView) itemView.findViewById(R.id.text_message_time); | |
nameText = (TextView) itemView.findViewById(R.id.text_message_name); | |
profileImage = (ImageView) itemView.findViewById(R.id.image_message_profile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MessageListAdapter extends RecyclerView.Adapter { | |
private Context mContext; | |
private List<BaseMessage> mMessageList; | |
public MessageListAdapter(Context context, List<BaseMessage> messageList) { | |
mContext = context; | |
mMessageList = messageList; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:paddingTop="8dp"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:paddingTop="8dp"> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle" > | |
<!-- View background color --> | |
<solid | |
android:color="#FF6E00" > | |
</solid> | |
<!-- The radius makes the corners rounded --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.sendbird.chattutorial.MessageListActivity"> | |