mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 21:34:44 +02:00
Fixed duplicate legend page titles on rotate
This commit is contained in:
@@ -48,6 +48,9 @@ public class FragmentLegend extends FragmentBase {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
setSubtitle(R.string.menu_legend);
|
||||
|
||||
if (savedInstanceState != null)
|
||||
layout = savedInstanceState.getInt("fair:layout");
|
||||
|
||||
View view;
|
||||
if (layout < 0) {
|
||||
view = inflater.inflate(R.layout.fragment_legend, container, false);
|
||||
@@ -63,12 +66,21 @@ public class FragmentLegend extends FragmentBase {
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
if (savedInstanceState != null)
|
||||
layout = savedInstanceState.getInt("fair:layout");
|
||||
|
||||
if (layout < 0) {
|
||||
TabLayout tabLayout = view.findViewById(R.id.tab_layout);
|
||||
tabLayout.setupWithViewPager(pager);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
outState.putInt("fair:layout", layout);
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
private class PagerAdapter extends FragmentStatePagerAdapter {
|
||||
public PagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
|
||||
Reference in New Issue
Block a user