Skip to content

Commit

Permalink
增加在线布局浏览器
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenglibao committed Jan 12, 2018
1 parent f6605ae commit c81045e
Show file tree
Hide file tree
Showing 24 changed files with 1,437 additions and 1,035 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
**FlexLib**的所有版本的变更日志都将会在这里记录.

---
## 1.6.0
1.增加在线布局浏览器功能,可以在线通过http浏览本地布局文件

## 1.5.0
1. 增加FlexCollectionView,解决UICollectionView无法直接在xml中使用的问题
2. 增加枚举组属性支持
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- Expecta (1.0.6)
- FlexLib (1.4.5):
- FlexLib/no-arc (= 1.4.5)
- FlexLib (1.5.1):
- FlexLib/no-arc (= 1.5.1)
- Yoga
- FlexLib/no-arc (1.4.5):
- FlexLib/no-arc (1.5.1):
- Yoga
- Specta (1.0.7)
- Yoga (1.6.0)
Expand All @@ -19,7 +19,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5
FlexLib: 906f3b78509ecf212854a97f27a69381442a3764
FlexLib: 5e99a75c53e004aa9b0ad95e392c3ee27d255323
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
Yoga: 81670877477311136b1b3f69a6307ce62e1c89cf

Expand Down
4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/FlexLib.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,036 changes: 1,027 additions & 1,009 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion FlexLib.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'FlexLib'
s.version = '1.5.1'
s.version = '1.6.0'
s.summary = 'An obj-c flex layout framework for IOS'

# This description is used to generate tags and improve search results.
Expand Down
8 changes: 8 additions & 0 deletions FlexLib/Assets/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

"layoutVCTitle" = "All Layouts";
"previewVCTitle" = "Flex Preview Setting";
"HttpVCTitle" = "Online Flex Explorer";

// keyboard toolbar
"Prev" = "Prev";
Expand All @@ -22,3 +23,10 @@
"onlineLoad" = "Online load resource";
"onlineWarning" = "Notice: this option will slow down the load speed. UI will be blocked if network is slow or inaccessible.";
"Save" = "Save";

// http vc
"goup" = "Up";
"gohome" = "Home";
"refresh" = "Refresh";


25 changes: 25 additions & 0 deletions FlexLib/Assets/FlexHttpVC.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>

<UIView layout="flex:1" attr="bgColor:white">
<UIView layout="height:40,paddingLeft:14,paddingRight:14,justifyContent:center" attr="bgColor:#f6f6f6">
<UITextField name="_pathLabel" attr="fontSize:14,color:#157efb"/>
</UIView>

<UIView layout="height:50,paddingLeft:14,paddingRight:14,flexDirection:row,justifyContent:space-around,alignItems:center" attr="bgColor:#f6f6f6">
<FlexTouchView onPress="onGoUp" layout="width:20%,height:35,justifyContent:center,alignItems:center" attr="underlayColor:darkGray,bgColor:#e5e9ea,borderRadius:8">
<UILabel attr="fontSize:14,color:#157efb,linesNum:0,text:@goup"/>
</FlexTouchView>
<FlexTouchView onPress="onGoHome" layout="width:20%,height:35,justifyContent:center,alignItems:center" attr="underlayColor:darkGray,bgColor:#e5e9ea,borderRadius:8">
<UILabel attr="fontSize:14,color:#157efb,linesNum:0,text:@gohome"/>
</FlexTouchView>
<FlexTouchView onPress="onRefresh" layout="width:20%,height:35,justifyContent:center,alignItems:center" attr="underlayColor:darkGray,bgColor:#e5e9ea,borderRadius:8">
<UILabel attr="fontSize:14,color:#157efb,linesNum:0,text:@refresh"/>
</FlexTouchView>
</UIView>

<UITableView name="_table" layout="flex:1" attr="bgColor:white"/>

<UIView layout="height:40,paddingLeft:14,paddingRight:14,justifyContent:center" attr="bgColor:#f6f6f6">
<UILabel name="_statusBar" layout="height:40,marginLeft:14,marginRight:14" attr="fontSize:14,color:#157efb,linesNum:0,text:空闲!"/>
</UIView>
</UIView>
7 changes: 7 additions & 0 deletions FlexLib/Assets/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

"layoutVCTitle" = "全部布局";
"previewVCTitle" = "预览设置";
"HttpVCTitle" = "在线布局浏览器";

// keyboard toolbar
"Prev" = "上一个";
Expand All @@ -23,3 +24,9 @@
"onlineWarning" = "注意:打开该选项将会减慢加载速度,如果网络较慢将会阻塞界面";
"Save" = "保存";

// http vc
"goup" = "上一级";
"gohome" = "主页";
"refresh" = "刷新";


10 changes: 10 additions & 0 deletions FlexLib/Classes/FlexBaseVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import "FlexScrollView.h"
#import "FlexSetPreviewVC.h"
#import "FlexLayoutViewerVC.h"
#import "FlexHttpVC.h"

static void* gObserverFrame = (void*)1;

Expand Down Expand Up @@ -244,6 +245,10 @@ -(void)viewLayouts
{
[FlexLayoutViewerVC presentInVC:self];
}
-(void)viewOnlineResources
{
[FlexHttpVC presentInVC:self];
}
-(CGFloat)getStatusBarHeight:(BOOL)portrait
{
return portrait ? 20 : 0;
Expand Down Expand Up @@ -321,6 +326,11 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(UIView*)object chan
[UIKeyCommand keyCommandWithInput:@"v"
modifierFlags:UIKeyModifierControl
action:@selector(viewLayouts)],

// view online resources
[UIKeyCommand keyCommandWithInput:@"e"
modifierFlags:UIKeyModifierControl
action:@selector(viewOnlineResources)],
];
#else
return @[];
Expand Down
18 changes: 18 additions & 0 deletions FlexLib/Classes/FlexHttpVC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright (c) 2017-present, zhenglibao, Inc.
* email: [email protected]
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/

#import "FlexBaseVC.h"

@interface FlexHttpVC : FlexBaseVC

@property(nonatomic,copy) NSString* url;

+(void)presentInVC:(UIViewController*)parentVC;

@end
Loading

0 comments on commit c81045e

Please sign in to comment.