mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 00:53:26 +02:00
Move thread fragment from pane
This commit is contained in:
@@ -122,6 +122,7 @@ import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
@@ -1779,6 +1780,21 @@ public class Helper {
|
||||
return options.toBundle();
|
||||
}
|
||||
|
||||
static Fragment recreateFragment(Fragment fragment, FragmentManager fm) {
|
||||
try {
|
||||
Fragment.SavedState savedState = fm.saveFragmentInstanceState(fragment);
|
||||
Bundle args = fragment.getArguments();
|
||||
|
||||
Fragment newFragment = fragment.getClass().newInstance();
|
||||
newFragment.setInitialSavedState(savedState);
|
||||
newFragment.setArguments(args);
|
||||
|
||||
return newFragment;
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException("Cannot recreate fragment=" + fragment, e);
|
||||
}
|
||||
}
|
||||
|
||||
// Graphics
|
||||
|
||||
static int dp2pixels(Context context, int dp) {
|
||||
|
||||
Reference in New Issue
Block a user