@nativescript-community/ui-surface 1.1.0 → 1.2.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.2.0](https://github.com/nativescript-community/ui-native-components/compare/v1.1.0...v1.2.0) (2026-10-29)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **ui-surface:** read the Android theme colors without the R classes ([cdff719](https://github.com/nativescript-community/ui-native-components/commit/cdff71950f162dd930827d9fe45ca75cec34903b))
|
|
11
|
+
|
|
6
12
|
## [1.1.0](https://github.com/nativescript-community/ui-native-components/compare/v1.0.4...v1.1.0) (2026-10-24)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @nativescript-community/ui-surface
|
package/index.android.js
CHANGED
|
@@ -2,9 +2,11 @@ import { Color, GridLayout, Utils, backgroundColorProperty, backgroundInternalPr
|
|
|
2
2
|
import { interactiveProperty, tintProperty, variantProperty } from './index-common';
|
|
3
3
|
export * from './index-common';
|
|
4
4
|
const ELEVATION_DP = 6;
|
|
5
|
-
|
|
5
|
+
// the R classes are not in the metadata of the apps: the attribute is found by name
|
|
6
|
+
function themeColor(context, attrName, fallback) {
|
|
7
|
+
const attr = context.getResources().getIdentifier(attrName, 'attr', context.getPackageName());
|
|
6
8
|
const value = new android.util.TypedValue();
|
|
7
|
-
return context.getTheme().resolveAttribute(attr, value, true) ? value.data : fallback;
|
|
9
|
+
return attr && context.getTheme().resolveAttribute(attr, value, true) ? value.data : fallback;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Android: a Material 3 surface: the surface container color, a capsule shape and the elevation of the floating toolbars.
|
|
@@ -20,7 +22,6 @@ export class Surface extends GridLayout {
|
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
24
|
const context = view.getContext();
|
|
23
|
-
const R = com.google.android.material.R;
|
|
24
25
|
const dp = (value) => Utils.layout.toDevicePixels(value);
|
|
25
26
|
const clear = this.variant === 'clear';
|
|
26
27
|
const user = this.mUserBackground;
|
|
@@ -31,13 +32,13 @@ export class Surface extends GridLayout {
|
|
|
31
32
|
background.setColor(this.mUserColor.android);
|
|
32
33
|
}
|
|
33
34
|
else {
|
|
34
|
-
background.setColor(clear ? android.graphics.Color.TRANSPARENT : themeColor(context,
|
|
35
|
+
background.setColor(clear ? android.graphics.Color.TRANSPARENT : themeColor(context, 'colorSurfaceContainer', android.graphics.Color.WHITE));
|
|
35
36
|
}
|
|
36
37
|
if (user?.borderTopWidth) {
|
|
37
38
|
background.setStroke(dp(user.borderTopWidth), user.borderTopColor ? user.borderTopColor.android : android.graphics.Color.GRAY);
|
|
38
39
|
}
|
|
39
40
|
else if (clear) {
|
|
40
|
-
background.setStroke(dp(1), themeColor(context,
|
|
41
|
+
background.setStroke(dp(1), themeColor(context, 'colorOutlineVariant', android.graphics.Color.GRAY));
|
|
41
42
|
}
|
|
42
43
|
view.setBackground(background);
|
|
43
44
|
// the children follow the shape, the shadow follows the background
|
package/index.android.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../src/ui-surface/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC/H,OAAO,EAAkB,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpG,cAAc,gBAAgB,CAAC;AAE/B,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,SAAS,UAAU,CAAC,OAAgC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../src/ui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C,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,KAAqB;QAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IACD,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAc,IAAG,CAAC;IAClD,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,KAAY,IAAG,CAAC;IACzC,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,KAAY;QAC5C,IAAI,CAAC,UAAU,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1F,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IACD,wEAAwE;IACxE,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,KAAiB;QACpD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;CACJ;AACD,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClC,mBAAmB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACtC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript-community/ui-surface",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Floating surface for toolbars and action groups: Material 3 surface on Android, Liquid Glass (blur before iOS 26) on iOS.",
|
|
5
5
|
"main": "./index",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"readmeFilename": "README.md",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@nativescript-community/ui-core": "^1.
|
|
47
|
+
"@nativescript-community/ui-core": "^1.2.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c7a3711ca306a0ed2a8e9cf76d0382e26b6314b5"
|
|
50
50
|
}
|