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();
}
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);
}
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;
}
Aggregations