| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ export function loadExamples() { | |||
| 28 | 28 | examples.set("4450", "issues/issue-4450"); | |
| 29 | 29 | examples.set("5274", "issues/issue-5274"); | |
| 30 | 30 | examples.set("ng-repo-1599", "issues/issue-ng-repo-1599"); | |
| 31 | + examples.set("ng-repo-1626", "issues/issue-ng-repo-1626"); | ||
| 31 | 32 | examples.set("6439", "issues/issue-6439"); | |
| 32 | 33 | ||
| 33 | 34 | return examples; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,7 @@ export function loadExamples() { | |||
| 24 | 24 | examples.set("tab-view-bottom-position", "tab-view/tab-view-bottom-position"); | |
| 25 | 25 | examples.set("issue-5470", "tab-view/issue-5470"); | |
| 26 | 26 | examples.set("tab-view-tab-text-font-size", "tab-view/tab-view-tab-text-font-size"); | |
| 27 | + examples.set("tab-view-android-swipe", "tab-view/tab-view-android-swipe"); | ||
| 27 | 28 | examples.set("tab-view-icon-title-placement", "tab-view/icon-title-placement"); | |
| 28 | 29 | return examples; | |
| 29 | 30 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + <Page cssFile="~/ui-tests-app/css/test.css" loaded="onLoaded"> | ||
| 2 | + <TabView androidSwipeEnabled="false"> | ||
| 3 | + <TabView.items> | ||
| 4 | + | ||
| 5 | + <TabViewItem title="Tab 1"> | ||
| 6 | + <TabViewItem.view> | ||
| 7 | + <Label text="Label 1" /> | ||
| 8 | + </TabViewItem.view> | ||
| 9 | + </TabViewItem> | ||
| 10 | + | ||
| 11 | + <TabViewItem title="Tab 2"> | ||
| 12 | + <TabViewItem.view> | ||
| 13 | + <Label text="Label 2" /> | ||
| 14 | + </TabViewItem.view> | ||
| 15 | + </TabViewItem> | ||
| 16 | + | ||
| 17 | + <TabViewItem title="Tab 3"> | ||
| 18 | + <TabViewItem.view> | ||
| 19 | + <Label text="Label 3" /> | ||
| 20 | + </TabViewItem.view> | ||
| 21 | + </TabViewItem> | ||
| 22 | + </TabView.items> | ||
| 23 | + </TabView> | ||
| 24 | + </Page> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -261,14 +261,13 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition { | |||
| 261 | 261 | if (that._closeModalCallback) { | |
| 262 | 262 | const modalIndex = _rootModalViews.indexOf(that); | |
| 263 | 263 | _rootModalViews.splice(modalIndex); | |
| 264 | + that._modalParent = null; | ||
| 265 | + that._modalContext = null; | ||
| 266 | + that._closeModalCallback = null; | ||
| 267 | + that._dialogClosed(); | ||
| 268 | + parent._modal = null; | ||
| 264 | 269 | ||
| 265 | 270 | const whenClosedCallback = () => { | |
| 266 | - that._modalParent = null; | ||
| 267 | - that._modalContext = null; | ||
| 268 | - that._closeModalCallback = null; | ||
| 269 | - that._dialogClosed(); | ||
| 270 | - parent._modal = null; | ||
| 271 | - | ||
| 272 | 271 | if (typeof closeCallback === "function") { | |
| 273 | 272 | closeCallback.apply(undefined, originalArgs); | |
| 274 | 273 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | import { | |
| 3 | 3 | View, ViewBase, Style, Property, CssProperty, CoercibleProperty, | |
| 4 | 4 | Color, isIOS, AddArrayFromBuilder, AddChildFromBuilder, EventData, CSSType, | |
| 5 | - traceWrite, traceCategories, traceMessageType | ||
| 5 | + traceWrite, traceCategories, traceMessageType, booleanConverter | ||
| 6 | 6 | } from "../core/view"; | |
| 7 | 7 | ||
| 8 | 8 | export * from "../core/view"; | |
@@ -95,6 +95,7 @@ export class TabViewBase extends View implements TabViewDefinition, AddChildFrom | |||
| 95 | 95 | public selectedIndex: number; | |
| 96 | 96 | public androidOffscreenTabLimit: number; | |
| 97 | 97 | public androidTabsPosition: "top" | "bottom"; | |
| 98 | + public androidSwipeEnabled: boolean; | ||
| 98 | 99 | public iosIconRenderingMode: "automatic" | "alwaysOriginal" | "alwaysTemplate"; | |
| 99 | 100 | ||
| 100 | 101 | get androidSelectedTabHighlightColor(): Color { | |
@@ -252,6 +253,9 @@ androidOffscreenTabLimitProperty.register(TabViewBase); | |||
| 252 | 253 | export const androidTabsPositionProperty = new Property<TabViewBase, "top" | "bottom">({ name: "androidTabsPosition", defaultValue: "top" }); | |
| 253 | 254 | androidTabsPositionProperty.register(TabViewBase); | |
| 254 | 255 | ||
| 256 | + export const androidSwipeEnabledProperty = new Property<TabViewBase, boolean>({ name: "androidSwipeEnabled", defaultValue: true, valueConverter: booleanConverter }); | ||
| 257 | + androidSwipeEnabledProperty.register(TabViewBase); | ||
| 258 | + | ||
| 255 | 259 | export const tabTextFontSizeProperty = new CssProperty<Style, number>({ name: "tabTextFontSize", cssName: "tab-text-font-size", valueConverter: (v) => parseFloat(v) }); | |
| 256 | 260 | tabTextFontSizeProperty.register(Style); | |
| 257 | 261 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -437,6 +437,10 @@ export class TabView extends TabViewBase { | |||
| 437 | 437 | nativeView.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.star)); | |
| 438 | 438 | ||
| 439 | 439 | viewPager.setLayoutParams(lp); | |
| 440 | + | ||
| 441 | + if (!this.androidSwipeEnabled) { | ||
| 442 | + viewPager.setSwipePageEnabled(false); | ||
| 443 | + } | ||
| 440 | 444 | } else { | |
| 441 | 445 | nativeView.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.star)); | |
| 442 | 446 | nativeView.addRow(new org.nativescript.widgets.ItemSpec(1, org.nativescript.widgets.GridUnitType.auto)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -122,6 +122,11 @@ export class TabView extends View { | |||
| 122 | 122 | */ | |
| 123 | 123 | androidTabsPosition: "top" | "bottom"; | |
| 124 | 124 | ||
| 125 | + /** | ||
| 126 | + * Gets or sets a value indicating whether swipe gesture is enabled for Android. | ||
| 127 | + */ | ||
| 128 | + androidSwipeEnabled: boolean; | ||
| 129 | + | ||
| 125 | 130 | /** | |
| 126 | 131 | * String value used when hooking to the selectedIndexChanged event. | |
| 127 | 132 | */ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments