|
@@ -52,12 +52,14 @@ import com.nextcloud.talk.models.json.conversations.Conversation
|
|
|
import com.nextcloud.talk.models.json.generic.GenericOverall
|
|
|
import com.nextcloud.talk.models.json.reactions.ReactionsOverall
|
|
|
import com.nextcloud.talk.ui.theme.ServerTheme
|
|
|
+import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
|
|
import com.nextcloud.talk.utils.ApiUtils
|
|
|
import io.reactivex.Observer
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
|
|
import io.reactivex.disposables.Disposable
|
|
|
import io.reactivex.schedulers.Schedulers
|
|
|
import java.util.Collections
|
|
|
+import javax.inject.Inject
|
|
|
|
|
|
@AutoInjector(NextcloudTalkApplication::class)
|
|
|
class ShowReactionsDialog(
|
|
@@ -70,12 +72,19 @@ class ShowReactionsDialog(
|
|
|
private val serverTheme: ServerTheme
|
|
|
) : BottomSheetDialog(activity), ReactionItemClickListener {
|
|
|
|
|
|
+ @Inject
|
|
|
+ lateinit var viewThemeUtils: ViewThemeUtils
|
|
|
+
|
|
|
private lateinit var binding: DialogMessageReactionsBinding
|
|
|
|
|
|
private var adapter: ReactionsAdapter? = null
|
|
|
|
|
|
private val tagAll: String? = null
|
|
|
|
|
|
+ init {
|
|
|
+ NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)
|
|
|
+ }
|
|
|
+
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
binding = DialogMessageReactionsBinding.inflate(layoutInflater)
|
|
@@ -98,7 +107,6 @@ class ShowReactionsDialog(
|
|
|
adapter?.list?.clear()
|
|
|
if (chatMessage.reactions != null && chatMessage.reactions!!.isNotEmpty()) {
|
|
|
var reactionsTotal = 0
|
|
|
- binding.emojiReactionsTabs.setSelectedTabIndicatorColor(serverTheme.primaryColor)
|
|
|
for ((emoji, amount) in chatMessage.reactions!!) {
|
|
|
reactionsTotal = reactionsTotal.plus(amount as Int)
|
|
|
val tab: TabLayout.Tab = binding.emojiReactionsTabs.newTab() // Create a new Tab names "First Tab"
|
|
@@ -139,6 +147,8 @@ class ShowReactionsDialog(
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ viewThemeUtils.colorTabLayout(binding.emojiReactionsTabs)
|
|
|
+
|
|
|
updateParticipantsForEmoji(chatMessage, tagAll)
|
|
|
}
|
|
|
adapter?.notifyDataSetChanged()
|