Skip to content
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

[TIMOB-9102] iOS - Added getters for enabled and visible to ui proxies #6635

Merged
merged 3 commits into from
Feb 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions iphone/Classes/TiUIActivityIndicatorProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ -(NSMutableDictionary*)langConversionTable
return [NSMutableDictionary dictionaryWithObject:@"message" forKey:@"messageid"];
}

-(void)_initWithProperties:(NSDictionary*)properties
{
[self initializeProperty:@"visible" defaultValue:NUMBOOL(NO)];
[super _initWithProperties:properties];
}


-(NSString*)apiName
{
return @"Ti.UI.ActivityIndicator";
Expand Down
1 change: 1 addition & 0 deletions iphone/Classes/TiUISliderProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ -(void)_initWithProperties:(NSDictionary *)properties
[self initializeProperty:@"leftTrackTopCap" defaultValue:NUMFLOAT(1.0)];
[self initializeProperty:@"rightTrackLeftCap" defaultValue:NUMFLOAT(1.0)];
[self initializeProperty:@"rightTrackTopCap" defaultValue:NUMFLOAT(1.0)];
[self initializeProperty:@"enabled" defaultValue:NUMBOOL(YES)];
[super _initWithProperties:properties];
}

Expand Down
6 changes: 6 additions & 0 deletions iphone/Classes/TiUISwitchProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

@implementation TiUISwitchProxy

-(void)_initWithProperties:(NSDictionary *)properties
{
[self initializeProperty:@"enabled" defaultValue:NUMBOOL(YES)];
[super _initWithProperties:properties];
}

-(UIViewAutoresizing)verifyAutoresizing:(UIViewAutoresizing)suggestedResizing
{
return suggestedResizing & ~(UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth);
Expand Down
7 changes: 7 additions & 0 deletions iphone/Classes/TiUITextWidgetProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ @implementation TiUITextWidgetProxy
@synthesize suppressFocusEvents;
DEFINE_DEF_BOOL_PROP(suppressReturn,YES);

-(void)_initWithProperties:(NSDictionary *)properties
{
[self initializeProperty:@"enabled" defaultValue:NUMBOOL(YES)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might also want to initialize editable for the TextWidget proxy

[self initializeProperty:@"editable" defaultValue:NUMBOOL(YES)];
[super _initWithProperties:properties];
}

- (void)windowWillClose
{
if([self viewInitialized])
Expand Down
3 changes: 2 additions & 1 deletion iphone/Classes/TiViewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,8 @@ -(void)_initWithProperties:(NSDictionary*)properties
// Set horizontal layout wrap:true as default
layoutProperties.layoutFlags.horizontalWrap = YES;
[self initializeProperty:@"horizontalWrap" defaultValue:NUMBOOL(YES)];

[self initializeProperty:@"visible" defaultValue:NUMBOOL(YES)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to cause a problem with Ti.UI.ActivityIndicator. Setting visible to true by default will cause the activity indicator to appear as soon as it is added to the window hierarchy even if show() is never called.


if (properties!=nil)
{
NSString *objectId = [properties objectForKey:@"id"];
Expand Down