|
1 | | -// Types |
| 1 | +import { GridLayout, View } from '@nativescript/core'; |
2 | 2 | import { TabContentItem as TabContentItemDefinition } from '.'; |
3 | | -import { TabNavigationBase } from '../tab-navigation-base'; |
4 | | -import { GridLayout, Trace, View } from '@nativescript/core'; |
5 | | -// Requires |
6 | | -import { TabContentItemBase, traceCategory } from './tab-content-item-common'; |
| 3 | +import { TabContentItemBase } from './tab-content-item-common'; |
7 | 4 |
|
8 | 5 | export * from './tab-content-item-common'; |
9 | 6 |
|
10 | 7 | export class TabContentItem extends TabContentItemBase { |
11 | 8 | public nativeViewProtected: org.nativescript.widgets.GridLayout; |
12 | 9 | public tabItemSpec: com.nativescript.material.core.TabItemSpec; |
13 | | - public index: number; |
14 | 10 |
|
15 | 11 | get _hasFragments(): boolean { |
16 | 12 | return true; |
@@ -40,35 +36,4 @@ export class TabContentItem extends TabContentItemBase { |
40 | 36 | super.disposeNativeView(); |
41 | 37 | (this as TabContentItemDefinition).canBeLoaded = false; |
42 | 38 | } |
43 | | - |
44 | | - public _getChildFragmentManager(): androidx.fragment.app.FragmentManager { |
45 | | - const tabView = this.parent as TabNavigationBase; |
46 | | - let tabFragment = null; |
47 | | - const fragmentManager = tabView._getFragmentManager(); |
48 | | - |
49 | | - if (typeof this.index === 'undefined') { |
50 | | - Trace.write('Current TabContentItem index is not set', traceCategory, Trace.messageType.error); |
51 | | - } |
52 | | - |
53 | | - const fragments = fragmentManager.getFragments().toArray(); |
54 | | - for (let i = 0; i < fragments.length; i++) { |
55 | | - if (fragments[i].index === this.index) { |
56 | | - tabFragment = fragments[i]; |
57 | | - break; |
58 | | - } |
59 | | - } |
60 | | - |
61 | | - // TODO: can happen in a modal tabview scenario when the modal dialog fragment is already removed |
62 | | - if (!tabFragment) { |
63 | | - // if (Trace.isEnabled()) { |
64 | | - // Trace.write(`Could not get child fragment manager for tab item with index ${this.index}`, traceCategory); |
65 | | - // } |
66 | | - |
67 | | - // TODO: fix d.ts in view module |
68 | | - //@ts-ignore |
69 | | - return tabView._getRootFragmentManager(); |
70 | | - } |
71 | | - |
72 | | - return tabFragment.getChildFragmentManager(); |
73 | | - } |
74 | 39 | } |
0 commit comments