-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(android): 'isEnabled' now works properly for SegmentedBar (#8711)
- Loading branch information
Showing
7 changed files
with
72 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as frame from "tns-core-modules/ui/frame"; | ||
|
||
export function navigate() { | ||
frame.topmost().goBack(); | ||
} |
10 changes: 10 additions & 0 deletions
10
e2e/ui-tests-app/app/segmented-bar/android-enabled-page.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Page> | ||
<StackLayout> | ||
<SegmentedBar selectedIndex="1" isEnabled="false"> | ||
<SegmentedBarItem title="Item 1" /> | ||
<SegmentedBarItem title="Item 2" /> | ||
<SegmentedBarItem title="Item 3" /> | ||
</SegmentedBar> | ||
<Button text="go to previous page" tap="navigate" /> | ||
</StackLayout> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<Page> | ||
<StackLayout> | ||
<SegmentedBar selectedIndex="1"> | ||
<SegmentedBar.items> | ||
<SegmentedBarItem title="Item 1" /> | ||
<SegmentedBarItem title="Item 2" /> | ||
<SegmentedBarItem title="Item 3" /> | ||
</SegmentedBar.items> | ||
</SegmentedBar> | ||
<Button text="go to previous page" tap="navigate"/> | ||
</StackLayout> | ||
</Page> | ||
<StackLayout> | ||
<SegmentedBar selectedIndex="1"> | ||
<SegmentedBar.items> | ||
<SegmentedBarItem title="Item 1" /> | ||
<SegmentedBarItem title="Item 2" /> | ||
<SegmentedBarItem title="Item 3" /> | ||
</SegmentedBar.items> | ||
</SegmentedBar> | ||
<Button text="go to previous page" tap="navigate" /> | ||
</StackLayout> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { EventData } from "tns-core-modules/data/observable"; | ||
import { SubMainPageViewModel } from "../sub-main-page-view-model"; | ||
import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout"; | ||
import { Page } from "tns-core-modules/ui/page"; | ||
|
||
export function pageLoaded(args: EventData) { | ||
const page = <Page>args.object; | ||
const wrapLayout = <WrapLayout>page.getViewById("wrapLayoutWithExamples"); | ||
page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples()); | ||
} | ||
|
||
export function loadExamples() { | ||
const examples = new Map<string, string>(); | ||
examples.set("segStyle", "segmented-bar/all-page"); | ||
examples.set("clean", "segmented-bar/clean-page"); | ||
examples.set("android-enabled", "segmented-bar/android-enabled-page"); | ||
|
||
return examples; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<Page loaded="pageLoaded"> | ||
<ScrollView orientation="vertical" row="1"> | ||
<WrapLayout id="wrapLayoutWithExamples"/> | ||
</ScrollView> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters