Search in sources :

Example 1 with WifiDataUsageSummaryPreferenceController

use of com.android.settings.datausage.WifiDataUsageSummaryPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class WifiDetailPreferenceController method setupEntityHeader.

private void setupEntityHeader(PreferenceScreen screen) {
    LayoutPreference headerPref = screen.findPreference(KEY_HEADER);
    if (usingDataUsageHeader(mContext)) {
        headerPref.setVisible(false);
        mDataUsageSummaryPref = screen.findPreference(KEY_DATA_USAGE_HEADER);
        mDataUsageSummaryPref.setVisible(true);
        mSummaryHeaderController = new WifiDataUsageSummaryPreferenceController(mFragment.getActivity(), mLifecycle, (PreferenceFragmentCompat) mFragment, mAccessPoint.getSsid());
        return;
    }
    mEntityHeaderController = EntityHeaderController.newInstance(mFragment.getActivity(), mFragment, headerPref.findViewById(R.id.entity_header));
    ImageView iconView = headerPref.findViewById(R.id.entity_header_icon);
    iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
    mEntityHeaderController.setLabel(mAccessPoint.getTitle());
}
Also used : LayoutPreference(com.android.settingslib.widget.LayoutPreference) WifiDataUsageSummaryPreferenceController(com.android.settings.datausage.WifiDataUsageSummaryPreferenceController) PreferenceFragmentCompat(androidx.preference.PreferenceFragmentCompat) ImageView(android.widget.ImageView)

Example 2 with WifiDataUsageSummaryPreferenceController

use of com.android.settings.datausage.WifiDataUsageSummaryPreferenceController in project android_packages_apps_Settings by omnirom.

the class WifiDetailPreferenceController2 method setupEntityHeader.

private void setupEntityHeader(PreferenceScreen screen) {
    LayoutPreference headerPref = screen.findPreference(KEY_HEADER);
    if (usingDataUsageHeader(mContext)) {
        headerPref.setVisible(false);
        mDataUsageSummaryPref = screen.findPreference(KEY_DATA_USAGE_HEADER);
        mDataUsageSummaryPref.setVisible(true);
        mSummaryHeaderController = new WifiDataUsageSummaryPreferenceController(mFragment.getActivity(), mLifecycle, (PreferenceFragmentCompat) mFragment, mWifiEntry.getTitle());
        return;
    }
    mEntityHeaderController = EntityHeaderController.newInstance(mFragment.getActivity(), mFragment, headerPref.findViewById(R.id.entity_header));
    ImageView iconView = headerPref.findViewById(R.id.entity_header_icon);
    iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
    mEntityHeaderController.setLabel(mWifiEntry.getTitle());
}
Also used : LayoutPreference(com.android.settingslib.widget.LayoutPreference) WifiDataUsageSummaryPreferenceController(com.android.settings.datausage.WifiDataUsageSummaryPreferenceController) PreferenceFragmentCompat(androidx.preference.PreferenceFragmentCompat) ImageView(android.widget.ImageView)

Aggregations

ImageView (android.widget.ImageView)2 PreferenceFragmentCompat (androidx.preference.PreferenceFragmentCompat)2 WifiDataUsageSummaryPreferenceController (com.android.settings.datausage.WifiDataUsageSummaryPreferenceController)2 LayoutPreference (com.android.settingslib.widget.LayoutPreference)2