Search in sources :

Example 1 with SettingsBaseActivity

use of com.android.settings.core.SettingsBaseActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DashboardFragment method onStart.

@Override
public void onStart() {
    super.onStart();
    final DashboardCategory category = mDashboardFeatureProvider.getTilesForCategory(getCategoryKey());
    if (category == null) {
        return;
    }
    if (mSummaryLoader != null) {
        // SummaryLoader can be null when there is no dynamic tiles.
        mSummaryLoader.setListening(true);
    }
    final Activity activity = getActivity();
    if (activity instanceof SettingsBaseActivity) {
        mListeningToCategoryChange = true;
        ((SettingsBaseActivity) activity).addCategoryListener(this);
    }
}
Also used : DashboardCategory(com.android.settingslib.drawer.DashboardCategory) SettingsBaseActivity(com.android.settings.core.SettingsBaseActivity) SettingsBaseActivity(com.android.settings.core.SettingsBaseActivity) Activity(android.app.Activity)

Example 2 with SettingsBaseActivity

use of com.android.settings.core.SettingsBaseActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DashboardFragment method onStop.

@Override
public void onStop() {
    super.onStop();
    if (mSummaryLoader != null) {
        // SummaryLoader can be null when there is no dynamic tiles.
        mSummaryLoader.setListening(false);
    }
    if (mListeningToCategoryChange) {
        final Activity activity = getActivity();
        if (activity instanceof SettingsBaseActivity) {
            ((SettingsBaseActivity) activity).remCategoryListener(this);
        }
        mListeningToCategoryChange = false;
    }
}
Also used : SettingsBaseActivity(com.android.settings.core.SettingsBaseActivity) SettingsBaseActivity(com.android.settings.core.SettingsBaseActivity) Activity(android.app.Activity)

Aggregations

Activity (android.app.Activity)2 SettingsBaseActivity (com.android.settings.core.SettingsBaseActivity)2 DashboardCategory (com.android.settingslib.drawer.DashboardCategory)1