I am making a game app and I want to list user's scores descending. I could list scores descending in the leaderboard so far, but what if the users scores are equal? Then I want whoever completed the game in less time to go up in that list. I would like to list users like that : if scores of the user is equal, which user has more time left he will go up
Here is my code :
val query: Query = FirebaseFirestore.getInstance()
.collection("Scores")
.orderBy("score",Query.Direction.DESCENDING)
.limit(50)
val options: FirestoreRecyclerOptions<LeaderModel> = FirestoreRecyclerOptions.Builder<LeaderModel>()
.setQuery(query, LeaderModel::class.java)
.build()
adapter = FBRecyclerAdapter(options)
binding?.recyclerViewLeaderBoard?.adapter = adapter
Any help would be appreciated. Thank you!