@@ -209,6 +209,7 @@ public class WPMainActivity extends LocaleAwareActivity implements
209
209
public static final String ARG_SELECTED_SITE = "SELECTED_SITE_ID" ;
210
210
public static final String ARG_STAT_TO_TRACK = "stat_to_track" ;
211
211
public static final String ARG_EDITOR_ORIGIN = "editor_origin" ;
212
+ public static final String ARG_CURRENT_FOCUS = "CURRENT_FOCUS" ;
212
213
213
214
// Track the first `onResume` event for the current session so we can use it for Analytics tracking
214
215
private static boolean mFirstResume = true ;
@@ -228,6 +229,7 @@ public class WPMainActivity extends LocaleAwareActivity implements
228
229
private static final String MAIN_BOTTOM_SHEET_TAG = "MAIN_BOTTOM_SHEET_TAG" ;
229
230
private static final String BLOGGING_REMINDERS_BOTTOM_SHEET_TAG = "BLOGGING_REMINDERS_BOTTOM_SHEET_TAG" ;
230
231
private final Handler mHandler = new Handler ();
232
+ private FocusPointInfo mCurrentActiveFocusPoint = null ;
231
233
232
234
@ Inject AccountStore mAccountStore ;
233
235
@ Inject SiteStore mSiteStore ;
@@ -383,6 +385,12 @@ && getIntent().getExtras().getBoolean(ARG_CONTINUE_JETPACK_CONNECT, false)) {
383
385
}
384
386
checkDismissNotification ();
385
387
checkTrackAnalyticsEvent ();
388
+ } else {
389
+ FocusPointInfo current = (FocusPointInfo )
390
+ savedInstanceState .getSerializable (ARG_CURRENT_FOCUS );
391
+ if (current != null ) {
392
+ mHandler .post (() -> addOrRemoveQuickStartFocusPoint (current .getTask (), true ));
393
+ }
386
394
}
387
395
388
396
// ensure the deep linking activity is enabled. It may have been disabled elsewhere and failed to get re-enabled
@@ -438,7 +446,6 @@ && getIntent().getExtras().getBoolean(ARG_CONTINUE_JETPACK_CONNECT, false)) {
438
446
}
439
447
440
448
scheduleLocalNotifications ();
441
-
442
449
initViewModel ();
443
450
444
451
if (getIntent ().getBooleanExtra (ARG_OPEN_BLOGGING_REMINDERS , false )) {
@@ -513,6 +520,12 @@ private void scheduleLocalNotifications() {
513
520
mWeeklyRoundupScheduler .schedule ();
514
521
}
515
522
523
+ @ Override
524
+ protected void onSaveInstanceState (@ NonNull Bundle outState ) {
525
+ outState .putSerializable (ARG_CURRENT_FOCUS , mCurrentActiveFocusPoint );
526
+ super .onSaveInstanceState (outState );
527
+ }
528
+
516
529
private void initViewModel () {
517
530
mFloatingActionButton = findViewById (R .id .fab_button );
518
531
mFabTooltip = findViewById (R .id .fab_tooltip );
@@ -1007,7 +1020,7 @@ public void onPageChanged(int position) {
1007
1020
mReaderTracker .onBottomNavigationTabChanged ();
1008
1021
PageType pageType = WPMainNavigationView .getPageType (position );
1009
1022
trackLastVisiblePage (pageType , true );
1010
-
1023
+ mCurrentActiveFocusPoint = null ;
1011
1024
if (pageType == PageType .READER ) {
1012
1025
// MySite fragment might not be attached to activity, so we need to remove focus point from here
1013
1026
QuickStartUtils .removeQuickStartFocusPoint (findViewById (R .id .root_view_main ));
@@ -1337,6 +1350,7 @@ private void addOrRemoveQuickStartFocusPoint(QuickStartTask activeTask, boolean
1337
1350
verticalOffset = 0 ;
1338
1351
}
1339
1352
if (targetView != null && shouldAdd ) {
1353
+ mCurrentActiveFocusPoint = new FocusPointInfo (activeTask , true );
1340
1354
QuickStartUtils .addQuickStartFocusPointAboveTheView (
1341
1355
parentView ,
1342
1356
targetView ,
0 commit comments