-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Space List Bottom Sheet #6749
Merged
Merged
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ab4eda1
Adds SpacesBottomSheet
ericdecanini 55d8b6a
Merge remote-tracking branch 'origin/develop' into feature/eric/space…
ericdecanini aa24deb
Adds new space list controller
ericdecanini 5d18365
Fixes bug where bottom sheet sometimes renders with the wrong height
ericdecanini b4ed380
Finalises home and add bottom sheet buttons
ericdecanini 79e6dd0
Makes bottom sheet dismiss on space change
ericdecanini ff71e69
Makes space list work inside spaces
ericdecanini 0506c9a
Fixes bottom sheet intermittently not having the correct height
ericdecanini a821f34
Adds drag and drop to space list
ericdecanini 90f2b93
Appends to comment in SpaceListFragment and refactors SpaceListBottom…
ericdecanini 0567fa3
Changes header text of bottom sheet to Change Space
ericdecanini e6508e8
Cleans up epoxy class for NewSpaceSummaryItem and adds ellipsize to h…
ericdecanini 41d859d
Merge remote-tracking branch 'origin/develop' into feature/eric/space…
ericdecanini 1ffa02c
Merge remote-tracking branch 'origin/feature/eric/new_fab' into featu…
ericdecanini 7565707
Adds changelog file
ericdecanini 7b61460
Merge branch 'feature/eric/new_fab' into feature/eric/space-list-modal
ericdecanini 9892c66
Fixes lint errors
ericdecanini 65b7a31
Fixes toMvRxBundle import
ericdecanini f94aad6
Merge branch 'feature/eric/new_fab' into feature/eric/space-list-modal
ericdecanini ddaf539
Removes params passed into HomeRoomListFragment and fixes lint error
ericdecanini e87eefb
Merge remote-tracking branch 'origin/develop' into feature/eric/space…
ericdecanini 358ec5a
Fixes post merge errors
ericdecanini fd37b31
Changes changelog file extension
ericdecanini 8b0fba2
Merge remote-tracking branch 'origin/develop' into feature/eric/space…
ericdecanini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Adds space list bottom sheet for new app layout |
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
69 changes: 69 additions & 0 deletions
69
vector/src/main/java/im/vector/app/features/grouplist/NewHomeSpaceSummaryItem.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,69 @@ | ||
/* | ||
* Copyright 2019 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 im.vector.app.features.grouplist | ||
|
||
import android.content.res.ColorStateList | ||
import android.widget.ImageView | ||
import android.widget.TextView | ||
import androidx.core.content.ContextCompat | ||
import androidx.core.graphics.ColorUtils | ||
import com.airbnb.epoxy.EpoxyAttribute | ||
import com.airbnb.epoxy.EpoxyModelClass | ||
import im.vector.app.R | ||
import im.vector.app.core.epoxy.ClickListener | ||
import im.vector.app.core.epoxy.VectorEpoxyHolder | ||
import im.vector.app.core.epoxy.VectorEpoxyModel | ||
import im.vector.app.core.epoxy.onClick | ||
import im.vector.app.core.platform.CheckableConstraintLayout | ||
import im.vector.app.features.home.room.list.UnreadCounterBadgeView | ||
import im.vector.app.features.themes.ThemeUtils | ||
|
||
@EpoxyModelClass | ||
abstract class NewHomeSpaceSummaryItem : VectorEpoxyModel<NewHomeSpaceSummaryItem.Holder>(R.layout.item_new_space) { | ||
|
||
@EpoxyAttribute var text: String = "" | ||
@EpoxyAttribute var selected: Boolean = false | ||
@EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) var listener: ClickListener? = null | ||
@EpoxyAttribute var countState: UnreadCounterBadgeView.State = UnreadCounterBadgeView.State(0, false) | ||
@EpoxyAttribute var showSeparator: Boolean = false | ||
|
||
override fun getViewType() = R.id.space_item_home | ||
|
||
override fun bind(holder: Holder) { | ||
super.bind(holder) | ||
holder.root.onClick(listener) | ||
holder.name.text = holder.view.context.getString(R.string.all_chats) | ||
holder.root.isChecked = selected | ||
holder.root.context.resources | ||
holder.avatar.background = ContextCompat.getDrawable(holder.view.context, R.drawable.new_space_home_background) | ||
holder.avatar.backgroundTintList = ColorStateList.valueOf( | ||
ColorUtils.setAlphaComponent(ThemeUtils.getColor(holder.view.context, R.attr.vctr_content_tertiary), (255 * 0.3).toInt())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better to move to xml resource, both declaration of color state and setting it as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
holder.avatar.setImageResource(R.drawable.ic_space_home) | ||
holder.avatar.imageTintList = ColorStateList.valueOf(ThemeUtils.getColor(holder.view.context, R.attr.vctr_content_primary)) | ||
holder.avatar.scaleType = ImageView.ScaleType.CENTER_INSIDE | ||
|
||
holder.unreadCounter.render(countState) | ||
} | ||
|
||
class Holder : VectorEpoxyHolder() { | ||
val root by bind<CheckableConstraintLayout>(R.id.root) | ||
val avatar by bind<ImageView>(R.id.avatar) | ||
val name by bind<TextView>(R.id.name) | ||
val unreadCounter by bind<UnreadCounterBadgeView>(R.id.unread_counter) | ||
} | ||
} |
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
vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListSharedAction.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) 2022 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 im.vector.app.features.home.room.list.actions | ||
|
||
import im.vector.app.core.platform.VectorSharedAction | ||
|
||
sealed class RoomListSharedAction : VectorSharedAction { | ||
|
||
object CloseBottomSheet : RoomListSharedAction() | ||
} |
22 changes: 22 additions & 0 deletions
22
.../main/java/im/vector/app/features/home/room/list/actions/RoomListSharedActionViewModel.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,22 @@ | ||
/* | ||
* Copyright (c) 2022 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 im.vector.app.features.home.room.list.actions | ||
|
||
import im.vector.app.core.platform.VectorSharedActionViewModel | ||
import javax.inject.Inject | ||
|
||
class RoomListSharedActionViewModel @Inject constructor() : VectorSharedActionViewModel<RoomListSharedAction>() |
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
45 changes: 45 additions & 0 deletions
45
vector/src/main/java/im/vector/app/features/spaces/NewSpaceAddItem.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,45 @@ | ||
/* | ||
* Copyright (c) 2021 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 im.vector.app.features.spaces | ||
|
||
import android.content.res.ColorStateList | ||
import android.widget.ImageView | ||
import com.airbnb.epoxy.EpoxyAttribute | ||
import com.airbnb.epoxy.EpoxyModelClass | ||
import im.vector.app.R | ||
import im.vector.app.core.epoxy.ClickListener | ||
import im.vector.app.core.epoxy.VectorEpoxyHolder | ||
import im.vector.app.core.epoxy.VectorEpoxyModel | ||
import im.vector.app.core.epoxy.onClick | ||
import im.vector.app.features.themes.ThemeUtils | ||
|
||
@EpoxyModelClass | ||
abstract class NewSpaceAddItem : VectorEpoxyModel<NewSpaceAddItem.Holder>(R.layout.item_new_space_add) { | ||
|
||
@EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) var listener: ClickListener? = null | ||
|
||
override fun bind(holder: Holder) { | ||
super.bind(holder) | ||
holder.view.onClick(listener) | ||
|
||
holder.plus.imageTintList = ColorStateList.valueOf(ThemeUtils.getColor(holder.view.context, R.attr.vctr_content_primary)) | ||
} | ||
|
||
class Holder : VectorEpoxyHolder() { | ||
val plus by bind<ImageView>(R.id.plus) | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it better to set it in xml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because we use the same XML for
NewSpaceSummaryItem
where we don't want to have this background