Skip to content

Commit fc93d09

Browse files
committed
chore: merge main
2 parents ce032d0 + 3fcd215 commit fc93d09

File tree

14 files changed

+2581
-994
lines changed

14 files changed

+2581
-994
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# [20.1.0](https://github.com/NativeScript/angular/compare/20.0.0...20.1.0) (2025-12-02)
2+
3+
4+
### Features
5+
6+
* **ListView:** sticky headers, search bar and sectioned data support with v9 ([5ad8a89](https://github.com/NativeScript/angular/commit/5ad8a897a05014d0c737f7f8580f156574938df0))
7+
* **Note**: Requires NativeScript Core v9+
8+
9+
10+
111
# [20.0.0](https://github.com/NativeScript/angular/compare/19.0.1...20.0.0) (2025-06-01)
212

313

apps/nativescript-demo-ng/App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
android:icon="@drawable/icon"
2121
android:usesCleartextTraffic="${isUnitTesting}"
2222
android:label="@string/app_name"
23-
android:theme="@style/AppTheme">
23+
android:theme="@style/AppTheme"
24+
android:networkSecurityConfig="@xml/network_security_config">
2425

2526
<activity
2627
android:name="com.tns.NativeScriptActivity"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<base-config cleartextTrafficPermitted="true">
4+
<trust-anchors>
5+
<certificates src="system" />
6+
<certificates src="user" />
7+
</trust-anchors>
8+
</base-config>
9+
<domain-config cleartextTrafficPermitted="true">
10+
<domain includeSubdomains="true">localhost</domain>
11+
<domain includeSubdomains="true">127.0.0.1</domain>
12+
<domain includeSubdomains="true">10.0.2.2</domain>
13+
</domain-config>
14+
</network-security-config>
15+
16+

apps/nativescript-demo-ng/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"@nativescript/android": "~9.0.0",
1010
"@nativescript/ios": "~9.0.0",
1111
"@nativescript/tailwind": "^2.1.0",
12-
"@nativescript/unit-test-runner": "4.0.0"
12+
"@nativescript/unit-test-runner": "^4.0.0",
13+
"@nativescript/visionos": "~9.0.0"
1314
}
1415
}

apps/nativescript-demo-ng/project.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@
3838
"uglify": false,
3939
"release": false,
4040
"forDevice": false,
41-
"prepare": false
41+
"prepare": false,
42+
"flags": "--env.commonjs"
4243
},
43-
"dependsOn": ["^build"]
44+
"dependsOn": [
45+
"^build"
46+
]
4447
},
4548
"clean": {
4649
"executor": "@nativescript/nx:clean",
@@ -51,11 +54,17 @@
5154
},
5255
"test": {
5356
"executor": "@nativescript/nx:test",
54-
"outputs": ["{workspaceRoot}/coverage/apps/nativescript-demo-ng"],
57+
"outputs": [
58+
"{workspaceRoot}/coverage/apps/nativescript-demo-ng"
59+
],
5560
"options": {
56-
"coverage": false
61+
"coverage": false,
62+
"flags": "--env.commonjs"
5763
},
64+
"dependsOn": [
65+
"^build"
66+
],
5867
"configurations": {}
5968
}
6069
}
61-
}
70+
}

apps/nativescript-demo-ng/src/app/app.routes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Routes } from '@angular/router';
22
import { ItemDetailComponent } from './item/item-detail.component';
33
import { ItemsComponent } from './item/items.component';
4+
import { ListViewStickyComponent } from './list-view-sticky/list-view-sticky.component';
45
// import { HomeComponent } from './home/home.component';
56
// import { BootGuardService } from './boot-guard.service';
67

@@ -10,6 +11,10 @@ export const routes: Routes = [
1011
{ path: 'item/:id', component: ItemDetailComponent },
1112
{ path: 'item2', loadChildren: () => import('./item2/item2.routes').then((m) => m.ITEM2_ROUTES) },
1213
{ path: 'rootlazy', loadChildren: () => import('./item3/item3.module').then((m) => m.Item3Module) },
14+
{
15+
path: 'list-view-sticky',
16+
component: ListViewStickyComponent,
17+
},
1318

1419
/**
1520
* Test tab named outlets
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<ActionBar title="ListView Sticky Headers"></ActionBar>
2+
3+
<GridLayout rows="1,*" columns="*">
4+
<GridLayout row="1" columns="*">
5+
<!-- Using inside this grid setup helps Android position search bar if used. It also helps iOS with ActionBar safe area overflow cases with sticky header. -->
6+
<ListView
7+
[items]="countries()"
8+
[sectioned]="true"
9+
[stickyHeader]="true"
10+
[stickyHeaderHeight]="45"
11+
[stickyHeaderTopPadding]="false"
12+
[showSearch]="true"
13+
[searchAutoHide]="true"
14+
[stickyHeaderTemplate]="headerTemplateString"
15+
[itemTemplateSelector]="templateSelector"
16+
(searchChange)="onSearchChange($event)"
17+
>
18+
<ng-template let-item="item" nsTemplateKey="main">
19+
<GridLayout
20+
columns="auto,auto,*"
21+
class="p-3 my-1 mx-2 rounded-xl bg-white"
22+
boxShadow="0px 1px 2px rgba(0,0,0,0.2)"
23+
>
24+
<Label color="black" [text]="item?.flag" class="ml-1"></Label>
25+
<Label col="1" [text]="item?.name" class="ml-2 text-black"></Label>
26+
<Label col="2" [text]="item?.code" class="ml-1 text-[#999]"></Label>
27+
</GridLayout>
28+
</ng-template>
29+
</ListView>
30+
</GridLayout>
31+
</GridLayout>

0 commit comments

Comments
 (0)