cocoapods-aomi-bin 0.1.25 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-lhj-bin/command/bin/view.rb +41 -13
- data/lib/cocoapods-lhj-bin/gem_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61ce22dc3e41408e8777e312780ce5a0a313acd15344f6026371e119d4af87f4
|
4
|
+
data.tar.gz: c0d34b7525c2ada3970d6d758a5082c67f8bbe00826f459571be509ea42de8eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aacb0bf501176001a01146859b4a460c7d3be79c907d2d9f4e9d15f00aaf40a11d06569587d8845bdbfe8c4a2b7f83ede9633a79bf3a864ecfa979cb574df52b
|
7
|
+
data.tar.gz: 9fc30ba67b383560b301bbd41e637904dade14a4f6afb451f45419830d514b08551b4db053e0715cf9f6b80a76c0ac27180ad71fe6d7a295d0294e58cfd8634c
|
@@ -14,6 +14,28 @@ module Pod
|
|
14
14
|
@name.split(",").map(&:strip)
|
15
15
|
end
|
16
16
|
|
17
|
+
def type
|
18
|
+
@ele_type ||= begin
|
19
|
+
if @type =~ /image/i
|
20
|
+
'UIImageView'
|
21
|
+
elsif @type =~ /stack/i
|
22
|
+
'UIStackView'
|
23
|
+
elsif @type =~ /label/i
|
24
|
+
'UILabel'
|
25
|
+
elsif @type =~ /table/i
|
26
|
+
'UITableView'
|
27
|
+
elsif @type =~ /text/i
|
28
|
+
'UITextField'
|
29
|
+
elsif @type =~ /button/i
|
30
|
+
'UIButton'
|
31
|
+
elsif @type =~ /view/i
|
32
|
+
'UIView'
|
33
|
+
else
|
34
|
+
@type
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
17
39
|
def run
|
18
40
|
print_declare
|
19
41
|
puts "\n\n"
|
@@ -27,13 +49,13 @@ module Pod
|
|
27
49
|
def print_declare
|
28
50
|
names.each do |name|
|
29
51
|
puts "///"
|
30
|
-
puts "@property (nonatomic, strong) #{
|
52
|
+
puts "@property (nonatomic, strong) #{type} *#{name};"
|
31
53
|
end
|
32
54
|
end
|
33
55
|
|
34
56
|
def print_instance
|
35
57
|
names.each do |name|
|
36
|
-
puts "-(#{
|
58
|
+
puts "-(#{type} *)#{name}"
|
37
59
|
puts "{"
|
38
60
|
puts " if(!_#{name}){"
|
39
61
|
print_alloc(name)
|
@@ -47,46 +69,50 @@ module Pod
|
|
47
69
|
end
|
48
70
|
|
49
71
|
def print_alloc(name)
|
50
|
-
if
|
72
|
+
if type.eql?('UIImageView')
|
51
73
|
puts " _#{name} = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@\"xxxx\"]];"
|
52
|
-
elsif
|
74
|
+
elsif type.eql?('UIButton')
|
53
75
|
puts " _#{name} = [UIButton buttonWithType:UIButtonTypeCustom];"
|
54
|
-
elsif
|
76
|
+
elsif type.eql?('UITableView')
|
55
77
|
puts " _#{name} = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];"
|
56
78
|
else
|
57
|
-
puts " _#{name} = [[#{
|
79
|
+
puts " _#{name} = [[#{type} alloc] init];"
|
58
80
|
end
|
59
81
|
end
|
60
82
|
|
61
83
|
def print_property(name)
|
62
|
-
if
|
84
|
+
if type.eql?('UILabel')
|
63
85
|
puts " _#{name}.textColor = kSetCOLOR(0x333333);"
|
64
86
|
puts " _#{name}.text = @\"xxxxxxxx\";"
|
65
87
|
puts " _#{name}.font = [UIFont systemFontOfSize:12.0 weight:UIFontWeightRegular];"
|
66
88
|
puts " _#{name}.textAlignment = NSTextAlignmentCenter;"
|
67
|
-
elsif
|
89
|
+
elsif type.eql?('UIImageView')
|
68
90
|
puts " _#{name}.backgroundColor = kBackgroundColor;"
|
69
91
|
puts " _#{name}.contentMode = UIViewContentModeScaleAspectFit;"
|
70
92
|
puts " _#{name}.clipsToBounds = YES;"
|
71
93
|
puts " _#{name}.layer.cornerRadius = 6.0f;"
|
72
94
|
puts " _#{name}.layer.borderColor = kLineColor.CGColor;"
|
73
95
|
puts " _#{name}.layer.borderWidth = 0.5;"
|
74
|
-
elsif
|
96
|
+
elsif type.eql?('UITextField')
|
75
97
|
puts " _#{name}.textColor = kSetCOLOR(0x333333);"
|
76
98
|
puts " _#{name}.font = [UIFont systemFontOfSize:12.0 weight:UIFontWeightRegular];"
|
77
|
-
elsif
|
99
|
+
elsif type.eql?('UIView')
|
78
100
|
puts " _#{name}.backgroundColor = kBackgroundColor;"
|
79
|
-
elsif
|
101
|
+
elsif type.eql?('UIStackView')
|
102
|
+
puts " _#{name}.axis = UILayoutConstraintAxisHorizontal;"
|
103
|
+
puts " _#{name}.distribution = UIStackViewDistributionFillEqually;"
|
104
|
+
elsif type.eql?('UITableView')
|
80
105
|
puts " _#{name}.backgroundColor = kBackgroundColor;"
|
81
106
|
puts " _#{name}.delegate = self;"
|
82
107
|
puts " _#{name}.delegate = self;"
|
83
108
|
puts " _#{name}.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];"
|
84
109
|
puts " _#{name}.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];"
|
85
110
|
puts " _#{name}.separatorStyle = UITableViewCellSeparatorStyleNone;"
|
86
|
-
elsif
|
111
|
+
elsif type.eql?('UIButton')
|
87
112
|
puts " _#{name}.backgroundColor = kBackgroundColor;"
|
88
113
|
puts " [_#{name} setTitle:@\"xxx\" forState:UIControlStateNormal];"
|
89
114
|
puts " [_#{name} setTitleColor:kSetCOLOR(0x999999) forState:UIControlStateNormal];"
|
115
|
+
puts " _#{name}.titleLabel.font = [UIFont systemFontOfSize:14.0 weight:UIFontWeightRegular];"
|
90
116
|
puts " [_#{name} setImage:[UIImage imageNamed:@\"xx\"] forState:UIControlStateNormal];"
|
91
117
|
puts " [_#{name} setImage:[UIImage imageNamed:@\"xx\"] forState:UIControlStateSelected];"
|
92
118
|
puts " [_#{name} addTarget:self action:@selector(actionHandler:) forControlEvents:UIControlEventTouchUpInside];"
|
@@ -100,13 +126,15 @@ module Pod
|
|
100
126
|
puts "[self.#{name}.trailingAnchor constraintEqualToAnchor:contentView.trailingAnchor constant:0].active = YES;"
|
101
127
|
puts "[self.#{name}.topAnchor constraintEqualToAnchor:contentView.topAnchor].active = YES;"
|
102
128
|
puts "[self.#{name}.bottomAnchor constraintEqualToAnchor:contentView.bottomAnchor].active = YES;"
|
129
|
+
puts "[self.#{name}.widthAnchor constraintEqualToConstant:80].active = YES;"
|
130
|
+
puts "[self.#{name}.heightAnchor constraintEqualToAnchor:80].active = YES;"
|
103
131
|
puts "\n\n"
|
104
132
|
end
|
105
133
|
end
|
106
134
|
|
107
135
|
def print_value
|
108
136
|
names.each do |name|
|
109
|
-
if
|
137
|
+
if type.eql?('UILabel')
|
110
138
|
puts "self.#{name}.text = @\"xxxxx\";"
|
111
139
|
end
|
112
140
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-aomi-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lihaijian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|