diff options
author | Ptyl Dragon <ptyl@cloudon.com> | 2013-11-01 15:55:44 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2013-11-15 16:52:02 +0100 |
commit | 541d9ac222929a4c687dfee259e2dc2e07497c77 (patch) | |
tree | de360fb305f2c0b72ef78a3d507a5d4a188e67ed /ios/shared | |
parent | 2ccb8de590dc7c6c8b0ec2d0ea02d85050859a82 (diff) |
changed testing app UI to be more clear what it does
Change-Id: I5307478fc47f0810cae24c72ce509ac6a409bf1b
Diffstat (limited to 'ios/shared')
4 files changed, 34 insertions, 5 deletions
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h index 8465b5dadf67..041e19862ea7 100644 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h @@ -19,4 +19,5 @@ typedef void (^MLOTestingTileParameterExtractor)(CGFloat value); -(void)extractMode:(MLOTestingTileParametersMode) mode; -(void)setParamFrame:(CGRect) paramFrame; -(void)addToSuperview; +-(void)enterMode:(MLOTestingTileParametersMode)mode; @end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m index 9c0af4f994d9..a661539c3ad7 100644 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m @@ -185,4 +185,16 @@ static const CGFloat DEFAULT_STEP_VALUE = 1; extractor([self currentDataValue]); } } +-(BOOL)isSupportingMode:(MLOTestingTileParametersMode) mode{ + return [self getExtractor:mode]!=nil; +} +-(void)enterMode:(MLOTestingTileParametersMode)mode{ + CGFloat alpha = [self isSupportingMode:mode] ? 1.0f: 0.0f; + self.label.alpha = alpha; + self.data.alpha = alpha; + self.dataStepper.alpha = alpha; + self.step.alpha =alpha; + self.stepStepper.alpha = alpha; +} + @end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m index 0c18b82c12c1..f8fcadb4a4f8 100644 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m @@ -45,11 +45,22 @@ { CGContextRef context = UIGraphicsGetCurrentContext(); + MLODpxPoint tilePosition =MLODpxPointByDpxes(self.tester.params.tilePosX,self.tester.params.tilePosY); + MLODpxSize tileSize = MLODpxSizeByDpxes(self.tester.params.tileWidth,self.tester.params.tileHeight); + NSInteger contextWidth = self.tester.params.contextWidth; + NSInteger contextHeight = self.tester.params.contextHeight; + + NSLog(@"touch_lo_draw_tile(contextWidth=%d, contextHeight=%d, tilePosition=%@, tileSize=%@", + contextWidth, + contextHeight, + NSStringFromCGPoint(tilePosition), + NSStringFromCGSize(tileSize)); + touch_lo_draw_tile(context, - self.tester.params.contextWidth, - self.tester.params.contextHeight, - MLODpxPointByDpxes(self.tester.params.tilePosX,self.tester.params.tilePosY), - MLODpxSizeByDpxes(self.tester.params.tileWidth,self.tester.params.tileHeight)); + contextWidth, + contextHeight, + tilePosition, + tileSize); MLODpxSize size = touch_lo_get_content_size(); NSLog(@"touch_lo_get_content_size: width=%f, height=%f",size.width, size.height); diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m index 4a235e19ffe1..52d7b644f2de 100644 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m @@ -26,11 +26,13 @@ static const CGFloat RENDER_BUTTON_HEIGHT = 50.0f; self = [self init]; if(self){ self.tester = tester; - self.mode = WIDTH_IS_HEIGHT; [self initParams]; [self initModeButton]; [self initRenderButton]; + self.mode = WIDTH_IS_NOT_HEIGHT; + [self changeMode]; + } NSLog(@"%@ initWithTester",self); @@ -96,6 +98,9 @@ static const CGFloat RENDER_BUTTON_HEIGHT = 50.0f; } [self.modeButton setTitle:MLOTestingTileParametersModeString(self.mode) forState:UIControlStateNormal]; + for(MLOTestingTileParameter * param in self.params){ + [param enterMode:self.mode]; + } } |