feat(android): FlexboxLayout support for isPassThroughParentEnabled (#8798)

This commit is contained in:
Dimitris - Rafail Katsampas
2021-01-29 23:03:27 +02:00
committed by GitHub
parent 39547b3ef6
commit 5fe27428e0
31 changed files with 333 additions and 302 deletions

View File

@@ -0,0 +1,11 @@
export function onStackLayoutTapped(args) {
console.log('The StackLayout is tapped (called method: onStackLayoutTapped)');
// Some visual action to execute when the tap is triggered
args.object.backgroundColor = !args.object.backgroundColor || args.object.backgroundColor.toString() !== '#FFFF00' ? '#FFFF00' : '#FFFFFF';
}
export function onFlexLayoutTap(args) {
console.log('The FlexboxLayout is tapped (called method: onFlexLayoutTap)');
// Some visual action to execute when the tap is triggered
args.object.backgroundColor = !args.object.backgroundColor || args.object.backgroundColor.toString() !== '#FFFF00' ? '#FFFF00' : '#FFFFFF';
}

View File

@@ -0,0 +1,14 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
<StackLayout tap="onStackLayoutTapped" backgroundColor="#fff">
<Label text="With 'isPassThroughParentEnabled'" textWrap="true" textAlignment="center" color="#000" fontSize="20"/>
<FlexboxLayout tap="onFlexLayoutTap" isPassThroughParentEnabled="true" alignItems="center" justifyContent="center" height="150" backgroundColor="#fff">
<Label text="Tap Here to trigger the parent tap! (StackLayout)" textWrap="true" fontSize="24"/>
</FlexboxLayout>
<Label text="Without 'isPassThroughParentEnabled'" textWrap="true" textAlignment="center" color="#000" fontSize="20"/>
<FlexboxLayout tap="onFlexLayoutTap" alignItems="center" justifyContent="center" height="150" backgroundColor="#fff">
<Label text="Tap Here to trigger both!" textWrap="true" fontSize="24"/>
</FlexboxLayout>
</StackLayout>
</Page>

View File

@@ -18,6 +18,7 @@ export function loadExamples() {
examples.set('flex-perf', 'flexbox/flexbox-perf-comparison-page');
examples.set('flexbox-4143', 'flexbox/flexbox-4143-page');
examples.set('flexbox-4834', 'flexbox/flexbox-4834-page');
examples.set("flexbox-ispassthroughparent", "flexbox/flexbox-ispassthroughparent-page");
return examples;
}