Search in sources :

Example 1 with PreferenceFrameLayout

use of android.preference.PreferenceFrameLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ManageApplications method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // initialize the inflater
    mInflater = inflater;
    mRootView = inflater.inflate(R.layout.manage_applications_apps, null);
    mLoadingContainer = mRootView.findViewById(R.id.loading_container);
    mLoadingContainer.setVisibility(View.VISIBLE);
    mListContainer = mRootView.findViewById(R.id.list_container);
    if (mListContainer != null) {
        // Create adapter and list view here
        View emptyView = mListContainer.findViewById(com.android.internal.R.id.empty);
        ListView lv = (ListView) mListContainer.findViewById(android.R.id.list);
        if (emptyView != null) {
            lv.setEmptyView(emptyView);
        }
        lv.setOnItemClickListener(this);
        lv.setSaveEnabled(true);
        lv.setItemsCanFocus(true);
        lv.setTextFilterEnabled(true);
        mListView = lv;
        mApplications = new ApplicationsAdapter(mApplicationsState, this, mFilter);
        if (savedInstanceState != null) {
            mApplications.mHasReceivedLoadEntries = savedInstanceState.getBoolean(EXTRA_HAS_ENTRIES, false);
            mApplications.mHasReceivedBridgeCallback = savedInstanceState.getBoolean(EXTRA_HAS_BRIDGE, false);
        }
        mListView.setAdapter(mApplications);
        mListView.setRecyclerListener(mApplications);
        mListView.setFastScrollEnabled(isFastScrollEnabled());
        Utils.prepareCustomPreferencesList(container, mRootView, mListView, false);
    }
    // only when the view is added.
    if (container instanceof PreferenceFrameLayout) {
        ((PreferenceFrameLayout.LayoutParams) mRootView.getLayoutParams()).removeBorders = true;
    }
    createHeader();
    mResetAppsHelper.onRestoreInstanceState(savedInstanceState);
    return mRootView;
}
Also used : ListView(android.widget.ListView) AbsListView(android.widget.AbsListView) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView)

Example 2 with PreferenceFrameLayout

use of android.preference.PreferenceFrameLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.

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 3 with PreferenceFrameLayout

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

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 4 with PreferenceFrameLayout

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

the class AppOpsSummary method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // initialize the inflater
    mInflater = inflater;
    View rootView = mInflater.inflate(R.layout.app_ops_summary, container, false);
    mContentContainer = container;
    mRootView = rootView;
    CharSequence[] pageNames = getResources().getTextArray(R.array.app_ops_categories_lineage);
    AppOpsState.OpsTemplate[] templates = AppOpsState.ALL_PERMS_TEMPLATES;
    assert (pageNames.length == templates.length);
    int specificTab = -1;
    Bundle bundle = getArguments();
    if (bundle != null) {
        specificTab = Arrays.asList(pageNames).indexOf(bundle.getString("appops_tab", ""));
    }
    List<Pair<CharSequence, AppOpsState.OpsTemplate>> pageData = new ArrayList<>();
    for (int i = 0; i < pageNames.length; i++) {
        pageData.add(Pair.create(pageNames[i], templates[i]));
    }
    filterPageData(pageData, specificTab);
    mViewPager = (ViewPager) rootView.findViewById(R.id.pager);
    mAdapter = new MyPagerAdapter(getChildFragmentManager(), pageData);
    mViewPager.setAdapter(mAdapter);
    mViewPager.setOnPageChangeListener(mAdapter);
    PagerTabStrip tabs = (PagerTabStrip) rootView.findViewById(R.id.tabs);
    // HACK - https://code.google.com/p/android/issues/detail?id=213359
    ((ViewPager.LayoutParams) tabs.getLayoutParams()).isDecor = true;
    Resources.Theme theme = tabs.getContext().getTheme();
    TypedValue typedValue = new TypedValue();
    theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
    final int colorAccent = getContext().getColor(typedValue.resourceId);
    tabs.setTabIndicatorColor(colorAccent);
    // only when the view is added.
    if (container instanceof PreferenceFrameLayout) {
        ((PreferenceFrameLayout.LayoutParams) rootView.getLayoutParams()).removeBorders = true;
    }
    mActivity = getActivity();
    return rootView;
}
Also used : Bundle(android.os.Bundle) ArrayList(java.util.ArrayList) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) View(android.view.View) ViewPager(android.support.v4.view.ViewPager) Resources(android.content.res.Resources) PagerTabStrip(android.support.v4.view.PagerTabStrip) Pair(android.util.Pair) TypedValue(android.util.TypedValue)

Example 5 with PreferenceFrameLayout

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

the class ManageApplications method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // initialize the inflater
    mInflater = inflater;
    mRootView = inflater.inflate(R.layout.manage_applications_apps, null);
    mLoadingContainer = mRootView.findViewById(R.id.loading_container);
    mListContainer = mRootView.findViewById(R.id.list_container);
    if (mListContainer != null) {
        // Create adapter and list view here
        View emptyView = mListContainer.findViewById(com.android.internal.R.id.empty);
        ListView lv = (ListView) mListContainer.findViewById(android.R.id.list);
        if (emptyView != null) {
            lv.setEmptyView(emptyView);
        }
        lv.setOnItemClickListener(this);
        lv.setSaveEnabled(true);
        lv.setItemsCanFocus(true);
        lv.setTextFilterEnabled(true);
        mListView = lv;
        mApplications = new ApplicationsAdapter(mApplicationsState, this, mFilter);
        if (savedInstanceState != null) {
            mApplications.mHasReceivedLoadEntries = savedInstanceState.getBoolean(EXTRA_HAS_ENTRIES, false);
            mApplications.mHasReceivedBridgeCallback = savedInstanceState.getBoolean(EXTRA_HAS_BRIDGE, false);
        }
        int userId = mIsWorkOnly ? mWorkUserId : UserHandle.getUserId(mCurrentUid);
        if (mStorageType == STORAGE_TYPE_MUSIC) {
            Context context = getContext();
            mApplications.setExtraViewController(new MusicViewHolderController(context, new StorageStatsSource(context), mVolumeUuid, UserHandle.of(userId)));
        } else if (mStorageType == STORAGE_TYPE_PHOTOS_VIDEOS) {
            Context context = getContext();
            mApplications.setExtraViewController(new PhotosViewHolderController(context, new StorageStatsSource(context), mVolumeUuid, UserHandle.of(userId)));
        }
        mListView.setAdapter(mApplications);
        mListView.setRecyclerListener(mApplications);
        mListView.setFastScrollEnabled(isFastScrollEnabled());
        Utils.prepareCustomPreferencesList(container, mRootView, mListView, false);
    }
    // only when the view is added.
    if (container instanceof PreferenceFrameLayout) {
        ((PreferenceFrameLayout.LayoutParams) mRootView.getLayoutParams()).removeBorders = true;
    }
    createHeader();
    mResetAppsHelper.onRestoreInstanceState(savedInstanceState);
    return mRootView;
}
Also used : Context(android.content.Context) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView) StorageStatsSource(com.android.settingslib.applications.StorageStatsSource) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView)

Aggregations

PreferenceFrameLayout (android.preference.PreferenceFrameLayout)37 View (android.view.View)29 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)1