mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-25 09:30:32 +00:00
make main page changes display emediatly
This commit is contained in:
parent
8e8d74b5b7
commit
23eeb4353d
@ -119,6 +119,12 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sharedPreferences.getBoolean(Constants.KEY_MAIN_PAGE_CHANGE, false)) {
|
||||||
|
if (DEBUG) Log.d(TAG, "main page has changed, recreating main fragment...");
|
||||||
|
sharedPreferences.edit().putBoolean(Constants.KEY_MAIN_PAGE_CHANGE, false).apply();
|
||||||
|
NavigationHelper.openMainActivity(this);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,6 +30,7 @@ import org.schabi.newpipe.fragments.list.kiosk.KioskFragment;
|
|||||||
import org.schabi.newpipe.fragments.subscription.SubscriptionFragment;
|
import org.schabi.newpipe.fragments.subscription.SubscriptionFragment;
|
||||||
import org.schabi.newpipe.report.ErrorActivity;
|
import org.schabi.newpipe.report.ErrorActivity;
|
||||||
import org.schabi.newpipe.report.UserAction;
|
import org.schabi.newpipe.report.UserAction;
|
||||||
|
import org.schabi.newpipe.util.Constants;
|
||||||
import org.schabi.newpipe.util.KioskTranslator;
|
import org.schabi.newpipe.util.KioskTranslator;
|
||||||
import org.schabi.newpipe.util.NavigationHelper;
|
import org.schabi.newpipe.util.NavigationHelper;
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import org.schabi.newpipe.extractor.StreamingService;
|
|||||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||||
import org.schabi.newpipe.report.ErrorActivity;
|
import org.schabi.newpipe.report.ErrorActivity;
|
||||||
import org.schabi.newpipe.report.UserAction;
|
import org.schabi.newpipe.report.UserAction;
|
||||||
|
import org.schabi.newpipe.util.Constants;
|
||||||
import org.schabi.newpipe.util.KioskTranslator;
|
import org.schabi.newpipe.util.KioskTranslator;
|
||||||
|
|
||||||
public class ContentSettingsFragment extends BasePreferenceFragment {
|
public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||||
@ -88,6 +89,8 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
|||||||
mainPageContentPref.setSummary(getMainPageSummeryByKey(newValue));
|
mainPageContentPref.setSummary(getMainPageSummeryByKey(newValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultPreferences.edit().putBoolean(Constants.KEY_MAIN_PAGE_CHANGE, true).apply();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -9,4 +9,5 @@ public class Constants {
|
|||||||
public static final String KEY_QUERY = "key_query";
|
public static final String KEY_QUERY = "key_query";
|
||||||
|
|
||||||
public static final String KEY_THEME_CHANGE = "key_theme_change";
|
public static final String KEY_THEME_CHANGE = "key_theme_change";
|
||||||
|
public static final String KEY_MAIN_PAGE_CHANGE = "key_main_page_change";
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ public class NavigationHelper {
|
|||||||
if (!popped) openMainFragment(fragmentManager);
|
if (!popped) openMainFragment(fragmentManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void openMainFragment(FragmentManager fragmentManager) {
|
public static void openMainFragment(FragmentManager fragmentManager) {
|
||||||
InfoCache.getInstance().trimCache();
|
InfoCache.getInstance().trimCache();
|
||||||
|
|
||||||
fragmentManager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
fragmentManager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
||||||
|
Loading…
Reference in New Issue
Block a user