public GuidedStepSupportFragment() { // We need to supply the theme before any potential call to onInflate in order // for the defaulting to work properly. mTheme = onProvideTheme(); mGuidanceStylist = onCreateGuidanceStylist(); mActionsStylist = onCreateActionsStylist(); onProvideFragmentTransitions(); }
/** * Set UI style to fragment arguments, UI style cannot be changed after initialization. * * @param style {@link #UI_STYLE_ACTIVITY_ROOT} {@link #UI_STYLE_DEFAULT} or {@link * #UI_STYLE_ENTRANCE}. */ public void setUiStyle(int style) { int oldStyle = getUiStyle(); Bundle arguments = getArguments(); if (arguments == null) { arguments = new Bundle(); } arguments.putInt(EXTRA_UI_STYLE, style); // call setArgument() will validate if the fragment is already added. setArguments(arguments); if (style != oldStyle) { onProvideFragmentTransitions(); } }
/** {@inheritDoc} */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (DEBUG) Log.v(TAG, "onCreate"); // Set correct transition from saved arguments. onProvideFragmentTransitions(); Bundle state = (savedInstanceState != null) ? savedInstanceState : getArguments(); if (state != null) { if (mSelectedIndex == -1) { mSelectedIndex = state.getInt(EXTRA_ACTION_SELECTED_INDEX, -1); } } mActions.clear(); onCreateActions(mActions, savedInstanceState); }