Last active
November 24, 2020 09:42
Star
You must be signed in to star a gist
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
// We are using GridLayoutManager to arrange the items of the RecyclerView in a grid pattern | |
// We are setting span count as 2, so that are grid has 2 rows | |
// We are setting the orientation of the layout as horizontal | |
val remoteViewManager = GridLayoutManager(this, 2, GridLayoutManager.HORIZONTAL, false) | |
// We are using our custom adapter here | |
remoteViewAdapter = RemoteViewAdapter(uidList, mRtcEngine) | |
// We are now referencing the RecyclerView in our XML and then setting the relevant parameters | |
// We are setting hasFixedSize as true since the measurement of the individual items will not dynamically change | |
findViewById<RecyclerView>(R.id.remote_container).apply { | |
layoutManager = remoteViewManager | |
adapter = remoteViewAdapter | |
setHasFixedSize(true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment