mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 22:04:24 +01:00
show future events in filters and hide them when filters are disabled
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
8231e6b35c
commit
9474a02c3a
@ -572,6 +572,10 @@ class ConversationsListActivity :
|
|||||||
AGE_THRESHOLD_FOR_EVENT_CONVERSATIONS
|
AGE_THRESHOLD_FOR_EVENT_CONVERSATIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun showOnlyNearFutureEvents() {
|
||||||
|
adapter?.updateDataSet(nearFutureEventConversationItems, false)
|
||||||
|
}
|
||||||
|
|
||||||
private fun addToNearFutureEventConversationItems(conversation: ConversationModel) {
|
private fun addToNearFutureEventConversationItems(conversation: ConversationModel) {
|
||||||
val conversationItem = ConversationItem(conversation, currentUser!!, this, null, viewThemeUtils)
|
val conversationItem = ConversationItem(conversation, currentUser!!, this, null, viewThemeUtils)
|
||||||
nearFutureEventConversationItems.add(conversationItem)
|
nearFutureEventConversationItems.add(conversationItem)
|
||||||
|
@ -55,7 +55,7 @@ object Migrations {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val MIGRATION_13_14 = object:Migration(13,14) {
|
val MIGRATION_13_14 = object : Migration(13, 14) {
|
||||||
override fun migrate(db: SupportSQLiteDatabase) {
|
override fun migrate(db: SupportSQLiteDatabase) {
|
||||||
Log.i("Migrations", "Migrating 13 to 14")
|
Log.i("Migrations", "Migrating 13 to 14")
|
||||||
addObjectId(db)
|
addObjectId(db)
|
||||||
@ -272,9 +272,7 @@ object Migrations {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun addObjectId(db: SupportSQLiteDatabase) {
|
fun addObjectId(db: SupportSQLiteDatabase) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
db.execSQL(
|
db.execSQL(
|
||||||
"ALTER TABLE Conversations " +
|
"ALTER TABLE Conversations " +
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
package com.nextcloud.talk.ui.dialog
|
package com.nextcloud.talk.ui.dialog
|
||||||
|
|
||||||
import android.app.Dialog
|
import android.app.Dialog
|
||||||
|
import android.content.DialogInterface
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
@ -99,6 +100,10 @@ class FilterConversationFragment : DialogFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.buttonClose.setOnClickListener {
|
binding.buttonClose.setOnClickListener {
|
||||||
|
val noFiltersActive = !(filterState[MENTION] == true || filterState[UNREAD] == true || filterState[ARCHIVE] == true)
|
||||||
|
if (noFiltersActive) {
|
||||||
|
(requireActivity() as ConversationsListActivity).showOnlyNearFutureEvents()
|
||||||
|
}
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,6 +135,14 @@ class FilterConversationFragment : DialogFragment() {
|
|||||||
(requireActivity() as ConversationsListActivity).filterConversation()
|
(requireActivity() as ConversationsListActivity).filterConversation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDismiss(dialog: DialogInterface) {
|
||||||
|
super.onDismiss(dialog)
|
||||||
|
val noFiltersActive = !(filterState[MENTION] == true || filterState[UNREAD] == true || filterState[ARCHIVE] == true)
|
||||||
|
if (noFiltersActive) {
|
||||||
|
(requireActivity() as ConversationsListActivity).showOnlyNearFutureEvents()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val FILTER_STATE_ARG = "FILTER_STATE_ARG"
|
private const val FILTER_STATE_ARG = "FILTER_STATE_ARG"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user