-
Notifications
You must be signed in to change notification settings - Fork 11
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
ChatBubbleView update() method impossible to override #12
Comments
I'm reluctant to open it up too much as it can make it difficult to maintain/evolve the class. What kinds of customizations did you want to do? I might be able to make some more prices protected methods that would allow you to perform particular types of customizations. My hope is that most customizations of this component are achieved using actions, and the view model. |
Hi, Maybe if you could take out the part of the update() method within "if(changed) {....}" to a separate method "draw(...)" or something, then I could overload the method and add some custom content into the bubble chat view. |
Using inheritance for that type of change is risky as it would likely conflict with later changes that add features to the core class later. Better to either copy the class and make changes like that, and/or modify the class and submit a pull request. |
Ok, thanks. I will think of the best way to do customizations then. |
If I get around to implementing it, I think I will opt for the view property approach. I.e. define a view property that defines the avatar settings for the bubbles. It could be a boolean, or maybe an enum type (e.g. AlwaysIncludeAvatar,IncludeAvatarOnOther,IncludeAvatarOnOwn,NeverIncludeAvatar). I'm not sure if I've documented view properties yet... |
Hi,
I tried to reimplement the update method to put a custom content in the chat message, customize the chat bubble view and other things.
I am mostly interested in reimplementing the part within "if(changed) {...}" part, hoping to leave the rest of the code unchanged/copied.
However, the update() method uses lots of private fields and methods and most of the code in the class is private. This makes it nearly impossible to extended and customize some parts only.
I would suggest to change the access modifier to protected for most of the class members and/or split the update() method into smaller piece of code located in separate methods. This would allow for easier extensibility and flexibility in the future.
The text was updated successfully, but these errors were encountered: