Commit Graph

49 Commits

Author SHA1 Message Date
Diego Sánchez a12bdf5873 Fix code coverage (#254)
* Code coverage test

* Adds .codecov.yml

* Fixes .codecov.yml
2016-11-19 01:31:09 +00:00
Diego Sánchez 0673909be5 Swiflint 0.13 fixes & Xcode 8 b2 compatibility (#253)
* Updates swiftlint config

* Fixes swiftlint erros and warnings

* Makes ChattoApp compatible with Xcode 8 b2

* Carthage compatibility with Xcode 8 b2

* Updates .travis.yml to use stable image with Xcode 8.1
2016-11-18 22:12:40 +00:00
Diego Sanchez 5693e332d1 Updates Podfile to use Swift 3.0.1. Runs pod update 2016-11-14 16:05:41 +00:00
0xpablo dceee05d27 Use new Calendar API (#249)
Use new Calendar API to add the time separator if two dates are in a different day.
2016-11-08 11:24:27 +00:00
Diego Sánchez 55885a5fd6 Adds exclusive touch to bubble view (#223)
* Adds exclusive touch to bubble view

* Sanitises quotes in Podfile

* Runs pod update
2016-09-26 22:42:33 +01:00
Alexsander Khitev bb600dbf22 Sets Swift version to 3 in ChattoApp Podfile (#222)
* switched Swift version to 3 in ChattoApp podfile

* removed description
2016-09-22 20:22:19 +01:00
Diego Sanchez 4ec15a8812 Removes ChattoAppUITests target 2016-09-21 16:36:23 +01:00
Diego Sanchez 14ebd59529 Disables UI tests in ChattoApp due to unstable environment in travis 2016-09-21 16:11:08 +01:00
Diego Sánchez d1b01327d1 Swift 3 migration (#220)
* Runs the Swift 3 migrator in ChattoApp.

Affects ChattoApp, ChattoAppTests, Chatto and ChattoAdditions. Does not migrate ChattoTests or ChattoAdditionsTests

* Configures Chatto And ChattoAdditions projects to use Swift 3

* Updates .travis.yml to use Xcode 8 and iPhone 7

* Uses flatMap instead of filter and force cast

* Fixes createCollectionViewLayout not being a function

* Removes useless init overrides

* Fix for new implicit unwrapping optional non-propagation rule

* Removes useless casting

* Audits accessor levels in Observable

* Fixes UIControlState.Normal replaced by UIControlState()

* Favours private over fileprivate where possible

* Audits open/public access level

* Removes conditional if for Swift 2

* Removes label from simulateTapOnTextViewForDelegate

* Audits open/public access levels
2016-09-21 12:58:25 +01:00
Daniel Burgess ab286307c3 Fix a bug causing keyboard view offset to be incorrect (#204)
* Fix a bug causing keyboard view offset to be incorrect

In some rare cases, if the height of the view is a fractional point
(i.e., not a whole number), it would cause the views to not be offset
despite the keyboard being shown on top of them. This does not happen
with every fractional height. Different devices also behave a little
differently in seemingly identical layouts, due to their pixel density
being different.

The base issue is that, due to floating point rounding errors, two
values that _should_ be identical and pass the guard fail to do so,
because the lack of precision results in them not being equal. By
flooring the values, we can ignore really minor differences and ensure
rounding errors don't cause this issue.

* Unify bma_round methods to use correct calculation

Thanks to @diegosanchezr for the suggested improvement.

* Revert ChattoAdditions bma_round change

Unfortunately, removing this in favor of the Chatto version broke size
calculations, so putting it back...

* Switch to using infix operator to check float comparison

* Add utils to Chatto project
2016-08-22 15:46:32 +01:00
Diego Sanchez 953659eb01 Runs Pod update 2016-08-08 14:07:37 +01:00
Diego Sanchez a7cbdddaf3 Updates Podfile 2016-08-08 14:06:55 +01:00
Diego Sanchez 75c6ccd32d Compatibility for Xcode 8 beta 2016-08-08 13:00:58 +01:00
Diego Sánchez 8b003c64b8 Prepare release 2.0 (#194)
* Adds changelog

* Bumps version to 2.0.0

* Updates readme

* Updates readme with workaround for SR-2223

* Fix for readme
2016-08-08 11:33:12 +01:00
Diego Sánchez 7541a5ab64 Workaround for issue 187 (#188)
* Sets -Owholemodule in ChattoApp's ChattoAdditions so it compiles in release config (workaround for SR-2223)

* Updates pods
2016-07-30 14:48:34 +01:00
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
Diego Sanchez 8f9ce5df4e Improves responsiveness of camera when switching to/from full-screen camera view. 2016-07-05 23:14:22 +01:00
Diego Sánchez 7a0f8d8e58 Improvements to photo input item: (#168)
- Just one capture session per input component.
 - Avoids starting/stoping capture during collection reloads, which can make the live camera take longer to capture or even hang.
 - Moves creation/destruction of capture session to the background: when opening/closing the input component many times it was resulting in capture start / stop blocking the main thread for some seconds on iOS 8
 - Queues updates in the collection view: doing a reloadData right after reloadItemsAtIndexPaths (update video) results in the visible cells not being refreshed
2016-06-29 23:54:15 +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 8da10a8776 Fix carthage for dev branch (#159) 2016-06-22 12:22:55 +01:00
Diego Sánchez 5c3c84e6a6 Input bar customization enhancements (#154)
Adds more customizable options to the input bar

Bar with icons gets customizable height
Buttons get customizable intrinsic contentSize, so they can be bigger and easy to tap
Buttons get customizable images for any UIControlState
Send button gets customizable text colors for any UIControlState
2016-06-16 15:27:37 +01:00
Diego Sánchez f442111937 Allows configuring a maximum number of characters for the input bar (#152) 2016-06-14 14:22:42 +01:00
Cody Rayment 9f551bfcb4 Added support for embedding in UITabBarController (#132)
* Respects bottom layout guide
* Demo for ChattoApp with tab bar controller
2016-05-16 18:33:18 +01:00
Anton Schukin c11374ae3c Added ability to react on different states of UILongPressGestureRecognizer 2016-05-06 13:30:32 +01:00
Diego Sanchez d08fc82135 Enhancements for accessory view revealer. Allows disabling it and custom transform to gesture displacement for "resistance" effect 2016-04-19 12:57:47 +01:00
Diego Sanchez a7620a512b Allows to control whether setting the dataSource enqueues an update immediately 2016-04-05 15:40:44 +01:00
Diego Sanchez 613074bdb9 Fixes leaking the view controller when keyboard is present 2016-03-30 20:04:22 +01:00
Aziz Latypov 5205dbabfb * fixed warning with selector
* introduced presenterFactory
* moved presenterBuilders inside of BasePresenterFactory
2016-03-26 10:40:58 +03:00
Diego Sanchez c1b7cb7553 Adopts changes in appearance on ChattoApp. The default values in appearance don't work for any app (unlocalized texts) so it's better to remove the default value and make existing apps get a compiler error. 2016-03-21 23:53:58 +00:00
Diego Sanchez c2626546ba Code grooming 2016-03-14 00:19:39 +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
Zhao Wang 217c9127be Add timestamp separator in message view using extra DecoratedChatItem 2016-03-13 09:14:48 -07: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
Zhao Wang 6c09805fb9 Change to show avatar for both incoming and outgoing message for demo purpose 2016-03-10 00:09:07 -08: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
Anton Schukin bd1fb5ada5 Implemented proper presenter 2016-03-05 12:39:21 +00:00
Diego Sanchez 340a2677f1 Removes completion block from pagination calls.
Now DataSource is responsible for notifying the exact type of change. This implicitly allows more flexibility in the dataSource ( like ignoring such a request! ) and reduces entry points from where changes are enqueued
2016-02-24 18:23:16 +00: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 4086d458e3 Allows a datasource to return different chatItem instances when it updates.
Previously, due to the mapping between chatItem instance and presenter, a new presenter would be created. This fixes:
1) That new presenter will have invalid itemVisibility property (would cause a crash when long pressing a text cell)
2) If a new chatItem instance is returned by the dataSource for a previous existing message, but the previous chatItem is leaked, then the presenter would leak too (and it might try to update its cell, as in downloading an image)

This introduces ChatItemCompanion, a structure which attaches a ChatItem with its presenter and decoration attributes. This solves 1) and 2). Still new instances of presenters will be created for new instances of chatItems --> Presenters should avoid keeping any state in its internal storage.
2016-02-08 17:55:23 +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 d46bdb214c Relaxes generic constraints so presenters can be reused with different models 2016-02-03 13:06:03 +00:00
Diego Sanchez 1c1ae439dd Merge remote-tracking branch 'upstream/master' into dev 2016-02-02 17:37:23 +00:00
Diego Sanchez fb1c3ad04a Renames BMACircle* -> Circle* 2016-02-02 17:19:44 +00:00
Diego Sanchez a8933a3791 Renames ChatViewController -> BaseChatViewController 2016-02-01 14:57:06 +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