@compass-framework/core 1.0.0
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/.eslintignore +9 -0
- package/.eslintrc.js +76 -0
- package/include/AbsoluteLayout.d.ts +7 -0
- package/include/AccelerateDecelerateInterpolator.d.ts +7 -0
- package/include/AccelerateInterpolator.d.ts +10 -0
- package/include/Adapter.d.ts +20 -0
- package/include/AlphaAnimation.d.ts +11 -0
- package/include/Animation.d.ts +119 -0
- package/include/AnimationSet.d.ts +58 -0
- package/include/Animator.d.ts +53 -0
- package/include/Application.d.ts +19 -0
- package/include/ApplicationContext.d.ts +11 -0
- package/include/ApplicationFrame.d.ts +62 -0
- package/include/ApplicationFrameContext.ts +25 -0
- package/include/ApplicationFrameObserver.d.ts +14 -0
- package/include/ApplicationManager.d.ts +9 -0
- package/include/ApplicationManifest.d.ts +5 -0
- package/include/ApplicationSettings.d.ts +3 -0
- package/include/ApplicationWindow.d.ts +37 -0
- package/include/ArrayAdapter.d.ts +52 -0
- package/include/Assets.d.ts +3 -0
- package/include/AttributeSet.d.ts +40 -0
- package/include/BaseAdapter.d.ts +23 -0
- package/include/Bitmap.d.ts +7 -0
- package/include/BitmapDrawable.d.ts +33 -0
- package/include/BounceInterpolator.d.ts +5 -0
- package/include/Button.d.ts +3 -0
- package/include/Canvas.d.ts +106 -0
- package/include/Color.d.ts +46 -0
- package/include/ColorDrawable.d.ts +18 -0
- package/include/Configuration.d.ts +5 -0
- package/include/Context.d.ts +8 -0
- package/include/ContextUtils.d.ts +5 -0
- package/include/CornerPathEffect.ts +5 -0
- package/include/CycleInterpolator.d.ts +7 -0
- package/include/DecelerateInterpolator.d.ts +8 -0
- package/include/DecorView.d.ts +5 -0
- package/include/DensityMetrics.d.ts +11 -0
- package/include/DisplayMetrics.d.ts +7 -0
- package/include/DoubleClick.d.ts +9 -0
- package/include/DoubleClickListener.d.ts +10 -0
- package/include/Drawable.d.ts +67 -0
- package/include/EditText.d.ts +17 -0
- package/include/Editable.d.ts +5 -0
- package/include/FrameLayout.d.ts +7 -0
- package/include/FreezeAbsoluteLayout.d.ts +7 -0
- package/include/FreezeLayoutViewGroup.d.ts +23 -0
- package/include/Gravity.d.ts +38 -0
- package/include/GridLayout.d.ts +9 -0
- package/include/GridLayoutAnimationController.d.ts +5 -0
- package/include/GridView.d.ts +8 -0
- package/include/HorizontalScrollView.ts +11 -0
- package/include/ICursor.d.ts +33 -0
- package/include/IWindow.d.ts +28 -0
- package/include/ImageView.d.ts +3 -0
- package/include/Interpolator.d.ts +6 -0
- package/include/KeyEvent.d.ts +97 -0
- package/include/LayerDrawable.d.ts +28 -0
- package/include/LayoutAnimationController.d.ts +51 -0
- package/include/LayoutInflater.ts +10 -0
- package/include/LinearGradient.d.ts +5 -0
- package/include/LinearGradientDrawable.d.ts +23 -0
- package/include/LinearInterpolator.d.ts +5 -0
- package/include/LinearLayout.d.ts +14 -0
- package/include/ListAdapter.d.ts +5 -0
- package/include/ListView.d.ts +8 -0
- package/include/Matrix.d.ts +81 -0
- package/include/MotionEvent.d.ts +57 -0
- package/include/Outline.d.ts +23 -0
- package/include/Paint.d.ts +126 -0
- package/include/Path.d.ts +77 -0
- package/include/PathEffect.ts +3 -0
- package/include/Picture.d.ts +26 -0
- package/include/PictureDrawable.d.ts +14 -0
- package/include/PopupWindow.d.ts +38 -0
- package/include/PropertyValuesHolder.d.ts +3 -0
- package/include/Readying.ts +3 -0
- package/include/Rect.d.ts +75 -0
- package/include/RelativeLayout.d.ts +7 -0
- package/include/Resources.d.ts +62 -0
- package/include/RotateAnimation.d.ts +12 -0
- package/include/RoundedCornersDrawable.d.ts +47 -0
- package/include/ScaleAnimation.d.ts +12 -0
- package/include/ScrollView.d.ts +13 -0
- package/include/Shader.d.ts +1 -0
- package/include/Shadow.d.ts +8 -0
- package/include/StackLayout.d.ts +9 -0
- package/include/TabBarLayout.d.ts +23 -0
- package/include/TableLayout.d.ts +8 -0
- package/include/TableRow.d.ts +8 -0
- package/include/TextView.d.ts +20 -0
- package/include/TimeInterpolator.d.ts +3 -0
- package/include/Transformation.d.ts +24 -0
- package/include/TranslateAnimation.d.ts +11 -0
- package/include/TypeEvaluator.d.ts +3 -0
- package/include/Typeface.d.ts +14 -0
- package/include/TypefaceFactory.d.ts +9 -0
- package/include/ValueAnimator.d.ts +111 -0
- package/include/View.d.ts +342 -0
- package/include/ViewGroup.d.ts +108 -0
- package/include/ViewGroupOverlay.d.ts +11 -0
- package/include/ViewOutlineProvider.d.ts +8 -0
- package/include/ViewOverlay.d.ts +16 -0
- package/include/ViewParent.d.ts +5 -0
- package/include/ViewTreeObserver.d.ts +33 -0
- package/include/WindowContext.d.ts +9 -0
- package/include/WindowManager.d.ts +13 -0
- package/include/XMLLayoutParser.d.ts +9 -0
- package/include/XMLResourcesParser.d.ts +8 -0
- package/include/XMLViewFactoryRegistry.d.ts +42 -0
- package/index.d.ts +105 -0
- package/package.json +17 -0
- package/tsconfig.json +32 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Runnable,
|
|
3
|
+
List,
|
|
4
|
+
Interface,
|
|
5
|
+
Nullable,
|
|
6
|
+
} from "@compass-framework/library";
|
|
7
|
+
import { Context } from "./Context";
|
|
8
|
+
import { AttributeSet } from "./AttributeSet";
|
|
9
|
+
import { Canvas } from "./Canvas";
|
|
10
|
+
import { ViewGroup } from "./ViewGroup";
|
|
11
|
+
import { Drawable } from "./Drawable";
|
|
12
|
+
import { MotionEvent } from "./MotionEvent";
|
|
13
|
+
import { Matrix } from "./Matrix";
|
|
14
|
+
import { Resources } from "./Resources";
|
|
15
|
+
import { ViewParent } from "./ViewParent";
|
|
16
|
+
import { KeyEvent } from "./KeyEvent";
|
|
17
|
+
import { Rect } from "./Rect";
|
|
18
|
+
import { ViewOutlineProvider } from "./ViewOutlineProvider";
|
|
19
|
+
import { Outline } from "./Outline";
|
|
20
|
+
import { Animation } from "./Animation";
|
|
21
|
+
import { Transformation } from "./Transformation";
|
|
22
|
+
import { ViewTreeObserver } from "./ViewTreeObserver";
|
|
23
|
+
import { ViewOverlay } from "./ViewOverlay";
|
|
24
|
+
import { Configuration } from "./Configuration";
|
|
25
|
+
import { DensityMetrics } from "./DensityMetrics";
|
|
26
|
+
|
|
27
|
+
export declare class View implements Drawable.Callback {
|
|
28
|
+
public static resolveSize(size: number, measureSpec: number): number;
|
|
29
|
+
public static getMode(measureSpec: number): number;
|
|
30
|
+
public static getDefaultSize(size: number, measureSpec: number): number;
|
|
31
|
+
|
|
32
|
+
public static INVISIBLE: number;
|
|
33
|
+
public static GONE: number;
|
|
34
|
+
public static VISIBLE: number;
|
|
35
|
+
|
|
36
|
+
public constructor(context: Context);
|
|
37
|
+
public constructor(context: Context, attrs: AttributeSet);
|
|
38
|
+
|
|
39
|
+
public invalidateDrawable(who: Drawable): void;
|
|
40
|
+
|
|
41
|
+
public scheduleDrawable(who: Drawable, what: Runnable, when: number): void;
|
|
42
|
+
|
|
43
|
+
public unScheduleDrawable(who: Drawable, what: Runnable): void;
|
|
44
|
+
|
|
45
|
+
public isFocusable(): boolean;
|
|
46
|
+
|
|
47
|
+
public isFocusableInTouchMode(): boolean;
|
|
48
|
+
|
|
49
|
+
public isFocused(): boolean;
|
|
50
|
+
|
|
51
|
+
public invalidate(): void;
|
|
52
|
+
|
|
53
|
+
public invalidateOutline(): void;
|
|
54
|
+
|
|
55
|
+
public measure(widthMeasureSpec: number, heightMeasureSpec: number): void;
|
|
56
|
+
|
|
57
|
+
public layout(left: number, top: number, right: number, bottom: number): void;
|
|
58
|
+
|
|
59
|
+
public draw(canvas: Canvas): void;
|
|
60
|
+
|
|
61
|
+
public post(action:Runnable): boolean;
|
|
62
|
+
|
|
63
|
+
public removeCallbacks(action: Runnable): boolean;
|
|
64
|
+
|
|
65
|
+
public hasFocus(): boolean;
|
|
66
|
+
|
|
67
|
+
public requestLayout(): void;
|
|
68
|
+
|
|
69
|
+
public requestFocus(): boolean;
|
|
70
|
+
|
|
71
|
+
public createViewQuery(): View.ViewQuery;
|
|
72
|
+
public createViewQuery(resources: Resources): View.ViewQuery;
|
|
73
|
+
|
|
74
|
+
public clearFocus(): void;
|
|
75
|
+
|
|
76
|
+
public addOnAttachStateChangeListener(listener:View.OnAttachStateChangeListener): void;
|
|
77
|
+
|
|
78
|
+
public removeOnAttachStateChangeListener(listener:View.OnAttachStateChangeListener): void;
|
|
79
|
+
|
|
80
|
+
public addOnLayoutChangeListener(listener: View.OnLayoutChangeListener): void;
|
|
81
|
+
|
|
82
|
+
public removeOnLayoutChangeListener(listener: View.OnLayoutChangeListener): void;
|
|
83
|
+
|
|
84
|
+
public scrollTo(x: number, y: number): void;
|
|
85
|
+
|
|
86
|
+
public scrollBy(x: number, y: number): void;
|
|
87
|
+
|
|
88
|
+
public performClick(): void;
|
|
89
|
+
|
|
90
|
+
public startAnimation(animation:Animation) : void;
|
|
91
|
+
|
|
92
|
+
public onDraw(canvas: Canvas): void;
|
|
93
|
+
|
|
94
|
+
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
|
|
95
|
+
|
|
96
|
+
public onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void;
|
|
97
|
+
|
|
98
|
+
public onConfigurationChanged(newConfig: Configuration): void;
|
|
99
|
+
|
|
100
|
+
public getAlpha(): number;
|
|
101
|
+
|
|
102
|
+
public getWidth(): number;
|
|
103
|
+
|
|
104
|
+
public getHeight(): number;
|
|
105
|
+
|
|
106
|
+
public getMatrix(): Matrix;
|
|
107
|
+
|
|
108
|
+
public getParent(): ViewParent;
|
|
109
|
+
|
|
110
|
+
public getId(): number;
|
|
111
|
+
|
|
112
|
+
public getPivotX(): number;
|
|
113
|
+
|
|
114
|
+
public getPivotY(): number;
|
|
115
|
+
|
|
116
|
+
public getX(): number;
|
|
117
|
+
|
|
118
|
+
public getY(): number;
|
|
119
|
+
|
|
120
|
+
public getDensityMetrics(): DensityMetrics;
|
|
121
|
+
|
|
122
|
+
public getScrollX(): number;
|
|
123
|
+
|
|
124
|
+
public getScrollY(): number;
|
|
125
|
+
|
|
126
|
+
public getParent(): ViewParent;
|
|
127
|
+
|
|
128
|
+
public getVisibility(): number;
|
|
129
|
+
|
|
130
|
+
public getLayoutParams(): ViewGroup.LayoutParams;
|
|
131
|
+
|
|
132
|
+
public getContext(): Context;
|
|
133
|
+
|
|
134
|
+
public getBackground(): Drawable;
|
|
135
|
+
|
|
136
|
+
public getRotation(): number;
|
|
137
|
+
|
|
138
|
+
public getTranslationX(): number;
|
|
139
|
+
|
|
140
|
+
public getTranslationY(): number;
|
|
141
|
+
|
|
142
|
+
public getScaleX(): number;
|
|
143
|
+
|
|
144
|
+
public getScaleY(): number;
|
|
145
|
+
|
|
146
|
+
public getOverlay(): ViewOverlay;
|
|
147
|
+
|
|
148
|
+
public getViewTreeObserver(): ViewTreeObserver;
|
|
149
|
+
|
|
150
|
+
public getOutlineProvider(): ViewOutlineProvider;
|
|
151
|
+
|
|
152
|
+
public getLocationOnScreen(location: number[]): void;
|
|
153
|
+
|
|
154
|
+
public getPaddingTop(): number;
|
|
155
|
+
|
|
156
|
+
public getPaddingBottom(): number;
|
|
157
|
+
|
|
158
|
+
public getPaddingLeft(): number;
|
|
159
|
+
|
|
160
|
+
public getPaddingRight(): number;
|
|
161
|
+
|
|
162
|
+
public getResources(): Resources;
|
|
163
|
+
|
|
164
|
+
public getRawPaddingLeft(): number;
|
|
165
|
+
|
|
166
|
+
public getRawPaddingTop(): number;
|
|
167
|
+
|
|
168
|
+
public getRawPaddingRight(): number;
|
|
169
|
+
|
|
170
|
+
public getRawPaddingBottom(): number;
|
|
171
|
+
|
|
172
|
+
public setHovered(hovered: boolean): void;
|
|
173
|
+
|
|
174
|
+
public setPivotX(x: number): void;
|
|
175
|
+
|
|
176
|
+
public setPivotY(y: number): void;
|
|
177
|
+
|
|
178
|
+
public setScaleX(x: number): number;
|
|
179
|
+
|
|
180
|
+
public setScaleY(y: number): number;
|
|
181
|
+
|
|
182
|
+
public setDrawingCacheEnabled(enabled: boolean): void;
|
|
183
|
+
|
|
184
|
+
public setBackgroundColor(color: number): void;
|
|
185
|
+
|
|
186
|
+
public setBackgroundDrawable(drawable: Drawable): void;
|
|
187
|
+
|
|
188
|
+
public setWillNotDraw(willNotDraw: boolean) :void;
|
|
189
|
+
|
|
190
|
+
public setMeasuredDimension(measuredWidth: number, measuredHeight: number): void;
|
|
191
|
+
|
|
192
|
+
public setAlpha(alpha: number): void;
|
|
193
|
+
|
|
194
|
+
public setVisibility(visibility: number): void;
|
|
195
|
+
|
|
196
|
+
public setOutlineProvider(provider: ViewOutlineProvider): void;
|
|
197
|
+
|
|
198
|
+
public setFocusable(focusable: boolean): void;
|
|
199
|
+
|
|
200
|
+
public setFocusableInTouchMode(focusableInTouchMode: boolean): void;
|
|
201
|
+
|
|
202
|
+
public setOnClickListener(l: View.OnClickListener): void;
|
|
203
|
+
|
|
204
|
+
public setOnFinishInflateListener(l: View.OnFinishInflateListener): void;
|
|
205
|
+
|
|
206
|
+
public setOnKeyListener(l: View.OnKeyListener): void;
|
|
207
|
+
|
|
208
|
+
public setOnTouchListener(l: View.OnTouchListener): void;
|
|
209
|
+
|
|
210
|
+
public setClickable(clickable: boolean): void;
|
|
211
|
+
|
|
212
|
+
public setOnGenericMotionListener(l: View.OnGenericMotionListener): void;
|
|
213
|
+
|
|
214
|
+
public setPadding(left: number, top: number, right: number, bottom: number): void;
|
|
215
|
+
|
|
216
|
+
public setLayoutParams(params: ViewGroup.LayoutParams): void;
|
|
217
|
+
|
|
218
|
+
public setRotation(rotation: number): void;
|
|
219
|
+
|
|
220
|
+
public setClipToOutline(clipToOutline: boolean): void;
|
|
221
|
+
|
|
222
|
+
public setTranslationX(translationX: number): void;
|
|
223
|
+
|
|
224
|
+
public setTranslationY(translationY: number): void;
|
|
225
|
+
|
|
226
|
+
public setOnHoverListener(l: View.OnHoverListener): void;
|
|
227
|
+
|
|
228
|
+
public setHoverCursor(cursor: string): void;
|
|
229
|
+
|
|
230
|
+
public setHoverDrawable(drawable: Drawable): void;
|
|
231
|
+
|
|
232
|
+
public setOnFocusChangeListener(l: View.OnFocusChangeListener): void;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export declare namespace View {
|
|
236
|
+
export class ViewRadiusOutlineProvider extends ViewOutlineProvider {
|
|
237
|
+
public constructor(view: View, ltr: number, lbr: number, rtr: number, rbr: number);
|
|
238
|
+
|
|
239
|
+
public onConfigurationChanged(newConfig: Configuration): void;
|
|
240
|
+
|
|
241
|
+
public getOutline(view: View, outline: Outline): void;
|
|
242
|
+
|
|
243
|
+
public setRadius(value: number): void;
|
|
244
|
+
|
|
245
|
+
public setLeftBottomRadius(value: number): void;
|
|
246
|
+
|
|
247
|
+
public setLeftTopRadius(value: number): void;
|
|
248
|
+
|
|
249
|
+
public setRightBottomRadius(value: number): void;
|
|
250
|
+
|
|
251
|
+
public setRightTopRadius(value: number): void;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export class AttachInfo {
|
|
255
|
+
public getTransparentLocation(): Array<number>;
|
|
256
|
+
|
|
257
|
+
public getInvalidateChildLocation(): Array<number>;
|
|
258
|
+
|
|
259
|
+
public getTmpMatrix(): Matrix;
|
|
260
|
+
|
|
261
|
+
public getTmpOutline(): Outline;
|
|
262
|
+
|
|
263
|
+
public getTmpTransformLocation(): Array<number>;
|
|
264
|
+
|
|
265
|
+
public getTmpTransformRect(): Rect;
|
|
266
|
+
|
|
267
|
+
public getTransformation(): Transformation;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export class ViewQuery {
|
|
271
|
+
public findViewById<T extends View>(id: string): Nullable<T>;
|
|
272
|
+
|
|
273
|
+
public findViewByTag<T extends View>(tag: string): Nullable<T>;
|
|
274
|
+
|
|
275
|
+
public findViewsWithTag<T extends View>(tag: string): List<T>;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export class MeasureSpec {
|
|
279
|
+
public static MODE_SHIFT: number;
|
|
280
|
+
public static MODE_MASK: number;
|
|
281
|
+
public static UNSPECIFIED: number;
|
|
282
|
+
public static EXACTLY: number;
|
|
283
|
+
public static AT_MOST: number;
|
|
284
|
+
|
|
285
|
+
public static makeMeasureSpec(size: number, mode: number): number;
|
|
286
|
+
|
|
287
|
+
public static makeSafeMeasureSpec(size: number, mode: number): number;
|
|
288
|
+
|
|
289
|
+
public static getMode(measureSpec: number): number;
|
|
290
|
+
|
|
291
|
+
public static getSize(measureSpec: number): number;
|
|
292
|
+
|
|
293
|
+
public static adjust(measureSpec: number, delta: number): number;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export const OnAttachStateChangeListenerInterface: Interface<OnAttachStateChangeListener>;
|
|
297
|
+
export interface OnAttachStateChangeListener {
|
|
298
|
+
onViewAttachedToWindow(v: View): void;
|
|
299
|
+
|
|
300
|
+
onViewDetachedFromWindow(v: View): void;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export const OnTouchListenerInterface:Interface<OnTouchListener>;
|
|
304
|
+
export interface OnTouchListener {
|
|
305
|
+
onTouch(v: View, event: MotionEvent): boolean;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export const OnClickListenerInterface:Interface<OnClickListener>;
|
|
309
|
+
export interface OnClickListener {
|
|
310
|
+
onClick(v: View): void;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export const OnHoverListenerInterface: Interface<OnHoverListener>;
|
|
314
|
+
export interface OnHoverListener {
|
|
315
|
+
onHover(v: View, event: MotionEvent): boolean;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export const OnKeyListenerInterface:Interface<OnKeyListener>;
|
|
319
|
+
export interface OnKeyListener {
|
|
320
|
+
onKey(v: View, keyCode: number, event: KeyEvent): boolean;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export const OnFocusChangeListenerInterface:Interface<OnFocusChangeListener>;
|
|
324
|
+
export interface OnFocusChangeListener {
|
|
325
|
+
onFocusChange(v: View, hasFocus: boolean): void;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export const OnGenericMotionListenerInterface:Interface<OnGenericMotionListener>;
|
|
329
|
+
export interface OnGenericMotionListener {
|
|
330
|
+
onGenericMotion(v: View, event: MotionEvent): boolean;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export const OnLayoutChangeListenerInterface: Interface<OnLayoutChangeListener>;
|
|
334
|
+
export interface OnLayoutChangeListener {
|
|
335
|
+
onLayoutChange(v: View, left: number, top: number, right: number, bottom: number, oldLeft: number, oldTop: number, oldRight: number, oldBottom: number):void;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export const OnFinishInflateListenerInterface: Interface<OnFinishInflateListener>;
|
|
339
|
+
export interface OnFinishInflateListener {
|
|
340
|
+
onViewFinishInflate(v: View): void;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { View } from "./View";
|
|
2
|
+
import { AttributeSet } from "./AttributeSet";
|
|
3
|
+
import { Context } from "./Context";
|
|
4
|
+
import { Configuration } from "./Configuration";
|
|
5
|
+
import { ViewParent } from "./ViewParent";
|
|
6
|
+
import { MotionEvent } from "./MotionEvent";
|
|
7
|
+
import { DensityMetrics } from "./DensityMetrics";
|
|
8
|
+
|
|
9
|
+
export declare abstract class ViewGroup extends View implements ViewParent {
|
|
10
|
+
public static FLAG_USE_CHILD_DRAWING_ORDER: number;
|
|
11
|
+
public static FLAG_CLIP_CHILDREN: number;
|
|
12
|
+
public static FLAG_CLIP_TO_PADDING: number;
|
|
13
|
+
|
|
14
|
+
public static getChildMeasureSpec(spec: number, padding: number, childDimension: number): number;
|
|
15
|
+
|
|
16
|
+
public isChildrenDrawingOrderEnabled(): boolean;
|
|
17
|
+
|
|
18
|
+
public onViewAdded(child:View): void;
|
|
19
|
+
|
|
20
|
+
public onViewRemoved(child:View):void;
|
|
21
|
+
|
|
22
|
+
public addView(child: View): View;
|
|
23
|
+
public addView(child: View, index: number): View;
|
|
24
|
+
public addView(child: View, params: ViewGroup.LayoutParams): View;
|
|
25
|
+
public addView(child: View, index: number, params: ViewGroup.LayoutParams): View;
|
|
26
|
+
|
|
27
|
+
public removeView(view: View): void;
|
|
28
|
+
|
|
29
|
+
public removeViewAt(index: number): void;
|
|
30
|
+
|
|
31
|
+
public removeAllViews(): void;
|
|
32
|
+
|
|
33
|
+
public indexOfChild(child: View): number;
|
|
34
|
+
|
|
35
|
+
public generateLayoutParams(attribute: AttributeSet): ViewGroup.LayoutParams;
|
|
36
|
+
public generateLayoutParams(params: ViewGroup.LayoutParams): ViewGroup.LayoutParams;
|
|
37
|
+
|
|
38
|
+
public dispatchTouchEvent(ev: MotionEvent): boolean;
|
|
39
|
+
|
|
40
|
+
public getChildCount(): number;
|
|
41
|
+
|
|
42
|
+
public getChildAt(index: number): View;
|
|
43
|
+
|
|
44
|
+
public getClipChildren() :boolean;
|
|
45
|
+
|
|
46
|
+
public getClipToPadding():boolean;
|
|
47
|
+
|
|
48
|
+
public getChildDrawingOrder(childCount: number, i: number): number;
|
|
49
|
+
|
|
50
|
+
public setClipChildren(clipChildren: boolean): void;
|
|
51
|
+
|
|
52
|
+
public setClipToPadding(clipToPadding: boolean): void;
|
|
53
|
+
|
|
54
|
+
public setChildrenDrawingOrderEnabled(enabled: boolean): void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export declare namespace ViewGroup {
|
|
58
|
+
class LayoutParams {
|
|
59
|
+
public static MATCH_PARENT: number;
|
|
60
|
+
public static WRAP_CONTENT: number;
|
|
61
|
+
|
|
62
|
+
public constructor(context: Context);
|
|
63
|
+
|
|
64
|
+
public onConfigurationChanged(newConfig: Configuration): void;
|
|
65
|
+
|
|
66
|
+
public getDensityMetrics(): DensityMetrics;
|
|
67
|
+
|
|
68
|
+
public getWidth(): number;
|
|
69
|
+
|
|
70
|
+
public getHeight(): number;
|
|
71
|
+
|
|
72
|
+
public getRawWidth(): number;
|
|
73
|
+
|
|
74
|
+
public getRawHeight(): number;
|
|
75
|
+
|
|
76
|
+
public setWidth(width: number): void;
|
|
77
|
+
|
|
78
|
+
public setHeight(height: number): void;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
class MarginLayoutParams extends LayoutParams {
|
|
82
|
+
public setLeftMargin(margin: number): void;
|
|
83
|
+
|
|
84
|
+
public setTopMargin(margin: number): void;
|
|
85
|
+
|
|
86
|
+
public setRightMargin(margin: number): void;
|
|
87
|
+
|
|
88
|
+
public setBottomMargin(margin: number): void;
|
|
89
|
+
|
|
90
|
+
public setMargins(left: number, top: number, right: number, bottom: number): void;
|
|
91
|
+
|
|
92
|
+
public getLeftMargin(): number;
|
|
93
|
+
|
|
94
|
+
public getTopMargin(): number;
|
|
95
|
+
|
|
96
|
+
public getRightMargin(): number;
|
|
97
|
+
|
|
98
|
+
public getBottomMargin(): number;
|
|
99
|
+
|
|
100
|
+
public getRawLeftMargin(): number;
|
|
101
|
+
|
|
102
|
+
public getRawTopMargin(): number;
|
|
103
|
+
|
|
104
|
+
public getRawRightMargin(): number;
|
|
105
|
+
|
|
106
|
+
public getRawBottomMargin(): number;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ViewOverlay } from "./ViewOverlay";
|
|
2
|
+
import { Drawable } from "./Drawable";
|
|
3
|
+
import { View } from "./View";
|
|
4
|
+
|
|
5
|
+
export declare class ViewGroupOverlay extends ViewOverlay {
|
|
6
|
+
public add(drawable: Drawable): void;
|
|
7
|
+
public add(view: View): void;
|
|
8
|
+
|
|
9
|
+
public remove(drawable: Drawable): void;
|
|
10
|
+
public remove(view: View): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Drawable } from "./Drawable";
|
|
2
|
+
import { ViewGroup } from "./ViewGroup";
|
|
3
|
+
|
|
4
|
+
export declare class ViewOverlay {
|
|
5
|
+
public add(drawable: Drawable): void;
|
|
6
|
+
|
|
7
|
+
public remove(drawable: Drawable): void;
|
|
8
|
+
|
|
9
|
+
public isEmpty(): boolean;
|
|
10
|
+
|
|
11
|
+
public clear(): void;
|
|
12
|
+
|
|
13
|
+
public getOverlayView(): ViewGroup;
|
|
14
|
+
|
|
15
|
+
public setAutoSizeDrawableInOverlay(autoSize: boolean): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Interface } from "@compass-framework/library";
|
|
2
|
+
import { View } from "./View";
|
|
3
|
+
|
|
4
|
+
export declare class ViewTreeObserver {
|
|
5
|
+
public addOnGlobalLayoutListener(listener: ViewTreeObserver.OnGlobalLayoutListener) :void;
|
|
6
|
+
|
|
7
|
+
public removeGlobalOnLayoutListener(victim: ViewTreeObserver.OnGlobalLayoutListener):void;
|
|
8
|
+
|
|
9
|
+
public addOnPreDrawListener(listener: ViewTreeObserver.OnPreDrawListener):void;
|
|
10
|
+
|
|
11
|
+
public removeOnPreDrawListener(victim: ViewTreeObserver.OnPreDrawListener) :void;
|
|
12
|
+
|
|
13
|
+
public addOnGlobalFocusChangeListener(listener: ViewTreeObserver.OnGlobalFocusChangeListener): void;
|
|
14
|
+
|
|
15
|
+
public removeOnGlobalFocusChangeListener(victim: ViewTreeObserver.OnGlobalFocusChangeListener): void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare namespace ViewTreeObserver {
|
|
19
|
+
export const OnGlobalLayoutListenerInterface:Interface<OnGlobalLayoutListener>;
|
|
20
|
+
export interface OnGlobalLayoutListener {
|
|
21
|
+
onGlobalLayout(): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const OnGlobalFocusChangeListenerInterface:Interface<OnGlobalFocusChangeListener>;
|
|
25
|
+
export interface OnGlobalFocusChangeListener {
|
|
26
|
+
onGlobalFocusChanged(oldFocus: View, newFocus: View): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const OnPreDrawListenerInterface:Interface<OnPreDrawListener>;
|
|
30
|
+
export interface OnPreDrawListener {
|
|
31
|
+
onPreDraw(): boolean;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Context } from "./Context";
|
|
2
|
+
import { ICursor } from "./ICursor";
|
|
3
|
+
import { ApplicationFrameContext } from "./ApplicationFrameContext";
|
|
4
|
+
|
|
5
|
+
export declare class WindowContext extends Context {
|
|
6
|
+
public getApplicationFrameContext(): ApplicationFrameContext;
|
|
7
|
+
|
|
8
|
+
public getWindowCursor(): ICursor;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ViewGroup } from "./ViewGroup";
|
|
2
|
+
|
|
3
|
+
export declare class WindowManager {
|
|
4
|
+
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare namespace WindowManager {
|
|
8
|
+
export class LayoutParams extends ViewGroup.LayoutParams {
|
|
9
|
+
public setAlpha(alpha: number): void;
|
|
10
|
+
|
|
11
|
+
public setGravity(gravity: number): void;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Context } from "./Context";
|
|
2
|
+
import { View } from "./View";
|
|
3
|
+
import { ViewGroup } from "./ViewGroup";
|
|
4
|
+
|
|
5
|
+
export declare class XMLLayoutParser {
|
|
6
|
+
public static from(context: Context): XMLLayoutParser;
|
|
7
|
+
|
|
8
|
+
public parseLayoutXML<T = View>(root: ViewGroup, xml: string, attach?: boolean): T;
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BiFunction, Class } from "@compass-framework/library";
|
|
2
|
+
import { View } from "./View";
|
|
3
|
+
import { Context } from "./Context";
|
|
4
|
+
import { AttributeSet } from "./AttributeSet";
|
|
5
|
+
|
|
6
|
+
export declare class XMLViewFactoryRegistry {
|
|
7
|
+
public hasViewFactory(name: string): boolean;
|
|
8
|
+
|
|
9
|
+
public registryViewFactory<T extends View>(name: string, factory: XMLViewFactoryRegistry.Factory<T>, overwrite?: boolean): XMLViewFactoryRegistry;
|
|
10
|
+
|
|
11
|
+
public removeViewFactory(name: string): XMLViewFactoryRegistry;
|
|
12
|
+
|
|
13
|
+
public registryViewClass<T extends View>(name: string, clazz: Class<T>, overwrite?: boolean): XMLViewFactoryRegistry;
|
|
14
|
+
|
|
15
|
+
public setDefaultAttribute(name: string, value: string): XMLViewFactoryRegistry;
|
|
16
|
+
|
|
17
|
+
public removeDefaultAttribute(name: string): XMLViewFactoryRegistry;
|
|
18
|
+
|
|
19
|
+
public getViewFactory<T extends View>(name: string): XMLViewFactoryRegistry.Factory<T>;
|
|
20
|
+
|
|
21
|
+
public getDefaultAttribute(attr?: XMLViewFactoryRegistry.Attribute): XMLViewFactoryRegistry.Attribute;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare namespace XMLViewFactoryRegistry {
|
|
25
|
+
export type Attribute = { [key: string]: string };
|
|
26
|
+
|
|
27
|
+
export interface Factory<T extends View> {
|
|
28
|
+
getView(context: Context, attrs: AttributeSet): T;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class ViewFactory<T extends View> implements Factory<T> {
|
|
32
|
+
public constructor(clazz:Class<View>);
|
|
33
|
+
|
|
34
|
+
public getView(context: Context, attrs: AttributeSet): T;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class CustomFactory<T extends View> implements Factory<T> {
|
|
38
|
+
public constructor(callback: BiFunction<Context, AttributeSet, View>);
|
|
39
|
+
|
|
40
|
+
public getView(context: Context, attrs: AttributeSet): T;
|
|
41
|
+
}
|
|
42
|
+
}
|