@@ -2,6 +2,7 @@ import { setFrame, getFrame, deleteFrame } from '../../util/frame'
2
2
import { isHMRChecking , resetHMRChecking } from '../../util/hmr'
3
3
import { isAndroid , isIOS } from 'tns-core-modules/platform'
4
4
import { ios as iosUtils } from 'tns-core-modules/utils/utils'
5
+ import { _setAndroidFragmentTransitions } from 'tns-core-modules/ui/frame/fragment.transitions'
5
6
6
7
let idCounter = 1
7
8
@@ -159,7 +160,30 @@ export default {
159
160
// replace the controllers instead of pushing directly
160
161
frame . _ios . controller . setViewControllersAnimated ( newControllers , false )
161
162
} else {
162
- // TODO: Implement for Android
163
+ const frameId = frame . _android . frameId
164
+ frame . _isBack = false
165
+ backstackEntry . frameId = frameId
166
+
167
+ const manager = frame . _getFragmentManager ( )
168
+ const currentEntry = frame . _currentEntry
169
+
170
+ const newFragmentTag = `fragment${ frameId } [-1]`
171
+ const newFragment = frame . createFragment ( backstackEntry , newFragmentTag )
172
+ const animated = false
173
+ const navigationTransition = null
174
+
175
+ const transaction = manager . beginTransaction ( )
176
+ _setAndroidFragmentTransitions (
177
+ animated ,
178
+ navigationTransition ,
179
+ currentEntry ,
180
+ backstackEntry ,
181
+ transaction ,
182
+ frameId
183
+ )
184
+ transaction . remove ( currentEntry . fragment )
185
+ transaction . replace ( frame . containerViewId , newFragment , newFragmentTag )
186
+ transaction . commitAllowingStateLoss ( )
163
187
}
164
188
resetHMRChecking ( )
165
189
} ,
0 commit comments