/
CardView.yml
210 lines (174 loc) Β· 6.8 KB
/
CardView.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
name: Titanium.UI.Android.CardView
summary: An elevated view with rounded corners.
description: |
CardView provides a layout container with rounded corners and a shadow indicating the
view is elevated.
Use a CardView to layout content that:
* Comprises multiple data types
* Does not require direct comparison
* Supports variable length content or displays more than three lines of text
* Contains rich content or interactive elements, such as comments or a favorite button
If you are displaying a collection of the same type in a uniform layout without many actions,
use a [ListView](Titanium.UI.ListView) or [TableView](Titanium.UI.TableView) instead.
For design guidelines, see
[Google Design Guidelines: Cards](http://www.google.com/design/spec/components/cards.html)
CardView does not support <Titanium.UI.View.backgroundImage> & <Titanium.UI.View.borderColor>.
extends: Titanium.UI.View
since: "5.1.0"
platforms: [android]
properties:
- name: cardBackgroundColor
summary: Background color for CardView as a color name or hex triplet.
description: |
For information about color values, see the "Colors" section of <Titanium.UI>.
type: String
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.backgroundColor>
- name: backgroundColor
summary: Background color for CardView as a color name or hex triplet.
description: |
For information about color values, see the "Colors" section of <Titanium.UI>.
type: String
since: 5.1.2
- name: cardCornerRadius
summary: Corner radius for CardView.
type: Number
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.borderRadius>
- name: borderRadius
summary: Corner radius for CardView.
type: Number
since: 5.1.2
- name: cardElevation
summary: Elevation for CardView.
type: Number
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.elevation>
- name: elevation
summary: Elevation for CardView.
type: Number
since: 5.1.2
- name: cardMaxElevation
summary: Maximum Elevation for CardView.
type: Number
availability: creation
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.maxElevation>
- name: maxElevation
summary: Maximum Elevation for CardView.
type: Number
availability: creation
since: 5.1.2
- name: cardPreventCornerOverlap
summary: |
Add padding to CardView on API level 20 and before to prevent intersections between
the Card content and rounded corners.
type: Boolean
default: false
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.preventCornerOverlap>
- name: preventCornerOverlap
summary: |
Add padding to CardView on API level 20 and before to prevent intersections between
the Card content and rounded corners.
type: Boolean
default: false
since: 5.1.2
- name: cardUseCompatPadding
summary: Add padding on API level 21 and above to have the same measurements with previous versions.
type: Boolean
default: false
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.useCompatPadding>
- name: useCompatPadding
summary: Add padding on API level 21 and above to have the same measurements with previous versions.
type: Boolean
default: false
since: 5.1.2
- name: contentPadding
summary: Inner padding between the edges of the Card and children of the CardView.
type: Number
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.padding>
- name: padding
summary: Inner padding between the edges of the Card and children of the CardView.
type: Number
since: 5.1.2
- name: contentPaddingBottom
summary: Inner padding between the bottom edge of the Card and children of the CardView.
type: Number
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.paddingBottom>
- name: paddingBottom
summary: Inner padding between the bottom edge of the Card and children of the CardView.
type: Number
since: 5.1.2
- name: contentPaddingLeft
summary: Inner padding between the left edge of the Card and children of the CardView.
type: Number
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.paddingLeft>
- name: paddingLeft
summary: Inner padding between the left edge of the Card and children of the CardView.
type: Number
since: 5.1.2
- name: contentPaddingRight
summary: Inner padding between the right edge of the Card and children of the CardView.
type: Number
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.paddingRight>
- name: paddingRight
summary: Inner padding between the right edge of the Card and children of the CardView.
type: Number
since: 5.1.2
- name: contentPaddingTop
summary: Inner padding between the top edge of the Card and children of the CardView.
type: Number
deprecated:
since: 5.1.2
notes: This property is deprecated. Please use <Titanium.UI.Android.CardView.paddingTop>
- name: paddingTop
summary: Inner padding between the top edge of the Card and children of the CardView.
type: Number
since: 5.1.2
examples:
- title: CardView used in a ScrollView
example: |
The following example creates a CardView used in a ScrollView.
var win = Ti.UI.createWindow({
backgroundColor:'white',
title: 'Card Demo'
});
function createRow(i) {
var card = Ti.UI.Android.createCardView({
contentPadding: 20,
cardCornerRadius: 10,
cardUseCompatPadding: true
});
var label = Ti.UI.createLabel({
color:'black',
text: 'A long label with\na few line breaks\nand unicode (UTF8)\nsymbols such as\na white chess piece \u2655\nand the euro symbol \u20ac\nlooks like this!\n',
});
card.add(label);
return card;
}
var scrollView = Ti.UI.createScrollView({
layout: 'vertical'
});
for (var i = 0; i <= 20; i++) {
var row = createRow(i);
scrollView.add(row);
}
win.add(scrollView);
win.open();