mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-12-18 06:32:08 +03:00
hide archivedFilterChip when capability is not available
Otherwise it would be shown for older NC versions without to be useful Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
6092523146
commit
2a2f8a8148
1 changed files with 10 additions and 1 deletions
|
@ -22,6 +22,8 @@ import com.nextcloud.talk.conversationlist.ConversationsListActivity
|
||||||
import com.nextcloud.talk.databinding.DialogFilterConversationBinding
|
import com.nextcloud.talk.databinding.DialogFilterConversationBinding
|
||||||
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
||||||
import com.nextcloud.talk.users.UserManager
|
import com.nextcloud.talk.users.UserManager
|
||||||
|
import com.nextcloud.talk.utils.CapabilitiesUtil.hasSpreedFeatureCapability
|
||||||
|
import com.nextcloud.talk.utils.SpreedFeatures
|
||||||
import com.nextcloud.talk.utils.UserIdUtils
|
import com.nextcloud.talk.utils.UserIdUtils
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ -104,7 +106,14 @@ class FilterConversationFragment : DialogFragment() {
|
||||||
private fun setUpChips() {
|
private fun setUpChips() {
|
||||||
binding.unreadFilterChip.isChecked = filterState[UNREAD]!!
|
binding.unreadFilterChip.isChecked = filterState[UNREAD]!!
|
||||||
binding.mentionedFilterChip.isChecked = filterState[MENTION]!!
|
binding.mentionedFilterChip.isChecked = filterState[MENTION]!!
|
||||||
binding.archivedFilterChip.isChecked = filterState[ARCHIVE]!!
|
|
||||||
|
binding.archivedFilterChip.visibility = View.GONE
|
||||||
|
userManager.currentUser.blockingGet().capabilities?.spreedCapability?.let {
|
||||||
|
if (hasSpreedFeatureCapability(it, SpreedFeatures.ARCHIVE_CONVERSATIONS)) {
|
||||||
|
binding.archivedFilterChip.visibility = View.VISIBLE
|
||||||
|
binding.archivedFilterChip.isChecked = filterState[ARCHIVE]!!
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun processSubmit() {
|
private fun processSubmit() {
|
||||||
|
|
Loading…
Reference in a new issue