Search in sources :

Example 26 with SettingsActivity

use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class CaptionPropertiesFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    final boolean enabled = mCaptioningManager.isEnabled();
    SettingsActivity activity = (SettingsActivity) getActivity();
    mSwitchBar = activity.getSwitchBar();
    mSwitchBar.setCheckedInternal(enabled);
    mToggleSwitch = mSwitchBar.getSwitch();
    getPreferenceScreen().setEnabled(enabled);
    refreshPreviewText();
    installSwitchBarToggleSwitch();
}
Also used : SettingsActivity(com.android.settings.SettingsActivity)

Example 27 with SettingsActivity

use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DashboardSummary method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    long startTime = System.currentTimeMillis();
    super.onCreate(savedInstanceState);
    List<DashboardCategory> categories = ((SettingsActivity) getActivity()).getDashboardCategories();
    mSummaryLoader = new SummaryLoader(getActivity(), categories);
    Context context = getContext();
    mConditionManager = ConditionManager.get(context, false);
    mSuggestionParser = new SuggestionParser(context, context.getSharedPreferences(SUGGESTIONS, 0), R.xml.suggestion_ordering);
    mSuggestionsChecks = new SuggestionsChecks(getContext());
    if (savedInstanceState == null) {
        mSuggestionsShownLogged = new ArrayList<>();
        mSuggestionsHiddenLogged = new ArrayList<>();
    } else {
        mSuggestionsShownLogged = savedInstanceState.getStringArrayList(EXTRA_SUGGESTION_SHOWN_LOGGED);
        mSuggestionsHiddenLogged = savedInstanceState.getStringArrayList(EXTRA_SUGGESTION_HIDDEN_LOGGED);
    }
    if (DEBUG_TIMING)
        Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime) + " ms");
    final Resources res = context.getResources();
    mNumColumns = res.getInteger(R.integer.dashboard_num_columns);
}
Also used : DashboardCategory(com.android.settingslib.drawer.DashboardCategory) Context(android.content.Context) SuggestionParser(com.android.settingslib.SuggestionParser) Resources(android.content.res.Resources) SettingsActivity(com.android.settings.SettingsActivity)

Example 28 with SettingsActivity

use of com.android.settings.SettingsActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DashboardContainerFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    final View content = inflater.inflate(R.layout.dashboard_container, parent, false);
    mViewPager = (RtlCompatibleViewPager) content.findViewById(R.id.pager);
    mPagerAdapter = new DashboardViewPagerAdapter(getContext(), getChildFragmentManager(), mViewPager);
    mViewPager.setAdapter(mPagerAdapter);
    mViewPager.addOnPageChangeListener(new TabChangeListener((SettingsActivity) getActivity()));
    // check if support tab needs to be selected
    final String selectedTab = getArguments().getString(EXTRA_SELECT_SETTINGS_TAB, ARG_SUMMARY_TAB);
    if (TextUtils.equals(selectedTab, ARG_SUPPORT_TAB)) {
        mViewPager.setCurrentItem(INDEX_SUPPORT_FRAGMENT);
    } else {
        mViewPager.setCurrentItem(INDEX_SUMMARY_FRAGMENT);
    }
    mHeaderView = inflater.inflate(R.layout.dashboard_container_header, parent, false);
    ((SlidingTabLayout) mHeaderView).setViewPager(mViewPager);
    return content;
}
Also used : SlidingTabLayout(com.android.settings.widget.SlidingTabLayout) View(android.view.View) SettingsActivity(com.android.settings.SettingsActivity)

Aggregations

SettingsActivity (com.android.settings.SettingsActivity)28 Bundle (android.os.Bundle)10 Intent (android.content.Intent)4 TextView (android.widget.TextView)4 ContentResolver (android.content.ContentResolver)3 View (android.view.View)3 AdapterView (android.widget.AdapterView)2 ImageView (android.widget.ImageView)2 ListView (android.widget.ListView)2 SearchView (android.widget.SearchView)2 LinkifyUtils (com.android.settings.LinkifyUtils)2 FragmentTransaction (android.app.FragmentTransaction)1 ComponentName (android.content.ComponentName)1 Context (android.content.Context)1 DialogInterface (android.content.DialogInterface)1 SendIntentException (android.content.IntentSender.SendIntentException)1 SharedPreferences (android.content.SharedPreferences)1 UserInfo (android.content.pm.UserInfo)1 Resources (android.content.res.Resources)1 Cursor (android.database.Cursor)1