Commit Graph

49 Commits

Author SHA1 Message Date
Diego Sánchez d8a162cb0f Xcode 8.0 b3 + swift 2.3 support (#183)
* Fixes compilation for Xcode 8.0(beta 3)/Swift 2.3

* Adds NSCameraUsageDescription and NSPhotoLibraryUsageDescription to avoid crash on iOS 10 beta

* Runs swiftlint autocorrect
2016-07-18 23:28:11 +01:00
Max Konovalov 1329c96a0e Avatar improvements (#176)
* Add showsAvatar decoration attribute

* Add avatar tap handler

* Add avatar to photo message

* Fix tests

* Rename showsAvatar to canShowAvatar
2016-07-18 20:35:09 +01:00
Anton Schukin 26a4a0e0c8 Allow customisation of timestamp revealing behaviour 2016-07-12 17:49:40 +01:00
Max Konovalov 7d410e5760 Make photo message cell style Colors initializer public (#177) 2016-07-08 00:04:34 +01:00
Igor Kashkuta 25b32bb0cb Add view parameter to userDidTapOnFailIcon() (#167)
* Add view parameter to userDidTapOnFailIcon() interaction handler method. Pass failed button view into it.
2016-06-28 15:20:20 +01:00
Diego Sánchez 37dd3bd562 Minor performance improvements for TextBubble (#166)
* Minor performance improvements:
 - Avoids updating font and color in TextBubble if it's not needed: would make attributed text to update
 - Avoids updating views in selected setter if value didn't change (setter is called by the collection view as part of dequeuing)
 - Avoids creating dictionary of attributes all the time for date attributed string (for some reason this was appearing in profiling with some swift-to-objc conversions)

Uses enum as image key in text style for greater safety.

* Removes linter warnings
2016-06-27 23:03:32 +01:00
Diego Sánchez 29173b03b5 Fixes text sizing issue. (#161)
Setting UITextView.textColor after UITextView.text may result in a NSTextStorage string that doesn't match our size calculation routine.
2016-06-23 14:41:08 +01:00
Igor Kashkuta 33b2016638 Make default messages time formatter respect current locale. (#155) 2016-06-16 10:27:01 +01:00
Igor Kashkuta d4d2577959 Make updateQueue public so subclasses can control it. (#150)
* Make update queue of BaseChatViewController public

* Fix SwiftLint's warnings.

* Fix tests
2016-06-14 12:53:40 +01:00
Diego Sánchez d87fe40c90 Some optimizations for TextBubbleView (#144) 2016-06-01 13:43:37 +01:00
Diego Sánchez 6e55f5e052 Make border images optional in BaseMessageCollectionViewCellDefaultStyle (#139) 2016-05-27 16:54:20 +01:00
Anton Schukin 6c469185d5 Make some properties public 2016-05-25 11:30:05 +01:00
Anton Schukin 12c79b919a Allow to specify margins for revealable timestamps 2016-05-18 14:59:42 +01:00
Diego Sánchez 3b62da46a3 Text bubble fixes (#127)
* Fixes diacritic marks being clipped.

This changes how text insetting is performed. By using non-zero textInsets, UITextView size is now bigger and diacritic marks can be seen.

* Fixes size of text not matching UITextView.sizeThatFits(_:) for some strings - which was leading to incorrect size of text bubbles -
2016-05-12 15:54:56 +01:00
Anton Schukin d84a9805a4 Allow PhotoBubbleView to be subclassed 2016-05-11 10:49:07 +01:00
Anton Schukin b4308dcd7b Make BaseMessagePresenter.decorationAttributes public 2016-05-11 10:43:48 +01:00
Anton Schukin c11374ae3c Added ability to react on different states of UILongPressGestureRecognizer 2016-05-06 13:30:32 +01:00
Anton Schukin 136473d1b0 Fixed issue with text size calculation v2 2016-05-05 16:37:51 +01:00
Anton Schukin 47f6692eca Revert "Merge pull request #122 from AntonPalich/Fix_text_size_calculation"
This reverts commit 06655cdd77, reversing
changes made to acc9900c98.
2016-05-05 16:33:01 +01:00
Anton Schukin 5a9c096e02 Fixed text size calculation 2016-05-05 14:47:50 +01:00
Diego Sanchez eb84520fff Updates to Swift 2.2 2016-04-11 14:22:56 +01:00
Anton Schukin 62fd1ed7cd Added default initialiser for public struct 2016-03-23 15:37:50 +00:00
Diego Sanchez f16bb098ae Fixes blink on iOS 8 when sending text messages 2016-03-23 11:30:59 +00:00
Anton Schukin 0e064424d8 Allow_to_customize_sizes_and_colors_of_photo_messages 2016-03-22 16:54:08 +00:00
Diego Sanchez 4cca18783a Fixes swiftlint warnings 2016-03-21 20:55:56 +00:00
Diego Sanchez eaa4142e17 Fixes misalignment when revealing timestamps due to different sizes (3.00 am 17.37 pm) 2016-03-21 20:55:56 +00:00
Diego Sanchez 2c5b065d5c Improvements for custom styling
- Allows reusing default styles by injecting parameters
 - Insets and fonts for input component
2016-03-21 20:49:30 +00:00
Anton Schukin 4ae42064cf Make PhotoMessagePresenter.photoCellStyle property public 2016-03-16 10:41:05 +00:00
Anton Schukin c2b13923bc BaseMessagePresenter properties became public 2016-03-15 18:07:42 +00:00
Zhao Wang 91a4d2bf61 Expose a public initializer for BaseMessageCollectionViewCellLayoutConstants
Since the default one is internal for struct.
2016-03-14 11:23:32 -07:00
Anton Schukin 1ef01a7876 Presenters can responds on cell events directly and implement additional behaviour in addition to interaction handlers 2016-03-14 17:02:20 +00:00
Zhao Wang 1699199857 update self.dynamicType to static type to avoid potential issues of finding default images in NSBundle 2016-03-13 13:19:51 -07:00
Diego Sánchez 2733b83e8c Merge pull request #55 from zwang/feature-avatar
Adds support for user avatars
2016-03-12 11:37:51 +00:00
Zhao Wang c811ade011 avatar for messages update based on feedback
Also allow user to override layoutConstants in
BaseMessageCollectionViewCell and allow user to specify
VerticalAlignment of avatar: Top, Bottom or Center
2016-03-11 23:17:40 -08:00
Anton Schukin 239c36f33a Added default init method for PhotoMessageCollectionViewCellDefaultStyle 2016-03-10 15:55:53 +00:00
Zhao Wang 15dea4cfc6 Add comments about how to display avatar 2016-03-10 00:01:24 -08:00
Zhao Wang 139c56e793 Add avatar implementation and demo 2016-03-09 23:53:26 -08:00
Zhao Wang d3b3c8561a Also change the file name for typo 2016-03-08 23:18:43 -08:00
Zhao Wang 6e0d014571 Fix a class name typo
BaseMessageCollectionViewCellDefaultSyle  ->
BaseMessageCollectionViewCellDefaultStyle
2016-03-08 22:02:59 -08:00
Anton Schukin 8c8413432d Make PhotoMessagePresenter.photoCell public 2016-03-08 14:26:42 +00:00
Anton Schukin 30a9604ef8 Make several properties in PhotoMessagePresenterBuilder public 2016-03-08 14:11:23 +00:00
Barış Çamur c7d4fcfbd5 Make Subclassing BaseMessageCollectionViewCell Possible Outside of ChattoAdditions Module
-This commit exposes messageViewModel, createBubbleView() and init
functions of BaseMessageCollectionViewCell class to other modules by
changing their access modifiers to ‘public’.
-This also requires to change the access level of createBubbleView()
function of  TextMessageCollectionViewCell and
PhotoMessageCollectionViewCell to be made ‘public’
2016-02-26 17:20:14 +02:00
Diego Sanchez da05cb2a09 Relax MessageModelProtocol and MessageViewModelProtocol requirements.
MessageModelProtocol should not require setter for status property.
MessageViewModelProtocol should not require messageModel property.

Both are convenience shortcuts for DemoChatApp and should be removed since they are not used by ChattoAdditions framework.
2016-02-18 12:37:50 +00:00
Diego Sanchez 99e30d85d4 Makes PhotoMessageViewModelDefaultBuilder generic so it can build view models from different concrete models 2016-02-03 13:36:23 +00:00
Diego Sanchez a040604f05 Makes TextMessageViewModelDefaultBuilder generic so it can build view models from different concrete models 2016-02-03 13:36:23 +00:00
Diego Sanchez d46bdb214c Relaxes generic constraints so presenters can be reused with different models 2016-02-03 13:06:03 +00:00
Diego Sanchez fb1c3ad04a Renames BMACircle* -> Circle* 2016-02-02 17:19:44 +00:00
Diego Sanchez a0a071afa8 Fixes linter warnings and updates some rules. Also removes deprecated '++' and '--' 2016-01-27 22:04:32 +00:00
Diego Sanchez 2884160061 Chatto inception 2015-11-26 22:48:25 +00:00