Room search: search result should include the search pattern when it corresponds to a valid room alias or id.

+
Room search: Room preview should be used when user selects a public room that he did not join yet.

https://github.com/vector-im/vector-ios/issues/328
https://github.com/vector-im/vector-ios/issues/329
This commit is contained in:
giomfo
2016-06-14 22:25:10 +02:00
parent 39dfb6ccd5
commit d5b81e3936
12 changed files with 282 additions and 56 deletions
@@ -0,0 +1,61 @@
/*
Copyright 2016 OpenMarket 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.
*/
#import "RoomIdOrAliasTableViewCell.h"
#import "AvatarGenerator.h"
#import "VectorDesignValues.h"
@implementation RoomIdOrAliasTableViewCell
#pragma mark - Class methods
- (void)awakeFromNib
{
[super awakeFromNib];
self.titleLabel.textColor = kVectorTextColorBlack;
}
- (void)layoutSubviews
{
[super layoutSubviews];
// Round image view
[self.avatarImageView.layer setCornerRadius:self.avatarImageView.frame.size.width / 2];
self.avatarImageView.clipsToBounds = YES;
}
- (void)render:(NSString *)roomIdOrAlias
{
if (roomIdOrAlias)
{
self.avatarImageView.image = [AvatarGenerator generateAvatarForText:roomIdOrAlias];
}
else
{
self.avatarImageView.image = [UIImage imageNamed:@"placeholder"];
}
self.titleLabel.text = roomIdOrAlias;
}
+ (CGFloat)cellHeight
{
return 74;
}
@end