Skip to content

Instantly share code, notes, and snippets.

View NickIliev's full-sized avatar

Nikolay Iliev NickIliev

  • Progress
  • Sofia, Bulgaria
View GitHub Profile
@NickIliev
NickIliev / nsconfig.json
Created March 29, 2019 07:39
nativescript HMR commands
{
"useLegacyWorkflow": false
}
@NickIliev
NickIliev / hmr-by-default.sh
Created March 29, 2019 07:43
nativescript
tns run
@NickIliev
NickIliev / event-propagation-nativescript.xml
Created August 14, 2019 11:26
Event propagation (bubbling) in NativeScript
<GridLayout id="outmost" margin="10" backgroundColor="orangered" tap="onTap" >
<GridLayout id="middle" margin="50" backgroundColor="lightgray" tap="onTap">
<GridLayout id="inner" margin="50" backgroundColor="blue" tap="onTap"> <!-- The StackLayout will propagete the tap gesture to its parents -->
<Button text="Button" id="my-button" width="100" height="200" tap="onTap" backgroundColor="whitesmoke" /> <!-- The Button has its own tap logic and won't propagate the tap event -->
</GridLayout>
</GridLayout>
</GridLayout>
@NickIliev
NickIliev / event-propagation-nativescript.ts
Created August 14, 2019 11:35
Event propagation (bubbling) in NativeScript
export function onTap(args: EventData) {
console.log(`>>>>>>>>>>> onTap invoked from: ${args.object}`);
const view: View = args.object as View;
animate(view);
}
@NickIliev
NickIliev / is-pass-through-parent-enabled.xml
Last active August 14, 2019 12:25
Using isPassThroughParentEnabled property to pass gestures from disabled button to a parent layout.
<GridLayout id="outmost" margin="10" backgroundColor="orangered" tap="onTap">
<GridLayout id="middle" margin="50" backgroundColor="lightgray" tap="onTap">
<StackLayout id="inner" margin="50" backgroundColor="blue" tap="onTap" isPassThroughParentEnabled="true">
<Button text="Active Button" id="button-active" tap="onTap" backgroundColor="whitesmoke" margin="20" height="100"/>
<Button isUserInteractionEnabled="false" text="DISABLED Button" id="button-disabled" tap="onTap" backgroundColor="gray" margin="20" height="100"/>
</StackLayout>
</GridLayout>
</GridLayout>