@@ -110,50 +110,11 @@ function initializeNativeClasses() {
110
110
}
111
111
112
112
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
-
124
113
super . onDestroyView ( ) ;
125
114
const tabItem = this . owner . items [ this . index ] ;
126
115
tabItem . canBeLoaded = false ;
127
- tabItem . _tearDownUI ( true ) ;
116
+ tabItem . unloadView ( tabItem . content ) ;
128
117
}
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
- // }
157
118
}
158
119
159
120
@NativeClass
0 commit comments