Skip to content

Commit 26b5686

Browse files
committed
fix(bottom-navigation/tabs): android fix for tabs disappearing
1 parent 9be38d3 commit 26b5686

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

src/core-tabs/tab-navigation/index.android.ts

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -110,50 +110,11 @@ function initializeNativeClasses() {
110110
}
111111

112112
public onDestroyView() {
113-
// const hasRemovingParent = this.getRemovingParentFragment();
114-
115-
// // Get view as bitmap and set it as background. This is workaround for the disapearing nested fragments.
116-
// // TODO: Consider removing it when update to androidx.fragment:1.2.0
117-
// if (hasRemovingParent && this.owner.selectedIndex === this.index && this.owner.nativeViewProtected) {
118-
// const bitmapDrawable = new android.graphics.drawable.BitmapDrawable(appResources, this.backgroundBitmap);
119-
// this.owner._originalBackground = this.owner.backgroundColor || new Color('White');
120-
// this.owner.nativeViewProtected.setBackground(bitmapDrawable);
121-
// this.backgroundBitmap = null;
122-
// }
123-
124113
super.onDestroyView();
125114
const tabItem = this.owner.items[this.index];
126115
tabItem.canBeLoaded = false;
127-
tabItem._tearDownUI(true);
116+
tabItem.unloadView(tabItem.content);
128117
}
129-
130-
// public onPause(): void {
131-
// const hasRemovingParent = this.getRemovingParentFragment();
132-
133-
// // Get view as bitmap and set it as background. This is workaround for the disapearing nested fragments.
134-
// // TODO: Consider removing it when update to androidx.fragment:1.2.0
135-
// if (hasRemovingParent && this.owner.selectedIndex === this.index && this.owner.nativeViewProtected) {
136-
// this.backgroundBitmap = this.loadBitmapFromView(this.owner.nativeViewProtected);
137-
// }
138-
139-
// super.onPause();
140-
// }
141-
142-
// private loadBitmapFromView(view: android.view.View): android.graphics.Bitmap {
143-
// // Another way to get view bitmap. Test performance vs setDrawingCacheEnabled
144-
// // const width = view.getWidth();
145-
// // const height = view.getHeight();
146-
// // const bitmap = android.graphics.Bitmap.createBitmap(width, height, android.graphics.Bitmap.Config.ARGB_8888);
147-
// // const canvas = new android.graphics.Canvas(bitmap);
148-
// // view.layout(0, 0, width, height);
149-
// // view.draw(canvas);
150-
151-
// view.setDrawingCacheEnabled(true);
152-
// const bitmap = android.graphics.Bitmap.createBitmap(view.getDrawingCache());
153-
// view.setDrawingCacheEnabled(false);
154-
155-
// return bitmap;
156-
// }
157118
}
158119

159120
@NativeClass

0 commit comments

Comments
 (0)