Revert "work around crash theme switch"

This reverts commit 58fd0c444f30aa5352486b97cab34b2aca6ce8ab.
This commit is contained in:
sk 2023-01-13 18:18:39 +01:00
parent 6bea10bdac
commit 54200991cb
2 changed files with 4 additions and 12 deletions

View File

@ -5,7 +5,6 @@ import android.app.NotificationManager;
import android.graphics.Outline; import android.graphics.Outline;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -258,15 +257,9 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
public void onSaveInstanceState(Bundle outState){ public void onSaveInstanceState(Bundle outState){
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
outState.putInt("selectedTab", currentTab); outState.putInt("selectedTab", currentTab);
try {
getChildFragmentManager().putFragment(outState, "homeTabFragment", homeTabFragment); getChildFragmentManager().putFragment(outState, "homeTabFragment", homeTabFragment);
getChildFragmentManager().putFragment(outState, "searchFragment", searchFragment); getChildFragmentManager().putFragment(outState, "searchFragment", searchFragment);
getChildFragmentManager().putFragment(outState, "notificationsFragment", notificationsFragment); getChildFragmentManager().putFragment(outState, "notificationsFragment", notificationsFragment);
getChildFragmentManager().putFragment(outState, "profileFragment", profileFragment); getChildFragmentManager().putFragment(outState, "profileFragment", profileFragment);
} catch (IllegalStateException ex) {
// java.lang.IllegalStateException: Fragment HomeTabFragment{3447cad} is not currently in the FragmentManager
// no idea how to fix this :/
Log.e(HomeFragment.class.getSimpleName(), ex.getMessage());
}
} }
} }

View File

@ -400,7 +400,6 @@ public class SettingsFragment extends MastodonToolbarFragment{
lp.windowAnimations=R.style.window_fade_out; lp.windowAnimations=R.style.window_fade_out;
MastodonApp.context.getSystemService(WindowManager.class).addView(themeTransitionWindowView, lp); MastodonApp.context.getSystemService(WindowManager.class).addView(themeTransitionWindowView, lp);
} }
needAppRestart = true; // avoid issues with corrupted, not correctly inset HomeTabFragment
getActivity().recreate(); getActivity().recreate();
} }