-> add a .h file to define the vector color

-> restore the done button on the roomSettingsViewController.
This commit is contained in:
yannick
2015-11-26 18:04:03 +01:00
parent 71806aaaa8
commit eaaedb6fbf
8 changed files with 49 additions and 15 deletions
+4 -3
View File
@@ -16,6 +16,8 @@
#import "EventFormatter.h"
#import "VectorDesignValues.h"
@interface EventFormatter ()
{
/**
@@ -42,9 +44,8 @@
calendar.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
localTimeZone = [NSTimeZone localTimeZone];
// FIXME use the color defined in room settings
self.bingTextColor = [UIColor colorWithRed:98.0f / 255.0f green:206.0f / 255.0f blue:156.0f / 255.0f alpha:1.0f];
self.bingTextColor = VECTOR_GREEN_COLOR;
}
return self;
}
+20
View File
@@ -0,0 +1,20 @@
/*
Copyright 2015 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.
*/
// the green text color
#define VECTOR_GREEN_COLOR [UIColor colorWithRed:(98.0/256.0) green:(206.0/256.0) blue:(156.0/256.0) alpha:1.0]
@@ -20,6 +20,8 @@
#import "AppDelegate.h"
#import "VectorDesignValues.h"
@interface RoomParticipantsViewController ()
{
// Add participants section
@@ -951,7 +953,7 @@
searchBar.showsCancelButton = YES;
// TODO : it should be an application constant value
searchBar.barTintColor = searchBar.tintColor = [UIColor colorWithRed:(98.0/256.0) green:(206.0/256.0) blue:(156.0/256.0) alpha:1.0];
searchBar.barTintColor = searchBar.tintColor = VECTOR_GREEN_COLOR;
return YES;
}
@@ -22,6 +22,8 @@
#import "RageShakeManager.h"
#import "VectorDesignValues.h"
#define ROOM_SECTION 0
#define ROOM_SECTION_NAME 0
@@ -65,6 +67,16 @@
{
[super viewWillAppear:animated];
doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(onDone:)];
doneButton.tintColor = VECTOR_GREEN_COLOR;
// this viewController can be displayed
// 1- with a "standard" push mode
// 2- within a segmentedViewController i.e. inside another viewcontroller
// so, we need to use the parent controller when it is required.
UIViewController* topViewController = (self.parentViewController) ? self.parentViewController : self;
topViewController.navigationItem.rightBarButtonItem = doneButton;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didMXSessionStateChange:) name:kMXSessionStateDidChangeNotification object:nil];
}
+1 -1
View File
@@ -261,7 +261,7 @@
[viewControllers addObject:settingsViewController];
segmentedViewController.title = NSLocalizedStringFromTable(@"room_details_title", @"Vector", nil);
[segmentedViewController initWithTitles:titles viewControllers:viewControllers defaultSelected:0];
[segmentedViewController initWithTitles:titles viewControllers:viewControllers defaultSelected:1];
}
}
@@ -16,6 +16,8 @@
#import "SegmentedViewController.h"
#import "VectorDesignValues.h"
@interface SegmentedViewController ()
{
// list of displayed UIViewControllers
@@ -40,9 +42,6 @@
// the index of the viewcontroller displayed at first load
NSUInteger selectedIndex;
// the UI item color
UIColor *greenVectorColor;
}
@end
@@ -129,9 +128,6 @@
[self addConstraint:self.selectionContainer constraint:self.selectionContainerTopConstraint];
// TODO : it should be an application constant value
greenVectorColor = [UIColor colorWithRed:(98.0/256.0) green:(206.0/256.0) blue:(156.0/256.0) alpha:1.0];
[self createSegmentedViews];
}
@@ -149,7 +145,7 @@
label.text = [sectionTitles objectAtIndex:index];
label.font = [UIFont systemFontOfSize:17];
label.textAlignment = NSTextAlignmentCenter;
label.textColor = greenVectorColor;
label.textColor = VECTOR_GREEN_COLOR;
label.backgroundColor = [UIColor clearColor];
// the constraint defines the label frame
@@ -241,7 +237,7 @@
{
// create the selected marker view
selectedMarkerView = [[UIView alloc] init];
selectedMarkerView.backgroundColor = greenVectorColor;
selectedMarkerView.backgroundColor = VECTOR_GREEN_COLOR;
[selectedMarkerView setTranslatesAutoresizingMaskIntoConstraints:NO];
[self.selectionContainer addSubview:selectedMarkerView];
@@ -16,6 +16,8 @@
#import "RoomActivitiesView.h"
#import "VectorDesignValues.h"
@implementation RoomActivitiesView
+ (UINib *)nib
@@ -36,8 +38,7 @@
// Remove default toolbar background color
self.backgroundColor = [UIColor whiteColor];
// TODO : put this mint grey color as a resource
self.typingImageView.backgroundColor = [UIColor colorWithRed:(98.0/256.0) green:(206.0/256.0) blue:(156.0/256.0) alpha:1.0];
self.typingImageView.backgroundColor = VECTOR_GREEN_COLOR;
self.typingImageView.layer.cornerRadius = self.typingImageView.frame.size.height / 2;
}