-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[i110] control options icon for each channel (#4928)
* [i110] control options icon for each channel (cherry picked from commit 5d79022) # Conflicts: # stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/channel/list/adapter/viewholder/ChannelListIconProviderContainer.kt # stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/channel/list/adapter/viewholder/ChannelListIconProviderContainerImpl.kt # stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/channel/list/internal/SimpleChannelListView.kt * [i110] fix api-dump & detekt * [i110] add CHANGELOG --------- Co-authored-by: kanat <>
- Loading branch information
Showing
10 changed files
with
150 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
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
24 changes: 24 additions & 0 deletions
24
...tream/chat/android/ui/channel/list/adapter/viewholder/ChannelListIconProviderContainer.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2014-2022 Stream.io Inc. All rights reserved. | ||
* | ||
* Licensed under the Stream License; | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://github.com/GetStream/stream-chat-android/blob/main/LICENSE | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.getstream.chat.android.ui.channel.list.adapter.viewholder | ||
|
||
import io.getstream.chat.android.ui.channel.list.ChannelListView.ChannelOptionIconProvider | ||
|
||
public sealed interface ChannelListIconProviderContainer { | ||
public val getMoreOptionsIcon: ChannelOptionIconProvider | ||
public val getDeleteOptionIcon: ChannelOptionIconProvider | ||
} |
38 changes: 38 additions & 0 deletions
38
...m/chat/android/ui/channel/list/adapter/viewholder/ChannelListIconProviderContainerImpl.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2014-2022 Stream.io Inc. All rights reserved. | ||
* | ||
* Licensed under the Stream License; | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://github.com/GetStream/stream-chat-android/blob/main/LICENSE | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.getstream.chat.android.ui.channel.list.adapter.viewholder | ||
|
||
import com.getstream.sdk.chat.utils.ListenerDelegate | ||
import io.getstream.chat.android.ui.channel.list.ChannelListView.ChannelOptionIconProvider | ||
|
||
internal class ChannelListIconProviderContainerImpl( | ||
getMoreOptionsIcon: ChannelOptionIconProvider = ChannelOptionIconProvider.DEFAULT, | ||
getDeleteOptionIcon: ChannelOptionIconProvider = ChannelOptionIconProvider.DEFAULT, | ||
) : ChannelListIconProviderContainer { | ||
|
||
override var getMoreOptionsIcon: ChannelOptionIconProvider by ListenerDelegate(getMoreOptionsIcon) { realPredicate -> | ||
ChannelOptionIconProvider { channel -> | ||
realPredicate().invoke(channel) | ||
} | ||
} | ||
|
||
override var getDeleteOptionIcon: ChannelOptionIconProvider by ListenerDelegate(getDeleteOptionIcon) { realPredicate -> | ||
ChannelOptionIconProvider { channel -> | ||
realPredicate().invoke(channel) | ||
} | ||
} | ||
} |
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
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
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