mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(android): FlexboxLayout support for isPassThroughParentEnabled (#8798)
This commit is contained in:
committed by
GitHub
parent
39547b3ef6
commit
5fe27428e0
11
apps/ui/src/flexbox/flexbox-ispassthroughparent-page.ts
Normal file
11
apps/ui/src/flexbox/flexbox-ispassthroughparent-page.ts
Normal 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';
|
||||
}
|
||||
14
apps/ui/src/flexbox/flexbox-ispassthroughparent-page.xml
Normal file
14
apps/ui/src/flexbox/flexbox-ispassthroughparent-page.xml
Normal 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>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user