Search in sources :

Example 36 with PreferenceFrameLayout

use of android.preference.PreferenceFrameLayout in project android_packages_apps_Settings by SudaMod.

the class BackgroundCheckSummary method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // initialize the inflater
    mInflater = inflater;
    View rootView = mInflater.inflate(R.layout.background_check_summary, container, false);
    // only when the view is added.
    if (container instanceof PreferenceFrameLayout) {
        ((PreferenceFrameLayout.LayoutParams) rootView.getLayoutParams()).removeBorders = true;
    }
    FragmentTransaction ft = getChildFragmentManager().beginTransaction();
    ft.add(R.id.appops_content, new AppOpsCategory(AppOpsState.RUN_IN_BACKGROUND_TEMPLATE, true), "appops");
    ft.commitAllowingStateLoss();
    return rootView;
}
Also used : FragmentTransaction(android.app.FragmentTransaction) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) View(android.view.View)

Example 37 with PreferenceFrameLayout

use of android.preference.PreferenceFrameLayout in project android_packages_apps_Settings by SudaMod.

the class Utils method prepareCustomPreferencesList.

/**
 * Prepare a custom preferences layout, moving padding to {@link ListView}
 * when outside scrollbars are requested. Usually used to display
 * {@link ListView} and {@link TabWidget} with correct padding.
 */
public static void prepareCustomPreferencesList(ViewGroup parent, View child, View list, boolean ignoreSidePadding) {
    final boolean movePadding = list.getScrollBarStyle() == View.SCROLLBARS_OUTSIDE_OVERLAY;
    if (movePadding) {
        final Resources res = list.getResources();
        final int paddingSide = res.getDimensionPixelSize(R.dimen.settings_side_margin);
        final int paddingBottom = res.getDimensionPixelSize(com.android.internal.R.dimen.preference_fragment_padding_bottom);
        if (parent instanceof PreferenceFrameLayout) {
            ((PreferenceFrameLayout.LayoutParams) child.getLayoutParams()).removeBorders = true;
            final int effectivePaddingSide = ignoreSidePadding ? 0 : paddingSide;
            list.setPaddingRelative(effectivePaddingSide, 0, effectivePaddingSide, paddingBottom);
        } else {
            list.setPaddingRelative(paddingSide, 0, paddingSide, paddingBottom);
        }
    }
}
Also used : Resources(android.content.res.Resources) PreferenceFrameLayout(android.preference.PreferenceFrameLayout)

Example 38 with PreferenceFrameLayout

use of android.preference.PreferenceFrameLayout in project platform_packages_apps_Settings by BlissRoms.

the class CaptionPropertiesFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.captioning_preview, container, false);
    // only when the view is added.
    if (container instanceof PreferenceFrameLayout) {
        ((PreferenceFrameLayout.LayoutParams) rootView.getLayoutParams()).removeBorders = true;
    }
    final View content = super.onCreateView(inflater, container, savedInstanceState);
    ((ViewGroup) rootView.findViewById(R.id.properties_fragment)).addView(content, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    return rootView;
}
Also used : ViewGroup(android.view.ViewGroup) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) View(android.view.View) SubtitleView(com.android.internal.widget.SubtitleView)

Example 39 with PreferenceFrameLayout

use of android.preference.PreferenceFrameLayout in project android_packages_apps_Settings by omnirom.

the class Utils method prepareCustomPreferencesList.

/**
 * Prepare a custom preferences layout, moving padding to {@link ListView}
 * when outside scrollbars are requested. Usually used to display
 * {@link ListView} and {@link TabWidget} with correct padding.
 */
public static void prepareCustomPreferencesList(ViewGroup parent, View child, View list, boolean ignoreSidePadding) {
    final boolean movePadding = list.getScrollBarStyle() == View.SCROLLBARS_OUTSIDE_OVERLAY;
    if (movePadding) {
        final Resources res = list.getResources();
        final int paddingBottom = res.getDimensionPixelSize(com.android.internal.R.dimen.preference_fragment_padding_bottom);
        if (parent instanceof PreferenceFrameLayout) {
            ((PreferenceFrameLayout.LayoutParams) child.getLayoutParams()).removeBorders = true;
        }
        list.setPaddingRelative(0, /* start */
        0, /* top */
        0, /* end */
        paddingBottom);
    }
}
Also used : Resources(android.content.res.Resources) PreferenceFrameLayout(android.preference.PreferenceFrameLayout)

Aggregations

PreferenceFrameLayout (android.preference.PreferenceFrameLayout)39 View (android.view.View)30 Resources (android.content.res.Resources)11 FragmentTransaction (android.app.FragmentTransaction)7 Context (android.content.Context)7 PagerTabStrip (android.support.v4.view.PagerTabStrip)7 ViewGroup (android.view.ViewGroup)7 AbsListView (android.widget.AbsListView)7 AdapterView (android.widget.AdapterView)7 ListView (android.widget.ListView)7 SubtitleView (com.android.internal.widget.SubtitleView)7 StorageStatsSource (com.android.settingslib.applications.StorageStatsSource)7 TextView (android.widget.TextView)6 Bundle (android.os.Bundle)4 ViewPager (android.support.v4.view.ViewPager)4 Pair (android.util.Pair)4 TypedValue (android.util.TypedValue)4 ArrayList (java.util.ArrayList)4 TypedArray (android.content.res.TypedArray)3 FragmentTransaction (androidx.fragment.app.FragmentTransaction)2