@compass-framework/core 1.1.8 → 1.1.9

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.
@@ -4,9 +4,8 @@ import { Canvas } from "./Canvas";
4
4
  import { Context } from "./Context";
5
5
 
6
6
  export declare abstract class BitmapDrawable extends Drawable {
7
- protected constructor(context: Context);
8
- protected constructor(context: Context, bitmap: Bitmap);
9
- protected constructor(context: Context, bitmapState: BitmapDrawable.BitmapState);
7
+ protected constructor(bitmap: Bitmap);
8
+ protected constructor(bitmapState: BitmapDrawable.BitmapState);
10
9
 
11
10
  public draw(canvas: Canvas): void;
12
11
 
@@ -26,7 +25,7 @@ export declare namespace BitmapDrawable {
26
25
  public constructor(bitmapState: BitmapState);
27
26
  public constructor(bitmap: Bitmap);
28
27
 
29
- public newDrawable(context: Context): Drawable;
28
+ public newDrawable(): Drawable;
30
29
 
31
30
  public getChangingConfigurations(): number;
32
31
  }
@@ -1,10 +1,8 @@
1
1
  import { Drawable } from "./Drawable";
2
2
  import { Canvas } from "./Canvas";
3
- import { Context } from "./Context";
4
3
 
5
4
  export declare class ColorDrawable extends Drawable {
6
- public constructor(context: Context);
7
- public constructor(context: Context, color: number);
5
+ public constructor(color: number);
8
6
 
9
7
  public draw(canvas: Canvas): void;
10
8
 
@@ -1,15 +1,13 @@
1
1
  import { InterfaceTemplate, Runnable } from "@compass-framework/library";
2
+ import { Rect } from "./Rect";
2
3
  import { Canvas } from "./Canvas";
4
+ import { Configuration } from "./Configuration";
3
5
  import { Outline } from "./Outline";
4
- import { Rect } from "./Rect";
5
6
  import { Resources } from "./Resources";
6
- import { Context } from "./Context";
7
- import { Configuration } from "./Configuration";
8
7
  import { DensityMetrics } from "./DensityMetrics";
9
8
 
10
9
  export declare abstract class Drawable {
11
- protected constructor(context: Context);
12
- protected constructor(context: Context, drawable: Drawable);
10
+ protected constructor(drawable: Drawable);
13
11
 
14
12
  public abstract draw(canvas: Canvas): void;
15
13
 
@@ -21,6 +19,8 @@ export declare abstract class Drawable {
21
19
 
22
20
  public onConfigurationChanged(newConfig: Configuration): void;
23
21
 
22
+ public onDensityMetricsChanged(newConfig: Configuration): void;
23
+
24
24
  public copyBounds() : Rect;
25
25
  public copyBounds(bounds: Rect): void;
26
26
 
@@ -30,8 +30,6 @@ export declare abstract class Drawable {
30
30
 
31
31
  public getBounds(): Rect;
32
32
 
33
- public getDensityMetrics(): DensityMetrics;
34
-
35
33
  public getOutline(outline:Outline):void;
36
34
 
37
35
  public getCallback() :Drawable.Callback;
@@ -40,6 +38,8 @@ export declare abstract class Drawable {
40
38
 
41
39
  public getIntrinsicHeight():number;
42
40
 
41
+ public getDensityMetrics(): DensityMetrics;
42
+
43
43
  public setBounds(bounds: Rect): void;
44
44
  public setBounds(left: number, top: number, right: number, bottom: number): void;
45
45
 
@@ -48,9 +48,9 @@ export declare abstract class Drawable {
48
48
 
49
49
  export declare namespace Drawable {
50
50
  export abstract class ConstantState {
51
- public abstract newDrawable(context: Context): Drawable;
51
+ public abstract newDrawable(): Drawable;
52
52
 
53
- public newResourcesDrawable(context: Context, res: Resources): Drawable;
53
+ public newResourcesDrawable(res: Resources): Drawable;
54
54
 
55
55
  public abstract getChangingConfigurations(): number;
56
56
  }
@@ -1,13 +1,11 @@
1
1
  import {Implements, Runnable} from "@compass-framework/library";
2
2
  import { Canvas } from "./Canvas";
3
3
  import { Drawable } from "./Drawable";
4
- import { Context } from "./Context";
5
4
  import { Resources } from "./Resources";
6
5
 
7
6
  @Implements(Drawable.Callback)
8
7
  export declare class LayerDrawable extends Drawable implements Drawable.Callback {
9
- public constructor(context: Context);
10
- public constructor(context: Context, layers: Drawable[]);
8
+ public constructor(layers: Drawable[]);
11
9
 
12
10
  public addLayer(layer: Drawable): void;
13
11
 
@@ -1,9 +1,8 @@
1
1
  import { BitmapDrawable } from "./BitmapDrawable";
2
2
  import { Picture } from "./Picture";
3
- import { Context } from "./Context";
4
3
 
5
4
  export declare class PictureDrawable extends BitmapDrawable {
6
- public constructor(context: Context, url: string);
5
+ public constructor(url: string);
7
6
 
8
7
  public invalidate() : void;
9
8
 
@@ -1,47 +1,55 @@
1
1
  import { Canvas } from "./Canvas";
2
2
  import { Paint } from "./Paint";
3
3
  import { Drawable } from "./Drawable";
4
- import { Context } from "./Context";
4
+ import { Resources } from "./Resources";
5
5
 
6
6
  export declare class RoundedCornersDrawable extends Drawable {
7
- public constructor(context: Context);
8
- public constructor(context: Context, drawable: RoundedCornersDrawable);
9
- public constructor(context: Context, fillColor: number, radius: number);
10
- public constructor(context: Context, strokeColor: number, radius: number, strokeWidth: number);
11
- public constructor(context: Context, fillColor: number, strokeColor: number, radius: number, strokeWidth: number);
12
- public constructor(context: Context, fillColor: number, lt: number, rt: number, rb: number, lb: number);
13
- public constructor(context: Context, strokeColor: number, lt: number, rt: number, rb: number, lb: number, strokeWidth: number);
14
- public constructor(context: Context, fillColor: number, strokeColor: number, lt: number, rt: number, rb: number, lb: number, strokeWidth: number);
7
+ public constructor(configuration: RoundedCornersDrawable.Configuration, resources?: Resources)
15
8
 
16
9
  public draw(canvas: Canvas): void;
17
10
 
18
- public getOpacity(): number;
11
+ public getLeftTopRadius(): number
19
12
 
20
- public setAlpha(alpha: number): void;
13
+ public getLeftBottomRadius(): number
21
14
 
22
- public getLtRadius(): number;
15
+ public getRightTopRadius(): number
23
16
 
24
- public getLbRadius(): number;
17
+ public getRightBottomRadius(): number
25
18
 
26
- public getRtRadius(): number;
19
+ public getStyle(): Paint.Style
27
20
 
28
- public getRbRadius(): number;
21
+ public getOpacity(): number
29
22
 
30
- public setLtRadius(radius: number): void;
23
+ public setStyle(style: Paint.Style): void
31
24
 
32
- public setLbRadius(radius: number): void;
25
+ public setStrokeWidth(strokeWidth: number): void
33
26
 
34
- public setRtRadius(radius: number): void;
27
+ public setFillColor(color: number): void
35
28
 
36
- public setRbRadius(radius: number): void;
29
+ public setRadius(radius: number): void
37
30
 
38
- public setRadius(radius: number): void;
31
+ public setStrokeColor(color: number): void
39
32
 
40
- public setFillColor(color: number): void;
33
+ public setAlpha(alpha: number): void
41
34
 
42
- public setStrokeColor(color: number): void;
35
+ public setLeftBottomRadius(radius: number): void
43
36
 
44
- public setStyle(style: Paint.Style): void;
37
+ public setLeftTopRadius(radius: number): void
45
38
 
46
- public setStrokeWidth(strokeWidth: number): void;
39
+ public setRightTopRadius(radius: number): void
40
+
41
+ public setRightBottomRadius(radius: number): void
42
+ }
43
+
44
+ export namespace RoundedCornersDrawable {
45
+ export type Configuration = {
46
+ leftTopRadius?: number,
47
+ leftBottomRadius?: number,
48
+ rightTopRadius?: number,
49
+ rightBottomRadius?: number,
50
+ radius?: number,
51
+ strokeColor?: number,
52
+ fillColor?: number,
53
+ strokeWidth?: number
54
+ };
47
55
  }
package/@types/View.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
- ArrayList,
3
- Runnable,
4
2
  InterfaceTemplate,
3
+ Runnable,
4
+ ArrayList,
5
5
  } from "@compass-framework/library";
6
6
 
7
7
  import { ViewOverlay } from "./ViewOverlay";
@@ -93,14 +93,16 @@ export declare class View implements Drawable.Callback {
93
93
 
94
94
  public startAnimation(animation:Animation) : void;
95
95
 
96
- public onDraw(canvas: Canvas): void;
97
-
98
96
  public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
99
97
 
98
+ public onDraw(canvas: Canvas): void;
99
+
100
100
  public onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void;
101
101
 
102
102
  public onConfigurationChanged(newConfig: Configuration): void;
103
103
 
104
+ public onDensityMetricsChanged(newConfig: Configuration): void;
105
+
104
106
  public getAlpha(): number;
105
107
 
106
108
  public getWidth(): number;
@@ -1,7 +1,6 @@
1
1
  import { Implements } from "@compass-framework/library";
2
2
  import { View } from "./View";
3
3
  import { AttributeSet } from "./AttributeSet";
4
- import { Context } from "./Context";
5
4
  import { Configuration } from "./Configuration";
6
5
  import { ViewParent } from "./ViewParent";
7
6
  import { MotionEvent } from "./MotionEvent";
@@ -61,10 +60,12 @@ export declare namespace ViewGroup {
61
60
  public static MATCH_PARENT: number;
62
61
  public static WRAP_CONTENT: number;
63
62
 
64
- public constructor(context: Context);
63
+ public constructor(width: number, height: number);
65
64
 
66
65
  public onConfigurationChanged(newConfig: Configuration): void;
67
66
 
67
+ public onDensityMetricsChanged(newConfig: Configuration): void;
68
+
68
69
  public getDensityMetrics(): DensityMetrics;
69
70
 
70
71
  public getWidth(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-framework/core",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "@compass-framework/core public api",
5
5
  "types": "./index.d.ts",
6
6
  "main": "./index.js",