@compass-framework/core 1.2.56 → 1.2.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/AbsoluteLayout.d.ts +6 -0
- package/@types/AccelerateDecelerateInterpolator.d.ts +3 -0
- package/@types/AccelerateInterpolator.d.ts +3 -0
- package/@types/Adapter.d.ts +6 -0
- package/@types/AlphaAnimation.d.ts +6 -1
- package/@types/Animation.d.ts +15 -2
- package/@types/AnimationSet.d.ts +5 -1
- package/@types/Animator.d.ts +12 -0
- package/@types/Application.d.ts +49 -11
- package/@types/ApplicationWindow.d.ts +9 -5
- package/@types/ArrayAdapter.d.ts +3 -0
- package/@types/Assets.d.ts +3 -0
- package/@types/AttributeSet.d.ts +5 -2
- package/@types/BaseAdapter.d.ts +3 -0
- package/@types/BlendMode.ts +150 -0
- package/@types/BounceInterpolator.d.ts +3 -0
- package/@types/Button.d.ts +3 -0
- package/@types/Canvas.d.ts +46 -60
- package/@types/Color.d.ts +40 -30
- package/@types/ColorDrawable.d.ts +5 -1
- package/@types/ColorFilter.ts +15 -0
- package/@types/Configuration.d.ts +3 -0
- package/@types/Context.d.ts +21 -3
- package/@types/ContextUtils.d.ts +3 -0
- package/@types/CornerPathEffect.d.ts +26 -0
- package/@types/CornersDrawable.d.ts +15 -6
- package/@types/CycleInterpolator.d.ts +3 -0
- package/@types/DecelerateInterpolator.d.ts +3 -0
- package/@types/DisplayMetrics.d.ts +3 -0
- package/@types/DoubleClick.d.ts +3 -0
- package/@types/DoubleClickListener.d.ts +6 -0
- package/@types/Drawable.d.ts +20 -5
- package/@types/EditRichText.d.ts +3 -0
- package/@types/EditText.d.ts +3 -0
- package/@types/Editable.d.ts +6 -0
- package/@types/Environment.ts +3 -0
- package/@types/FrameLayout.d.ts +8 -2
- package/@types/FreezeAbsoluteLayout.d.ts +6 -0
- package/@types/FreezeLayoutViewGroup.d.ts +3 -0
- package/@types/Gravity.d.ts +3 -0
- package/@types/GridLayout.d.ts +6 -0
- package/@types/GridLayoutAnimationController.d.ts +3 -0
- package/@types/GridView.d.ts +3 -0
- package/@types/HorizontalScrollView.ts +3 -0
- package/@types/Image.d.ts +28 -0
- package/@types/ImageDrawable.ts +43 -0
- package/@types/ImageFilter.ts +13 -0
- package/@types/ImageView.d.ts +9 -0
- package/@types/InputMethodService.d.ts +6 -0
- package/@types/Interpolator.d.ts +6 -0
- package/@types/KeyEvent.d.ts +3 -0
- package/@types/LayerDrawable.d.ts +6 -2
- package/@types/LayoutAnimationController.d.ts +9 -0
- package/@types/LayoutInflater.ts +3 -0
- package/@types/LinearGradient.d.ts +22 -2
- package/@types/LinearGradientDrawable.d.ts +3 -0
- package/@types/LinearInterpolator.d.ts +3 -0
- package/@types/LinearLayout.d.ts +6 -0
- package/@types/ListAdapter.d.ts +6 -0
- package/@types/ListView.d.ts +3 -0
- package/@types/Matrix.d.ts +110 -53
- package/@types/MotionEvent.d.ts +9 -0
- package/@types/{ICursor.d.ts → MouseCursor.ts} +18 -7
- package/@types/Outline.d.ts +6 -2
- package/@types/Paint.d.ts +141 -76
- package/@types/Path.d.ts +86 -44
- package/@types/PathEffect.ts +7 -1
- package/@types/Picture.d.ts +24 -15
- package/@types/PictureDrawable.d.ts +7 -5
- package/@types/PixelFormat.ts +3 -0
- package/@types/PopupWindow.d.ts +9 -6
- package/@types/PropertyValuesHolder.d.ts +3 -0
- package/@types/Rect.d.ts +66 -43
- package/@types/RelativeLayout.d.ts +6 -0
- package/@types/RendererBackend.ts +8 -0
- package/@types/Resolver.ts +7 -2
- package/@types/Resources.d.ts +3 -0
- package/@types/ResourcesInflater.d.ts +3 -0
- package/@types/RotateAnimation.d.ts +7 -3
- package/@types/ScaleAnimation.d.ts +7 -3
- package/@types/ScrollView.d.ts +3 -0
- package/@types/Shader.d.ts +15 -1
- package/@types/Shadow.d.ts +32 -6
- package/@types/Slot.d.ts +9 -0
- package/@types/Surface.d.ts +32 -0
- package/@types/SurfaceProvider.d.ts +25 -0
- package/@types/TabBarLayout.d.ts +12 -0
- package/@types/TableLayout.d.ts +6 -0
- package/@types/TableRow.d.ts +6 -0
- package/@types/TextView.d.ts +3 -0
- package/@types/Theme.d.ts +9 -0
- package/@types/TimeInterpolator.d.ts +6 -0
- package/@types/Transformation.d.ts +6 -0
- package/@types/TranslateAnimation.d.ts +6 -2
- package/@types/TypeEvaluator.d.ts +3 -0
- package/@types/Typeface.d.ts +21 -3
- package/@types/TypefaceFactory.d.ts +40 -4
- package/@types/ValueAnimator.d.ts +12 -0
- package/@types/View.d.ts +66 -0
- package/@types/ViewGroup.d.ts +9 -0
- package/@types/ViewGroupOverlay.d.ts +3 -0
- package/@types/ViewOutlineProvider.d.ts +3 -0
- package/@types/ViewOverlay.d.ts +3 -0
- package/@types/ViewParent.d.ts +6 -0
- package/@types/ViewSlot.d.ts +3 -0
- package/@types/ViewTreeObserver.d.ts +27 -0
- package/@types/{IWindow.d.ts → Window.d.ts} +10 -4
- package/@types/WindowManager.d.ts +14 -6
- package/@types/XMLLayoutParser.d.ts +3 -0
- package/@types/XMLResourcesParser.d.ts +3 -0
- package/@types/XMLViewFactoryRegistry.d.ts +18 -0
- package/index.d.ts +111 -113
- package/package.json +2 -2
- package/@types/ApplicationBoot.ts +0 -10
- package/@types/ApplicationContext.d.ts +0 -3
- package/@types/ApplicationFrame.d.ts +0 -33
- package/@types/ApplicationFrameContext.ts +0 -5
- package/@types/ApplicationFrameObserver.d.ts +0 -17
- package/@types/ApplicationFrameSettings.ts +0 -5
- package/@types/ApplicationManifest.d.ts +0 -5
- package/@types/Bitmap.d.ts +0 -7
- package/@types/BitmapDrawable.d.ts +0 -31
- package/@types/CornerPathEffect.ts +0 -7
- package/@types/InputMethodServer.ts +0 -1
- package/@types/Readying.ts +0 -3
- package/@types/StackLayout.d.ts +0 -9
- package/@types/WindowContext.d.ts +0 -9
package/@types/Paint.d.ts
CHANGED
|
@@ -1,137 +1,202 @@
|
|
|
1
|
-
import { CharSequence,
|
|
2
|
-
import { Rect } from "./Rect";
|
|
3
|
-
import { Shadow } from "./Shadow";
|
|
1
|
+
import { CharSequence, InterfaceTemplate } from "@compass-framework/library";
|
|
4
2
|
import { Shader } from "./Shader";
|
|
3
|
+
import { Shadow } from "./Shadow";
|
|
4
|
+
import { Rect } from "./Rect";
|
|
5
5
|
import { Typeface } from "./Typeface";
|
|
6
6
|
import { PathEffect } from "./PathEffect";
|
|
7
|
+
import { Context } from "./Context";
|
|
8
|
+
import { ColorFilter } from "./ColorFilter";
|
|
9
|
+
import { BlendMode } from "./BlendMode";
|
|
10
|
+
import { ImageFilter } from "./ImageFilter";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 画笔,描述颜色、样式、字体等绘制属性。
|
|
14
|
+
*/
|
|
15
|
+
export interface Paint {
|
|
16
|
+
measureText(text: CharSequence): number;
|
|
17
|
+
measureText(text: CharSequence, start: number, end: number): number;
|
|
18
|
+
|
|
19
|
+
set(paint: Paint): Paint
|
|
20
|
+
|
|
21
|
+
adjustForPixelPerfectLine(pixel: number): void;
|
|
22
|
+
|
|
23
|
+
isAntiAlias(): boolean;
|
|
24
|
+
|
|
25
|
+
isTextSkewX(): boolean;
|
|
7
26
|
|
|
8
|
-
|
|
9
|
-
public static UNDERLINE_TEXT_FLAG: number;
|
|
10
|
-
public static STRIKE_THRU_TEXT_FLAG: number;
|
|
27
|
+
getPixelPerfectLine(): number
|
|
11
28
|
|
|
12
|
-
|
|
13
|
-
|
|
29
|
+
getFontMetrics(): Paint.FontMetrics
|
|
30
|
+
getFontMetrics(fontMetrics: Paint.FontMetrics): number
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
getTextWidths(text: CharSequence, widths: number[]): number
|
|
33
|
+
getTextWidths(text: CharSequence, start: number, end: number, widths: number[]): number
|
|
34
|
+
getTextWidths(text: string[], index:number, count:number, widths: number[]): number
|
|
16
35
|
|
|
17
|
-
|
|
36
|
+
getTextBounds(text: CharSequence, bounds: Rect): void
|
|
37
|
+
getTextBounds(text: CharSequence, start: number, end: number, bounds: Rect): void
|
|
18
38
|
|
|
19
|
-
|
|
20
|
-
|
|
39
|
+
breakText(text: CharSequence, measureForwards: boolean, maxWidth: number, measuredWidth: number[]): number
|
|
40
|
+
breakText(text: CharSequence, start: number, end: number, measureForwards: boolean, maxWidth: number, measuredWidth: number[]): number
|
|
21
41
|
|
|
22
|
-
|
|
23
|
-
public breakText(text: CharSequence, start: number, end: number, measureForwards: boolean, maxWidth: number, measuredWidth: number[]): number;
|
|
42
|
+
getStyle(): Paint.Style;
|
|
24
43
|
|
|
25
|
-
|
|
44
|
+
copy(): Paint;
|
|
26
45
|
|
|
27
|
-
|
|
46
|
+
getImageFilter(): ImageFilter;
|
|
28
47
|
|
|
29
|
-
|
|
30
|
-
public getTextWidths(text: TextString, start: number, end: number, widths: number[]): number;
|
|
31
|
-
public getTextWidths(text: CharSequence, start: number, end: number, widths: number[]): number;
|
|
48
|
+
getFlags(): number
|
|
32
49
|
|
|
33
|
-
|
|
34
|
-
public getTextBounds(text: CharSequence, start: number, end: number, bounds: Rect): void;
|
|
50
|
+
getAlpha(): number
|
|
35
51
|
|
|
36
|
-
|
|
37
|
-
public getFontMetrics(fontMetrics: Paint.FontMetrics): number;
|
|
52
|
+
getColor(): number
|
|
38
53
|
|
|
39
|
-
|
|
40
|
-
public getTextFontMetrics(text: CharSequence, fontMetrics: Paint.FontMetrics): number;
|
|
54
|
+
getColorString(): string
|
|
41
55
|
|
|
42
|
-
|
|
56
|
+
getStrokeJoin(): Paint.Join
|
|
43
57
|
|
|
44
|
-
|
|
58
|
+
getStrokeCap(): Paint.Cap
|
|
45
59
|
|
|
46
|
-
|
|
60
|
+
getShadow(): Shadow
|
|
47
61
|
|
|
48
|
-
|
|
62
|
+
getTextSize(): number
|
|
49
63
|
|
|
50
|
-
|
|
64
|
+
getColorFilter(): ColorFilter;
|
|
51
65
|
|
|
52
|
-
|
|
66
|
+
getTextAlign(): Paint.Align
|
|
53
67
|
|
|
54
|
-
|
|
68
|
+
getShader(): Shader;
|
|
55
69
|
|
|
56
|
-
|
|
70
|
+
getStrokeWidth(): number
|
|
57
71
|
|
|
58
|
-
|
|
72
|
+
getTextSkewX(): number;
|
|
59
73
|
|
|
60
|
-
|
|
74
|
+
getFakeBoldText(): boolean;
|
|
61
75
|
|
|
62
|
-
|
|
76
|
+
getBlendMode(): BlendMode;
|
|
63
77
|
|
|
64
|
-
|
|
78
|
+
getTypeface(): Typeface;
|
|
65
79
|
|
|
66
|
-
|
|
80
|
+
getPathEffect(): PathEffect
|
|
67
81
|
|
|
68
|
-
|
|
82
|
+
getTextScaleX(): number;
|
|
69
83
|
|
|
70
|
-
|
|
84
|
+
setStrokeWidth(width: number): void
|
|
71
85
|
|
|
72
|
-
|
|
86
|
+
setPathEffect(pathEffect: PathEffect): void
|
|
73
87
|
|
|
74
|
-
|
|
88
|
+
setAntiAlias(aa: boolean): void;
|
|
75
89
|
|
|
76
|
-
|
|
90
|
+
setColor(color: number): void
|
|
77
91
|
|
|
78
|
-
|
|
92
|
+
setStrokeJoin(join: Paint.Join): void
|
|
79
93
|
|
|
80
|
-
|
|
94
|
+
setTextSize(textSize: number): void
|
|
81
95
|
|
|
82
|
-
|
|
96
|
+
setStrokeCap(cap: Paint.Cap): void
|
|
83
97
|
|
|
84
|
-
|
|
98
|
+
getFontSpacing(): number;
|
|
85
99
|
|
|
86
|
-
|
|
100
|
+
setTextAlign(textAlign: Paint.Align): void
|
|
87
101
|
|
|
88
|
-
|
|
102
|
+
setFlags(flags: number): void
|
|
89
103
|
|
|
90
|
-
|
|
104
|
+
setImageFilter(imageFilter: ImageFilter): void;
|
|
91
105
|
|
|
92
|
-
|
|
106
|
+
setStyle(style: Paint.Style): void
|
|
93
107
|
|
|
94
|
-
|
|
108
|
+
setAlpha(a: number): void
|
|
95
109
|
|
|
96
|
-
|
|
110
|
+
setShadow(shadow: Shadow): void
|
|
97
111
|
|
|
98
|
-
|
|
112
|
+
setShader(shader: Shader): void
|
|
99
113
|
|
|
100
|
-
|
|
114
|
+
setColorFilter(filter: ColorFilter): void;
|
|
101
115
|
|
|
102
|
-
|
|
116
|
+
setARGB(a: number, r: number, g: number, b: number): void
|
|
117
|
+
|
|
118
|
+
setTypeface(typeface: Typeface): void;
|
|
119
|
+
|
|
120
|
+
setTextScaleX(scaleX: number): void;
|
|
121
|
+
|
|
122
|
+
setTextSkewX(value: number): void;
|
|
123
|
+
|
|
124
|
+
setFakeBoldText(value: boolean): void;
|
|
125
|
+
|
|
126
|
+
setBlendMode(mode: BlendMode): void;
|
|
127
|
+
|
|
128
|
+
setStrikeThruText(value: boolean): void;
|
|
129
|
+
|
|
130
|
+
dispose(): void;
|
|
131
|
+
|
|
132
|
+
toString(): CharSequence;
|
|
103
133
|
}
|
|
104
134
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Paint 接口的实现基类。
|
|
137
|
+
*/
|
|
138
|
+
export abstract class Paint extends InterfaceTemplate {}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Paint 相关类型与工厂方法。
|
|
142
|
+
*/
|
|
143
|
+
export namespace Paint {
|
|
144
|
+
export const UNDERLINE_TEXT_FLAG: number;
|
|
145
|
+
export const STRIKE_THRU_TEXT_FLAG: number;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 字体度量信息。
|
|
149
|
+
*/
|
|
150
|
+
export class FontMetrics {
|
|
151
|
+
public ascent: number;
|
|
152
|
+
public descent: number;
|
|
153
|
+
public top: number;
|
|
154
|
+
public bottom: number;
|
|
155
|
+
public leading: number;
|
|
156
|
+
public left: number;
|
|
157
|
+
public right: number;
|
|
158
|
+
|
|
159
|
+
public set(metrics: FontMetrics): FontMetrics;
|
|
110
160
|
}
|
|
111
161
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
162
|
+
/**
|
|
163
|
+
* 描边转角连接样式。
|
|
164
|
+
*/
|
|
165
|
+
export enum Join {
|
|
166
|
+
BEVEL = "bevel",
|
|
167
|
+
MITER = "miter",
|
|
168
|
+
ROUND = "round",
|
|
116
169
|
}
|
|
117
170
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
171
|
+
/**
|
|
172
|
+
* 描边端点样式。
|
|
173
|
+
*/
|
|
174
|
+
export enum Cap {
|
|
175
|
+
BUTT = "butt",
|
|
176
|
+
ROUND = "round",
|
|
177
|
+
SQUARE = "square",
|
|
122
178
|
}
|
|
123
179
|
|
|
124
|
-
|
|
180
|
+
/**
|
|
181
|
+
* 填充与描边绘制样式。
|
|
182
|
+
*/
|
|
183
|
+
export enum Style {
|
|
125
184
|
FILL,
|
|
126
185
|
STROKE,
|
|
127
186
|
FILL_AND_STROKE,
|
|
128
187
|
}
|
|
129
188
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
189
|
+
/**
|
|
190
|
+
* 文本水平对齐方式。
|
|
191
|
+
*/
|
|
192
|
+
export enum Align {
|
|
193
|
+
LEFT = 'left',
|
|
194
|
+
CENTER = 'center',
|
|
195
|
+
RIGHT = 'right',
|
|
136
196
|
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* 创建 Paint 实例。
|
|
200
|
+
*/
|
|
201
|
+
export function create(context: Context): Paint;
|
|
137
202
|
}
|
package/@types/Path.d.ts
CHANGED
|
@@ -1,77 +1,119 @@
|
|
|
1
|
+
import { InterfaceTemplate } from "@compass-framework/library";
|
|
1
2
|
import { Rect } from "./Rect";
|
|
2
3
|
import { Matrix } from "./Matrix";
|
|
4
|
+
import { PathEffect } from "./PathEffect";
|
|
5
|
+
import { Context } from "./Context";
|
|
3
6
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* 矢量路径,用于描述可绘制的几何轮廓。
|
|
9
|
+
*/
|
|
10
|
+
export interface Path {
|
|
11
|
+
setFillType(ft: Path.FillType): void
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
public arcTo(oval: Rect, startAngle: number, sweepAngle: number, forceMoveTo: boolean): void;
|
|
13
|
+
getFillType(): Path.FillType
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
public addRect(left: number, top: number, right: number, bottom: number, dir: Path.Direction): void;
|
|
15
|
+
isInverseFillType(): boolean
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
toggleInverseFillType(): void
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
arcTo(oval:Rect, startAngle: number, sweepAngle: number): void;
|
|
20
|
+
arcTo(oval: Rect, startAngle: number, sweepAngle: number, forceMoveTo: boolean): void;
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
addRect(rect: Rect, dir: Path.Direction): void;
|
|
23
|
+
addRect(left: number, top: number, right: number, bottom: number, dir: Path.Direction): void;
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
public addPath(src: Path, dx: number, dy: number): void;
|
|
25
|
+
addOval(oval: Rect, dir: Path.Direction): void
|
|
26
|
+
addOval(left: number, top: number, right: number, bottom: number, dir: Path.Direction): void
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
public addRoundRect(rect: Rect, rx: number, ry: number, dir: Path.Direction): void;
|
|
28
|
+
addCircle(x: number, y: number, radius: number, dir: Path.Direction): void
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
addPath(src: Path): void;
|
|
31
|
+
addPath(src: Path, matrix: Matrix): void;
|
|
32
|
+
addPath(src: Path, dx: number, dy: number): void;
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
addArc(oval:Rect, startAngle: number, sweepAngle: number): void;
|
|
35
|
+
addArc(left:number, top:number, right:number, bottom:number, startAngle: number, sweepAngle: number): void;
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
addRoundRect(rect: Rect, radii: number[], dir: Path.Direction): void;
|
|
38
|
+
addRoundRect(rect: Rect, rx: number, ry: number, dir: Path.Direction): void;
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
offset(dx: number, dy: number): void;
|
|
41
|
+
offset(dx: number, dy: number, dst: Path): void;
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
setLastPoint(dx: number, dy: number): void
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
transform(matrix: Matrix): void;
|
|
46
|
+
transform(matrix: Matrix, dst: Path): void;
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
quadTo(x1: number, y1: number, x2: number, y2: number): void
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
rQuadTo(dx1: number, dy1: number, dx2: number, dy2: number): void
|
|
45
51
|
|
|
46
|
-
|
|
52
|
+
reWind(): void
|
|
47
53
|
|
|
48
|
-
|
|
54
|
+
reset(): void
|
|
49
55
|
|
|
50
|
-
|
|
56
|
+
round(): void
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
set(src: Path): void
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
isEmpty(): boolean
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
isRect(rect: Rect): boolean
|
|
57
63
|
|
|
58
|
-
|
|
64
|
+
isConvex(): boolean
|
|
59
65
|
|
|
60
|
-
|
|
66
|
+
close():void
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
computeBounds(bounds: Rect, exact: boolean): void
|
|
69
|
+
|
|
70
|
+
moveTo(x: number, y: number): void
|
|
71
|
+
|
|
72
|
+
rMoveTo(dx: number, dy: number): void
|
|
73
|
+
|
|
74
|
+
lineTo(x: number, y: number): void
|
|
75
|
+
|
|
76
|
+
rLineTo(dx: number, dy: number): void
|
|
77
|
+
|
|
78
|
+
cubicTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): void
|
|
79
|
+
|
|
80
|
+
rCubicTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): void
|
|
81
|
+
|
|
82
|
+
setPathEffect(pathEffect: PathEffect, strokeWidth: number): void
|
|
83
|
+
|
|
84
|
+
dispose(): void;
|
|
63
85
|
}
|
|
64
86
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Path 接口的实现基类。
|
|
89
|
+
*/
|
|
90
|
+
export abstract class Path extends InterfaceTemplate {}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Path 相关类型与工厂方法。
|
|
94
|
+
*/
|
|
95
|
+
export namespace Path {
|
|
96
|
+
/**
|
|
97
|
+
* 路径绕向(顺时针/逆时针)。
|
|
98
|
+
*/
|
|
99
|
+
export enum Direction {
|
|
100
|
+
CW,
|
|
101
|
+
CCW,
|
|
69
102
|
}
|
|
70
103
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
104
|
+
/**
|
|
105
|
+
* 路径填充规则。
|
|
106
|
+
*/
|
|
107
|
+
export enum FillType {
|
|
108
|
+
WINDING,
|
|
109
|
+
EVEN_ODD,
|
|
110
|
+
INVERSE_WINDING,
|
|
111
|
+
INVERSE_EVEN_ODD,
|
|
76
112
|
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 创建 Path 实例。
|
|
116
|
+
*/
|
|
117
|
+
export function create(context: Context): Path;
|
|
118
|
+
export function create(context: Context, path: Path): Path;
|
|
77
119
|
}
|
package/@types/PathEffect.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { InterfaceTemplate } from "@compass-framework/library";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* 路径效果,用于修改描边或轮廓的外观。
|
|
5
|
+
*/
|
|
3
6
|
export declare interface PathEffect {
|
|
4
|
-
|
|
7
|
+
dispose(): void;
|
|
5
8
|
}
|
|
6
9
|
|
|
10
|
+
/**
|
|
11
|
+
* PathEffect 接口的实现基类。
|
|
12
|
+
*/
|
|
7
13
|
export class PathEffect extends InterfaceTemplate {}
|
package/@types/Picture.d.ts
CHANGED
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import { Consumer
|
|
2
|
-
import {
|
|
1
|
+
import { Consumer } from "@compass-framework/library";
|
|
2
|
+
import { Image } from "./Image";
|
|
3
|
+
import { Context } from "./Context";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* 图片资源,异步加载并提供位图图像。
|
|
7
|
+
*/
|
|
8
|
+
export declare class Picture {
|
|
9
|
+
public constructor(context: Context, url?: string);
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
public complete(): boolean;
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
public oneListener(notify: Consumer<Picture.PictureStatus>): void;
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
public addListener(notify: Consumer<Picture.PictureStatus>): void;
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
public removeListener(notify: Consumer<Picture.PictureStatus>): void;
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
public dispose(): void;
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
public getWidth(): number;
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
public getUrl(): string;
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
asBitmap(scale: number): Bitmap
|
|
23
|
-
}
|
|
25
|
+
public getHeight(): number;
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
public getImage(): Image;
|
|
26
28
|
|
|
29
|
+
public setUrl(url: string): void;
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Picture 相关状态类型。
|
|
34
|
+
*/
|
|
29
35
|
export declare namespace Picture {
|
|
36
|
+
/**
|
|
37
|
+
* 图片加载完成状态。
|
|
38
|
+
*/
|
|
30
39
|
enum PictureStatus {
|
|
31
40
|
OK,
|
|
32
41
|
FAIL,
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Consumer, Implements } from "@compass-framework/library";
|
|
2
2
|
import { Paint } from "./Paint";
|
|
3
|
-
import {
|
|
3
|
+
import { ImageDrawable } from "./ImageDrawable";
|
|
4
4
|
import { Picture } from "./Picture";
|
|
5
5
|
import { ImageView } from "./ImageView";
|
|
6
|
+
import { Context } from "./Context";
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* 基于 Picture 的图像 Drawable,支持加载状态通知。
|
|
10
|
+
*/
|
|
7
11
|
@Implements(ImageView.UpdateNotification)
|
|
8
|
-
export declare class PictureDrawable extends
|
|
9
|
-
public constructor(url
|
|
12
|
+
export declare class PictureDrawable extends ImageDrawable implements ImageView.UpdateNotification<Picture.PictureStatus> {
|
|
13
|
+
public constructor(context: Context, url: string);
|
|
10
14
|
|
|
11
15
|
public addNotification(c: Consumer<Picture.PictureStatus>): void;
|
|
12
16
|
|
|
@@ -14,8 +18,6 @@ export declare class PictureDrawable extends BitmapDrawable implements ImageView
|
|
|
14
18
|
|
|
15
19
|
public removeNotification(c: Consumer<Picture.PictureStatus>): void;
|
|
16
20
|
|
|
17
|
-
public setUrl(url: string): void;
|
|
18
|
-
|
|
19
21
|
public invalidate() : void;
|
|
20
22
|
|
|
21
23
|
public getUrl(): string;
|
package/@types/PixelFormat.ts
CHANGED
package/@types/PopupWindow.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { ArrayList, Implements, XML } from "@compass-framework/library";
|
|
2
2
|
import { Resources } from "./Resources";
|
|
3
|
-
import { IWindow } from "./IWindow";
|
|
4
3
|
import { View } from "./View";
|
|
5
|
-
import { WindowContext } from "./WindowContext";
|
|
6
4
|
import { ViewGroup } from "./ViewGroup";
|
|
7
5
|
import { WindowManager } from "./WindowManager";
|
|
6
|
+
import { Window } from "./Window";
|
|
8
7
|
import { Configuration } from "./Configuration";
|
|
8
|
+
import { Context } from "./Context";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* 弹出窗口,在指定位置展示浮动内容视图。
|
|
12
|
+
*/
|
|
13
|
+
@Implements(Window)
|
|
14
|
+
export declare class PopupWindow implements Window {
|
|
12
15
|
public constructor();
|
|
13
16
|
|
|
14
17
|
public findViewById(id: number): View;
|
|
@@ -18,7 +21,7 @@ export declare class PopupWindow implements IWindow {
|
|
|
18
21
|
|
|
19
22
|
public findViewsByTag(tag: string): ArrayList<View>;
|
|
20
23
|
|
|
21
|
-
public onAttach(context:
|
|
24
|
+
public onAttach(context: Context): void;
|
|
22
25
|
|
|
23
26
|
public onCreate(): void;
|
|
24
27
|
|
|
@@ -48,7 +51,7 @@ export declare class PopupWindow implements IWindow {
|
|
|
48
51
|
|
|
49
52
|
public getOnTouchListener(): View.OnTouchListener;
|
|
50
53
|
|
|
51
|
-
public
|
|
54
|
+
public getContext(): Context;
|
|
52
55
|
|
|
53
56
|
public getResources(): Resources;
|
|
54
57
|
|