Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[NEW] Add bottomSheet in Chatrooms #1929

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

shubhsherl
Copy link
Contributor

@RocketChat/android

Closes #1055

Add bottom sheet for hide, Leave, Favorite, MarkAsRead chatrooms

@philipbrito
Copy link
Contributor

Hey @shubhsherl, thanks a lot for this PR (I'm happy that you did it as pointed on you comment on the issue).

Make sure to remove the [WIP] when it is done, so we can review it.

Copy link
Contributor

@philipbrito philipbrito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just leaving some comments here.

class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit, actionsListener: ActionsListener) :
ViewHolder<RoomItemHolder>(itemView, actionsListener) {

init {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a better coding style this initializer block comes after the property declaration.
https://kotlinlang.org/docs/reference/coding-conventions.html

presenter.toggleFavoriteChatRoom(this.id, this.favorite==true)
}
R.id.action_leave_room-> {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us know if you are planning to add a function to leave the room here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yaa, I am working on it.

this.unread.ifNotNullNorEmpty{ presenter.markRoomAsRead(this.id) }
}
R.id.action_hide_room->{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And to hide the room too.

fun isActionsEnabled(): Boolean
fun onActionSelected(item: MenuItem, room: RoomUiModel)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty line.

retryIO("favorite($roomId, $isFavorite)") {
client.favorite(roomId, !isFavorite)
}
// view.showFavoriteIcon(!isFavorite)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to show/hide that icon after user interaction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bottom sheet will disappear after toggle, and next time it will fetch from toggled data. So i guess, no need of showFavoriteIcon

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But are this PR adding these features from the chat list or inside a chat room?

Copy link
Contributor Author

@shubhsherl shubhsherl Dec 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From chatList, I was taking reference of code implemented in ChatRoom, that's why the function is there. I will remove that.

Copy link
Contributor

@philipbrito philipbrito Dec 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No! Don't remove that, please! Give the user the possibility to star/unstar a chat inside a chat room (like we do for the web for instance).

You should leave the current feature as it is because removing that will force the user to go back to the chat list to do these actions every time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I am not removing the current feature.
These functions are implemented in Chatlist( not chatRoom). So it doesn't change the feature of Chatroom.

Copy link
Contributor

@philipbrito philipbrito Dec 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok 😃 Then we shouldn't put this function neither on ChatRoomsPresenter.kt nor ChatRoomPresenter. We should put it in only one place to be used in the Chat List and ChatRoom view.

@rafaelks rafaelks added this to the 3.3.0 milestone Dec 14, 2018
@shubhsherl shubhsherl changed the title [WIP] Add bottomSheet in Chatrooms Add bottomSheet in Chatrooms Dec 19, 2018
@shubhsherl
Copy link
Contributor Author

@filipedelimabrito Work Done, I have added a function in Rocket.Chat.Kotlin.SDK for markasunread.

@shubhsherl
Copy link
Contributor Author

@rafaelks rafaelks changed the title Add bottomSheet in Chatrooms [NEW] Add bottomSheet in Chatrooms Jan 10, 2019
@rafaelks rafaelks removed this from the 3.3.0 milestone May 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NEW] Support actions (hide, mark as unread, favorite and leave) on chats from the chat list
3 participants