Skip to content

Commit adf21e1

Browse files
authored
Merge pull request NativeScript#3334 from NativeScript/reexports
Fixed Android _onAttached logic. Fixes setting props in code-behind.
2 parents afe928c + 417064f commit adf21e1

5 files changed

Lines changed: 19 additions & 15 deletions

File tree

apps/.vscode/launch.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"diagnosticLogging": false,
1212
"emulator": false,
1313
"rebuild": false,
14-
"syncAllFiles": true
14+
"syncAllFiles": true,
15+
"stopOnEntry": true
1516
},
1617
{
1718
"name": "Launch on iOS",
@@ -22,7 +23,8 @@
2223
"sourceMaps": true,
2324
"diagnosticLogging": false,
2425
"emulator": false,
25-
"rebuild": true
26+
"rebuild": true,
27+
"stopOnEntry": true
2628
},
2729
{
2830
"name": "Attach on iOS",
@@ -32,7 +34,8 @@
3234
"appRoot": "${workspaceRoot}",
3335
"sourceMaps": true,
3436
"diagnosticLogging": false,
35-
"emulator": false
37+
"emulator": false,
38+
"stopOnEntry": true
3639
},
3740
{
3841
"name": "Sync on Android",
@@ -44,7 +47,8 @@
4447
"diagnosticLogging": false,
4548
"emulator": false,
4649
"rebuild": false,
47-
"syncAllFiles": true
50+
"syncAllFiles": true,
51+
"stopOnEntry": true
4852
},
4953
{
5054
"name": "Launch on Android",
@@ -55,7 +59,8 @@
5559
"sourceMaps": true,
5660
"diagnosticLogging": false,
5761
"emulator": false,
58-
"rebuild": true
62+
"rebuild": true,
63+
"stopOnEntry": true
5964
},
6065
{
6166
"name": "Attach on Android",
@@ -65,7 +70,8 @@
6570
"appRoot": "${workspaceRoot}",
6671
"sourceMaps": true,
6772
"diagnosticLogging": false,
68-
"emulator": false
73+
"emulator": false,
74+
"stopOnEntry": true
6975
}
7076
]
7177
}

apps/app/ui-tests-app/app.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ trace.enable();
44
trace.setCategories(trace.categories.concat(
55
trace.categories.NativeLifecycle,
66
trace.categories.Navigation,
7-
//trace.categories.Animation,
87
trace.categories.Transition
98
));
109

@@ -69,7 +68,7 @@ application.on(application.lowMemoryEvent, function (args: application.Applicati
6968
}
7069
});
7170

72-
application.on(application.uncaughtErrorEvent, function (args: application.ApplicationEventData) {
71+
application.on(application.uncaughtErrorEvent, function (args: application.UnhandledErrorEventData) {
7372
if (args.android) {
7473
// For Android applications, args.android is NativeScriptError.
7574
console.log("### NativeScriptError: " + args.android);

tns-core-modules/ui/core/view.android.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,12 @@ export class View extends ViewCommon {
160160
}
161161

162162
// copy all the locally cached values to the native android widget
163-
applyNativeSetters(child);
164163
return true;
165164
}
166165
this._eachChildView(eachChild);
167-
} else if (this._nativeView && !this.parent) {
168-
// copy all the locally cached values to the native android widget
169-
applyNativeSetters(this);
170-
}
166+
}
167+
168+
applyNativeSetters(this);
171169
}
172170

173171
public _onDetached(force?: boolean) {

tns-core-modules/ui/styling/background.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export module ad {
5858
_defaultBackgrounds.set(viewClass, nativeView.getBackground());
5959
}
6060

61-
backgroundDrawable = new org.nativescript.widgets.BorderDrawable(v.toString());
61+
backgroundDrawable = new org.nativescript.widgets.BorderDrawable(1, v.toString());
6262
refreshBorderDrawable(v, <org.nativescript.widgets.BorderDrawable>backgroundDrawable);
6363

6464
if (getSDK() >= 16) {

tns-platform-declarations/android/org.nativescript.widgets.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
}
4747

4848
export class BorderDrawable extends android.graphics.drawable.ColorDrawable {
49-
constructor(id: string);
49+
constructor(density: number);
50+
constructor(density: number, id: string);
5051

5152
public refresh(
5253
borderTopColor: number,

0 commit comments

Comments
 (0)