mirror of https://github.com/M66B/FairEmail.git
Restore display tab on changing theme
This commit is contained in:
parent
ca23b0dd85
commit
2088d3a4ba
|
@ -61,6 +61,10 @@ public class FragmentOptions extends FragmentBase {
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
TabLayout tabLayout = view.findViewById(R.id.tab_layout);
|
TabLayout tabLayout = view.findViewById(R.id.tab_layout);
|
||||||
tabLayout.setupWithViewPager(pager);
|
tabLayout.setupWithViewPager(pager);
|
||||||
|
|
||||||
|
String tab = getActivity().getIntent().getStringExtra("tab");
|
||||||
|
if ("display".equals(tab))
|
||||||
|
pager.setCurrentItem(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class PagerAdapter extends FragmentStatePagerAdapter {
|
private class PagerAdapter extends FragmentStatePagerAdapter {
|
||||||
|
|
|
@ -280,6 +280,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||||
rgTheme.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
rgTheme.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||||
|
getActivity().getIntent().putExtra("tab", "display");
|
||||||
|
|
||||||
switch (checkedId) {
|
switch (checkedId) {
|
||||||
case R.id.rbThemeLight:
|
case R.id.rbThemeLight:
|
||||||
prefs.edit().putString("theme", "light").apply();
|
prefs.edit().putString("theme", "light").apply();
|
||||||
|
|
Loading…
Reference in New Issue