Search in sources :

Example 1 with VolumeFilter

use of com.android.settingslib.applications.ApplicationsState.VolumeFilter in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ManageApplications method createHeader.

private void createHeader() {
    Activity activity = getActivity();
    FrameLayout pinnedHeader = (FrameLayout) mRootView.findViewById(R.id.pinned_header);
    mSpinnerHeader = (ViewGroup) activity.getLayoutInflater().inflate(R.layout.apps_filter_spinner, pinnedHeader, false);
    mFilterSpinner = (Spinner) mSpinnerHeader.findViewById(R.id.filter_spinner);
    mFilterAdapter = new FilterSpinnerAdapter(this);
    mFilterSpinner.setAdapter(mFilterAdapter);
    mFilterSpinner.setOnItemSelectedListener(this);
    pinnedHeader.addView(mSpinnerHeader, 0);
    mFilterAdapter.enableFilter(getDefaultFilter());
    if (mListType == LIST_TYPE_MAIN) {
        if (UserManager.get(getActivity()).getUserProfiles().size() > 1) {
            mFilterAdapter.enableFilter(FILTER_APPS_PERSONAL);
            mFilterAdapter.enableFilter(FILTER_APPS_WORK);
        }
    }
    if (mListType == LIST_TYPE_NOTIFICATION) {
        mFilterAdapter.enableFilter(FILTER_APPS_BLOCKED);
        mFilterAdapter.enableFilter(FILTER_APPS_SILENT);
        mFilterAdapter.enableFilter(FILTER_APPS_SENSITIVE);
        mFilterAdapter.enableFilter(FILTER_APPS_HIDE_NOTIFICATIONS);
        mFilterAdapter.enableFilter(FILTER_APPS_PRIORITY);
    }
    if (mListType == LIST_TYPE_HIGH_POWER) {
        mFilterAdapter.enableFilter(FILTER_APPS_POWER_WHITELIST_ALL);
    }
    if (mListType == LIST_TYPE_STORAGE) {
        mApplications.setOverrideFilter(new VolumeFilter(mVolumeUuid));
    }
}
Also used : FrameLayout(android.widget.FrameLayout) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) UsageAccessSettingsActivity(com.android.settings.Settings.UsageAccessSettingsActivity) WriteSettingsActivity(com.android.settings.Settings.WriteSettingsActivity) AllApplicationsActivity(com.android.settings.Settings.AllApplicationsActivity) HighPowerApplicationsActivity(com.android.settings.Settings.HighPowerApplicationsActivity) SettingsActivity(com.android.settings.SettingsActivity) StorageUseActivity(com.android.settings.Settings.StorageUseActivity) OverlaySettingsActivity(com.android.settings.Settings.OverlaySettingsActivity) NotificationAppListActivity(com.android.settings.Settings.NotificationAppListActivity) Activity(android.app.Activity) VolumeFilter(com.android.settingslib.applications.ApplicationsState.VolumeFilter)

Example 2 with VolumeFilter

use of com.android.settingslib.applications.ApplicationsState.VolumeFilter in project platform_packages_apps_Settings by BlissRoms.

the class ManageApplications method createHeader.

private void createHeader() {
    Activity activity = getActivity();
    FrameLayout pinnedHeader = (FrameLayout) mRootView.findViewById(R.id.pinned_header);
    mSpinnerHeader = (ViewGroup) activity.getLayoutInflater().inflate(R.layout.apps_filter_spinner, pinnedHeader, false);
    mFilterSpinner = (Spinner) mSpinnerHeader.findViewById(R.id.filter_spinner);
    mFilterAdapter = new FilterSpinnerAdapter(this);
    mFilterSpinner.setAdapter(mFilterAdapter);
    mFilterSpinner.setOnItemSelectedListener(this);
    pinnedHeader.addView(mSpinnerHeader, 0);
    mFilterAdapter.enableFilter(getDefaultFilter());
    if (mListType == LIST_TYPE_MAIN || mListType == LIST_TYPE_NOTIFICATION) {
        if (UserManager.get(getActivity()).getUserProfiles().size() > 1) {
            mFilterAdapter.enableFilter(FILTER_APPS_PERSONAL);
            mFilterAdapter.enableFilter(FILTER_APPS_WORK);
        }
    }
    if (mListType == LIST_TYPE_NOTIFICATION) {
        mFilterAdapter.enableFilter(FILTER_APPS_BLOCKED);
        mFilterAdapter.enableFilter(FILTER_APPS_PRIORITY);
        mFilterAdapter.enableFilter(FILTER_APPS_SENSITIVE);
        mFilterAdapter.enableFilter(FILTER_APPS_NO_PEEKING);
    }
    if (mListType == LIST_TYPE_HIGH_POWER) {
        mFilterAdapter.enableFilter(FILTER_APPS_POWER_WHITELIST_ALL);
    }
    if (mListType == LIST_TYPE_STORAGE) {
        mApplications.setOverrideFilter(new VolumeFilter(mVolumeUuid));
    }
}
Also used : FrameLayout(android.widget.FrameLayout) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) UsageAccessSettingsActivity(com.android.settings.Settings.UsageAccessSettingsActivity) WriteSettingsActivity(com.android.settings.Settings.WriteSettingsActivity) DomainsURLsAppListActivity(com.android.settings.Settings.DomainsURLsAppListActivity) AllApplicationsActivity(com.android.settings.Settings.AllApplicationsActivity) HighPowerApplicationsActivity(com.android.settings.Settings.HighPowerApplicationsActivity) SettingsActivity(com.android.settings.SettingsActivity) StorageUseActivity(com.android.settings.Settings.StorageUseActivity) OverlaySettingsActivity(com.android.settings.Settings.OverlaySettingsActivity) NotificationAppListActivity(com.android.settings.Settings.NotificationAppListActivity) Activity(android.app.Activity) VolumeFilter(com.android.settingslib.applications.ApplicationsState.VolumeFilter)

Aggregations

Activity (android.app.Activity)2 PreferenceFrameLayout (android.preference.PreferenceFrameLayout)2 FrameLayout (android.widget.FrameLayout)2 AllApplicationsActivity (com.android.settings.Settings.AllApplicationsActivity)2 HighPowerApplicationsActivity (com.android.settings.Settings.HighPowerApplicationsActivity)2 NotificationAppListActivity (com.android.settings.Settings.NotificationAppListActivity)2 OverlaySettingsActivity (com.android.settings.Settings.OverlaySettingsActivity)2 StorageUseActivity (com.android.settings.Settings.StorageUseActivity)2 UsageAccessSettingsActivity (com.android.settings.Settings.UsageAccessSettingsActivity)2 WriteSettingsActivity (com.android.settings.Settings.WriteSettingsActivity)2 SettingsActivity (com.android.settings.SettingsActivity)2 VolumeFilter (com.android.settingslib.applications.ApplicationsState.VolumeFilter)2 DomainsURLsAppListActivity (com.android.settings.Settings.DomainsURLsAppListActivity)1