-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[i117] Extend channel list screen styling (#4944)
* [i117] Extend channel list screen styling * add CHANGELOG
- Loading branch information
Showing
46 changed files
with
578 additions
and
92 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
136 changes: 101 additions & 35 deletions
136
stream-chat-android-ui-components/api/stream-chat-android-ui-components.api
Large diffs are not rendered by default.
Oops, something went wrong.
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
58 changes: 58 additions & 0 deletions
58
...kotlin/io/getstream/chat/android/ui/feature/channels/list/ChannelListFragmentViewStyle.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,58 @@ | ||
/* | ||
* 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.feature.channels.list | ||
|
||
import android.content.Context | ||
import androidx.annotation.Px | ||
import io.getstream.chat.android.ui.R | ||
import io.getstream.chat.android.ui.feature.channels.ChannelListFragment | ||
import io.getstream.chat.android.ui.helper.TransformStyle | ||
import io.getstream.chat.android.ui.helper.ViewStyle | ||
import io.getstream.chat.android.ui.utils.extensions.getDimension | ||
|
||
/** | ||
* Style for [ChannelListFragment]. | ||
* Use this class together with [TransformStyle.channelListFragmentStyleTransformer] to change [ChannelListFragment] styles programmatically. | ||
* | ||
* @property searchInputMarginStart The start margin of the search input. | ||
* @property searchInputMarginTop The top margin of the search input. | ||
* @property searchInputMarginEnd The end margin of the search input. | ||
* @property searchInputMarginBottom The bottom margin of the search input. | ||
*/ | ||
public data class ChannelListFragmentViewStyle( | ||
@Px public val searchInputMarginStart: Int, | ||
@Px public val searchInputMarginTop: Int, | ||
@Px public val searchInputMarginEnd: Int, | ||
@Px public val searchInputMarginBottom: Int, | ||
) : ViewStyle { | ||
|
||
internal companion object { | ||
operator fun invoke(context: Context): ChannelListFragmentViewStyle { | ||
val searchInputMarginTop: Int = context.getDimension(R.dimen.stream_ui_channel_list_search_margin_top) | ||
val searchInputMarginStart: Int = context.getDimension(R.dimen.stream_ui_channel_list_search_margin_start) | ||
val searchInputMarginEnd: Int = context.getDimension(R.dimen.stream_ui_channel_list_search_margin_end) | ||
val searchInputMarginBottom: Int = context.getDimension(R.dimen.stream_ui_channel_list_search_margin_bottom) | ||
|
||
return ChannelListFragmentViewStyle( | ||
searchInputMarginStart = searchInputMarginStart, | ||
searchInputMarginTop = searchInputMarginTop, | ||
searchInputMarginEnd = searchInputMarginEnd, | ||
searchInputMarginBottom = searchInputMarginBottom, | ||
).let(TransformStyle.channelListFragmentStyleTransformer::transform) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.