Example usage for android.os Bundle putAll

List of usage examples for android.os Bundle putAll

Introduction

In this page you can find the example usage for android.os Bundle putAll.

Prototype

public void putAll(Bundle bundle) 

Source Link

Document

Inserts all mappings from the given Bundle into this Bundle.

Usage

From source file:de.vanita5.twittnuker.fragment.support.UserProfileFragment.java

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setHasOptionsMenu(true);//  w  w  w.  jav  a2  s .co m
    mPreferences = getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
    getSharedPreferences(USER_COLOR_PREFERENCES_NAME, Context.MODE_PRIVATE)
            .registerOnSharedPreferenceChangeListener(this);
    getSharedPreferences(USER_NICKNAME_PREFERENCES_NAME, Context.MODE_PRIVATE)
            .registerOnSharedPreferenceChangeListener(this);
    mLocale = getResources().getConfiguration().locale;
    final Bundle args = getArguments();
    long accountId = -1, userId = -1;
    String screenName = null;
    if (savedInstanceState != null) {
        args.putAll(savedInstanceState);
    } else {
        accountId = args.getLong(EXTRA_ACCOUNT_ID, -1);
        userId = args.getLong(EXTRA_USER_ID, -1);
        screenName = args.getString(EXTRA_SCREEN_NAME);
    }
    mProfileImageLoader = getApplication().getImageLoaderWrapper();
    mAdapter = new ListActionAdapter(getActivity());
    mProfileImageView.setOnClickListener(this);
    mProfileBannerView.setOnClickListener(this);
    mTweetsContainer.setOnClickListener(this);
    mFollowersContainer.setOnClickListener(this);
    mFriendsContainer.setOnClickListener(this);
    mRetryButton.setOnClickListener(this);
    setListAdapter(null);
    mListView = getListView();
    mListView.addHeaderView(mHeaderView, null, false);
    mListView.setOnItemClickListener(this);
    mListView.setOnItemLongClickListener(this);

    mMenuBar.setVisibility(shouldUseNativeMenu() ? View.GONE : View.VISIBLE);
    mMenuBar.inflate(R.menu.menu_user_profile);
    mMenuBar.setIsBottomBar(true);
    mMenuBar.setOnMenuItemClickListener(this);

    mProfileBannerSpace.setOnTouchListener(this);

    setListAdapter(mAdapter);
    getUserInfo(accountId, userId, screenName, false);
}

From source file:com.brandroidtools.filemanager.activities.NavigationActivity.java

/**
 * Method that verifies the intent passed to the activity, and checks
 * if a request is made like Search.// w  ww . j a  v a2 s  . c om
 *
 * @param intent The intent to check
 * @hide
 */
void checkIntent(Intent intent) {
    //Search action
    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
        Intent searchIntent = new Intent(this, SearchActivity.class);
        searchIntent.setAction(Intent.ACTION_SEARCH);
        //- SearchActivity.EXTRA_SEARCH_DIRECTORY
        searchIntent.putExtra(SearchActivity.EXTRA_SEARCH_DIRECTORY,
                getCurrentNavigationFragment().getCurrentDir());
        //- SearchManager.APP_DATA
        if (intent.getBundleExtra(SearchManager.APP_DATA) != null) {
            Bundle bundle = new Bundle();
            bundle.putAll(intent.getBundleExtra(SearchManager.APP_DATA));
            searchIntent.putExtra(SearchManager.APP_DATA, bundle);
        }
        //-- SearchManager.QUERY
        String query = intent.getStringExtra(SearchManager.QUERY);
        if (query != null) {
            searchIntent.putExtra(SearchManager.QUERY, query);
        }
        //- android.speech.RecognizerIntent.EXTRA_RESULTS
        ArrayList<String> extraResults = intent
                .getStringArrayListExtra(android.speech.RecognizerIntent.EXTRA_RESULTS);
        if (extraResults != null) {
            searchIntent.putStringArrayListExtra(android.speech.RecognizerIntent.EXTRA_RESULTS, extraResults);
        }
        startActivityForResult(searchIntent, INTENT_REQUEST_SEARCH);
        return;
    }

    // Navigate to the requested path
    String navigateTo = intent.getStringExtra(EXTRA_NAVIGATE_TO);
    if (navigateTo != null && navigateTo.length() >= 0) {
        getCurrentNavigationFragment().changeCurrentDir(navigateTo);
    }
}

From source file:br.com.indigo.android.facebook.SocialFacebook.java

public void publish(final Activity activity, final FbSimplePost post, final String pageId,
        final NewObjectListener listener) {

    if (!mFacebook.isSessionValid()) {

        login(activity, new SimpleRequestListener() {

            public void onFail(Throwable thr) {
                listener.onFail(thr);//from ww w . jav  a  2  s .  c  om
            }

            public void onCancel() {
                listener.onCancel();
            }

            public void onComplete() {
                publish(activity, post, pageId, listener);
            }
        });
    } else {

        final FbTextDialog dialog = new FbTextDialog(activity);
        dialog.setTitle(R.string.dialog_post_to_wall_title);
        dialog.setPlaceHolder(R.string.dialog_post_to_wall_placeholder);

        dialog.setDialogListener(new DialogListener() {

            public void onComplete(Bundle values) {

                final ProgressDialog spinner = new ProgressDialog(activity);
                spinner.setMessage(spinner.getContext().getString(R.string.loading));
                spinner.setCancelable(false);
                spinner.show();

                Bundle params = paramsForPost(post);
                params.putAll(values);

                facebookRequest(activity, pageId + "/feed", params, "POST", true, new RequestAdapter() {

                    public void onFail(Throwable thr, Object state) {
                        listener.onFail(thr);
                        spinner.dismiss();
                        dialog.dismiss();
                    }

                    public void onComplete(JSONObject jsonResponse, Object state) {
                        listener.onComplete(jsonResponse.optString("id"));
                        spinner.dismiss();
                        dialog.dismiss();
                    }

                    public void onCancel() {
                        listener.onCancel();
                        spinner.dismiss();
                        dialog.dismiss();
                    }
                });
            }

            public void onFacebookError(FacebookError e) {
                listener.onFail(e);
            }

            public void onError(DialogError e) {
                listener.onFail(e);
            }

            public void onCancel() {
                listener.onCancel();
            }
        });

        dialog.show();
    }
}

From source file:com.todoroo.astrid.activity.TaskListActivity.java

/**
 * @see android.app.Activity#onCreate(Bundle)
 *///from ww  w .j  ava 2s .  c o m
@Override
protected void onCreate(Bundle savedInstanceState) {
    ThemeService.applyTheme(this);
    super.onCreate(savedInstanceState);
    DependencyInjectionService.getInstance().inject(this);

    int contentView = getContentView();
    if (contentView == R.layout.task_list_wrapper_activity)
        swipeEnabled = true;
    setContentView(contentView);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
    actionBar.setCustomView(getHeaderView());

    listsNav = actionBar.getCustomView().findViewById(R.id.lists_nav);
    listsNavDisclosure = (ImageView) actionBar.getCustomView().findViewById(R.id.list_disclosure_arrow);
    lists = (TextView) actionBar.getCustomView().findViewById(R.id.list_title);
    mainMenu = (ImageView) actionBar.getCustomView().findViewById(R.id.main_menu);
    personStatus = (TextView) actionBar.getCustomView().findViewById(R.id.person_image);
    commentsButton = (Button) actionBar.getCustomView().findViewById(R.id.comments);
    if (ThemeService.getTheme() == R.style.Theme_White_Alt)
        commentsButton.setTextColor(getResources().getColor(R.color.blue_theme_color));

    initializeFragments(actionBar);
    createMainMenuPopover();
    mainMenu.setOnClickListener(mainMenuClickListener);
    commentsButton.setOnClickListener(commentsButtonClickListener);
    personStatus.setOnClickListener(friendStatusClickListener);

    Bundle extras = getIntent().getExtras();
    if (extras != null)
        extras = (Bundle) extras.clone();

    if (extras == null)
        extras = new Bundle();

    Filter savedFilter = getIntent().getParcelableExtra(TaskListFragment.TOKEN_FILTER);
    if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
        String query = getIntent().getStringExtra(SearchManager.QUERY).trim();
        String title = getString(R.string.FLA_search_filter, query);
        savedFilter = new Filter(title, title, new QueryTemplate().where(Task.TITLE.like("%" + //$NON-NLS-1$
                query + "%")), //$NON-NLS-1$
                null);
    }

    if (savedFilter == null) {
        savedFilter = getDefaultFilter();
        extras.putAll(configureIntentAndExtrasWithFilter(getIntent(), savedFilter));
    }

    extras.putParcelable(TaskListFragment.TOKEN_FILTER, savedFilter);

    if (swipeIsEnabled()) {
        setupPagerAdapter();
    }

    setupTasklistFragmentWithFilter(savedFilter, extras);

    if (savedFilter != null)
        setListsTitle(savedFilter.title);

    if (getIntent().hasExtra(TOKEN_SOURCE)) {
        trackActivitySource();
    }

    // Have to call this here because sometimes StartupService
    // isn't called (i.e. if the app was silently alive in the background)
    abTestEventReportingService.trackUserRetention(this);
}

From source file:org.getlantern.firetweet.fragment.support.UserFragment.java

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    final FragmentActivity activity = getActivity();
    setHasOptionsMenu(true);//from   w  ww  .  j  a va 2  s. c  o m
    getSharedPreferences(USER_COLOR_PREFERENCES_NAME, Context.MODE_PRIVATE)
            .registerOnSharedPreferenceChangeListener(this);
    getSharedPreferences(USER_NICKNAME_PREFERENCES_NAME, Context.MODE_PRIVATE)
            .registerOnSharedPreferenceChangeListener(this);
    mLocale = getResources().getConfiguration().locale;
    mCardBackgroundColor = ThemeUtils.getCardBackgroundColor(activity);
    mProfileImageLoader = getApplication().getMediaLoaderWrapper();
    final Bundle args = getArguments();
    long accountId = -1, userId = -1;
    String screenName = null;
    if (savedInstanceState != null) {
        args.putAll(savedInstanceState);
    } else {
        accountId = args.getLong(EXTRA_ACCOUNT_ID, -1);
        userId = args.getLong(EXTRA_USER_ID, -1);
        screenName = args.getString(EXTRA_SCREEN_NAME);
    }

    Utils.setNdefPushMessageCallback(activity, new CreateNdefMessageCallback() {

        @Override
        public NdefMessage createNdefMessage(NfcEvent event) {
            final ParcelableUser user = getUser();
            if (user == null)
                return null;
            return new NdefMessage(new NdefRecord[] {
                    NdefRecord.createUri(LinkCreator.getTwitterUserLink(user.screen_name)), });
        }
    });

    activity.setEnterSharedElementCallback(new SharedElementCallback() {

        @Override
        public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements,
                List<View> sharedElementSnapshots) {
            final int idx = sharedElementNames.indexOf(TRANSITION_NAME_PROFILE_IMAGE);
            if (idx != -1) {
                final View view = sharedElements.get(idx);
                int[] location = new int[2];
                final RectF bounds = new RectF(0, 0, view.getWidth(), view.getHeight());
                view.getLocationOnScreen(location);
                bounds.offsetTo(location[0], location[1]);
                mProfileImageView.setTransitionSource(bounds);
            }
            super.onSharedElementStart(sharedElementNames, sharedElements, sharedElementSnapshots);
        }

        @Override
        public void onSharedElementEnd(List<String> sharedElementNames, List<View> sharedElements,
                List<View> sharedElementSnapshots) {
            int idx = sharedElementNames.indexOf(TRANSITION_NAME_PROFILE_IMAGE);
            if (idx != -1) {
                final View view = sharedElements.get(idx);
                int[] location = new int[2];
                final RectF bounds = new RectF(0, 0, view.getWidth(), view.getHeight());
                view.getLocationOnScreen(location);
                bounds.offsetTo(location[0], location[1]);
                mProfileImageView.setTransitionDestination(bounds);
            }
            super.onSharedElementEnd(sharedElementNames, sharedElements, sharedElementSnapshots);
        }

    });

    ViewCompat.setTransitionName(mProfileImageView, TRANSITION_NAME_PROFILE_IMAGE);
    ViewCompat.setTransitionName(mProfileTypeView, TRANSITION_NAME_PROFILE_TYPE);
    //        ViewCompat.setTransitionName(mCardView, TRANSITION_NAME_CARD);

    mHeaderDrawerLayout.setDrawerCallback(this);

    mPagerAdapter = new SupportTabsAdapter(activity, getChildFragmentManager());

    mViewPager.setOffscreenPageLimit(3);
    mViewPager.setAdapter(mPagerAdapter);
    mPagerIndicator.setViewPager(mViewPager);
    mPagerIndicator.setTabDisplayOption(TabPagerIndicator.LABEL);

    mFollowButton.setOnClickListener(this);
    mProfileImageView.setOnClickListener(this);
    mProfileBannerView.setOnClickListener(this);
    mListedContainer.setOnClickListener(this);
    mFollowersContainer.setOnClickListener(this);
    mFriendsContainer.setOnClickListener(this);
    mRetryButton.setOnClickListener(this);
    mProfileBannerView.setOnSizeChangedListener(this);
    mProfileBannerSpace.setOnTouchListener(this);

    mProfileNameBackground.setBackgroundColor(mCardBackgroundColor);
    mProfileDetailsContainer.setBackgroundColor(mCardBackgroundColor);
    mPagerIndicator.setBackgroundColor(mCardBackgroundColor);
    mUuckyFooter.setBackgroundColor(mCardBackgroundColor);

    getUserInfo(accountId, userId, screenName, false);

    final float actionBarElevation = ThemeUtils.getSupportActionBarElevation(activity);
    ViewCompat.setElevation(mPagerIndicator, actionBarElevation);

    setupBaseActionBar();

    setupUserPages();
}

From source file:org.mariotaku.twidere.fragment.support.UserFragment.java

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    final FragmentActivity activity = getActivity();
    setHasOptionsMenu(true);/*  www. j  a v a 2s.c o m*/
    getSharedPreferences(USER_COLOR_PREFERENCES_NAME, Context.MODE_PRIVATE)
            .registerOnSharedPreferenceChangeListener(this);
    getSharedPreferences(USER_NICKNAME_PREFERENCES_NAME, Context.MODE_PRIVATE)
            .registerOnSharedPreferenceChangeListener(this);
    mUserColorNameManager = UserColorNameManager.getInstance(activity);
    mPreferences = SharedPreferencesWrapper.getInstance(activity, SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE,
            SharedPreferenceConstants.class);
    mNameFirst = mPreferences.getBoolean(KEY_NAME_FIRST);
    mLocale = getResources().getConfiguration().locale;
    mCardBackgroundColor = ThemeUtils.getCardBackgroundColor(activity,
            ThemeUtils.getThemeBackgroundOption(activity), ThemeUtils.getUserThemeBackgroundAlpha(activity));
    mActionBarShadowColor = 0xA0000000;
    final TwidereApplication app = TwidereApplication.getInstance(activity);
    mProfileImageLoader = app.getMediaLoaderWrapper();
    final Bundle args = getArguments();
    long accountId = -1, userId = -1;
    String screenName = null;
    if (savedInstanceState != null) {
        args.putAll(savedInstanceState);
    } else {
        accountId = args.getLong(EXTRA_ACCOUNT_ID, -1);
        userId = args.getLong(EXTRA_USER_ID, -1);
        screenName = args.getString(EXTRA_SCREEN_NAME);
    }

    Utils.setNdefPushMessageCallback(activity, new CreateNdefMessageCallback() {

        @Override
        public NdefMessage createNdefMessage(NfcEvent event) {
            final ParcelableUser user = getUser();
            if (user == null)
                return null;
            return new NdefMessage(new NdefRecord[] {
                    NdefRecord.createUri(LinkCreator.getTwitterUserLink(user.screen_name)), });
        }
    });

    activity.setEnterSharedElementCallback(new SharedElementCallback() {

        @Override
        public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements,
                List<View> sharedElementSnapshots) {
            final int idx = sharedElementNames.indexOf(TRANSITION_NAME_PROFILE_IMAGE);
            if (idx != -1) {
                final View view = sharedElements.get(idx);
                int[] location = new int[2];
                final RectF bounds = new RectF(0, 0, view.getWidth(), view.getHeight());
                view.getLocationOnScreen(location);
                bounds.offsetTo(location[0], location[1]);
                mProfileImageView.setTransitionSource(bounds);
            }
            super.onSharedElementStart(sharedElementNames, sharedElements, sharedElementSnapshots);
        }

        @Override
        public void onSharedElementEnd(List<String> sharedElementNames, List<View> sharedElements,
                List<View> sharedElementSnapshots) {
            int idx = sharedElementNames.indexOf(TRANSITION_NAME_PROFILE_IMAGE);
            if (idx != -1) {
                final View view = sharedElements.get(idx);
                int[] location = new int[2];
                final RectF bounds = new RectF(0, 0, view.getWidth(), view.getHeight());
                view.getLocationOnScreen(location);
                bounds.offsetTo(location[0], location[1]);
                mProfileImageView.setTransitionDestination(bounds);
            }
            super.onSharedElementEnd(sharedElementNames, sharedElements, sharedElementSnapshots);
        }

    });

    ViewCompat.setTransitionName(mProfileImageView, TRANSITION_NAME_PROFILE_IMAGE);
    ViewCompat.setTransitionName(mProfileTypeView, TRANSITION_NAME_PROFILE_TYPE);
    //        ViewCompat.setTransitionName(mCardView, TRANSITION_NAME_CARD);

    mHeaderDrawerLayout.setDrawerCallback(this);

    mPagerAdapter = new SupportTabsAdapter(activity, getChildFragmentManager());

    mViewPager.setOffscreenPageLimit(3);
    mViewPager.setAdapter(mPagerAdapter);
    mPagerIndicator.setViewPager(mViewPager);
    mPagerIndicator.setTabDisplayOption(TabPagerIndicator.LABEL);
    mPagerIndicator.setOnPageChangeListener(this);

    mFollowButton.setOnClickListener(this);
    mProfileImageView.setOnClickListener(this);
    mProfileBannerView.setOnClickListener(this);
    mListedContainer.setOnClickListener(this);
    mFollowersContainer.setOnClickListener(this);
    mFriendsContainer.setOnClickListener(this);
    mHeaderErrorIcon.setOnClickListener(this);
    mProfileBannerView.setOnSizeChangedListener(this);
    mProfileBannerSpace.setOnTouchListener(this);

    mProfileNameBackground.setBackgroundColor(mCardBackgroundColor);
    mProfileDetailsContainer.setBackgroundColor(mCardBackgroundColor);
    mPagerIndicator.setBackgroundColor(mCardBackgroundColor);
    mUuckyFooter.setBackgroundColor(mCardBackgroundColor);

    final float actionBarElevation = ThemeUtils.getSupportActionBarElevation(activity);
    ViewCompat.setElevation(mPagerIndicator, actionBarElevation);

    if (activity instanceof IThemedActivity) {
        ViewSupport.setBackground(mPagerOverlay, ThemeUtils.getNormalWindowContentOverlay(activity,
                ((IThemedActivity) activity).getCurrentThemeResourceId()));
        ViewSupport.setBackground(mErrorOverlay, ThemeUtils.getNormalWindowContentOverlay(activity,
                ((IThemedActivity) activity).getCurrentThemeResourceId()));
    }

    setupBaseActionBar();
    setupUserPages();
    if (activity instanceof IThemedActivity) {
        setUiColor(((IThemedActivity) activity).getCurrentThemeColor());
    }

    getUserInfo(accountId, userId, screenName, false);
}

From source file:com.vegnab.vegnab.MainVNActivity.java

@Override
public void onEditPlaceholder(Bundle argsIn) {
    // swap EditPlaceholderFragment in place of existing fragment
    if (LDebug.ON)
        Log.d(LOG_TAG, "About to go to Placeholder");
    Bundle argsOut = new Bundle();
    argsOut.putAll(argsIn); // if the bundle info can be passed right through
    EditPlaceholderFragment phFrag = EditPlaceholderFragment.newInstance(argsOut);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    // put the present fragment on the backstack so the user can navigate back to it
    // the tag is for the fragment now being added, not the one replaced
    transaction.replace(R.id.fragment_container, phFrag, Tags.EDIT_PLACEHOLDER);
    transaction.addToBackStack(null);/*from ww  w . ja v  a 2s .  c o m*/
    transaction.commit();
}

From source file:org.mariotaku.twidere.fragment.UserFragment.java

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    final FragmentActivity activity = getActivity();
    mUserColorNameManager.registerColorChangedListener(this);
    mUserColorNameManager.registerNicknameChangedListener(this);
    mNameFirst = mPreferences.getBoolean(KEY_NAME_FIRST);
    mLocale = getResources().getConfiguration().locale;
    mCardBackgroundColor = ThemeUtils.getCardBackgroundColor(activity,
            ThemeUtils.getThemeBackgroundOption(activity), ThemeUtils.getUserThemeBackgroundAlpha(activity));
    mActionBarShadowColor = 0xA0000000;// w  ww .j  a v  a2 s  .c o m
    final Bundle args = getArguments();
    UserKey accountId = null;
    UserKey userId = null;
    String screenName = null;
    if (savedInstanceState != null) {
        args.putAll(savedInstanceState);
    } else {
        accountId = args.getParcelable(EXTRA_ACCOUNT_KEY);
        userId = args.getParcelable(EXTRA_USER_KEY);
        screenName = args.getString(EXTRA_SCREEN_NAME);
    }

    Utils.setNdefPushMessageCallback(activity, new CreateNdefMessageCallback() {

        @Override
        public NdefMessage createNdefMessage(NfcEvent event) {
            final ParcelableUser user = getUser();
            if (user == null)
                return null;
            return new NdefMessage(
                    new NdefRecord[] { NdefRecord.createUri(LinkCreator.getUserWebLink(user)), });
        }
    });

    mTintedStatusFrameLayout.setWindowInsetsListener(new TintedStatusFrameLayout.WindowInsetsListener() {
        @Override
        public void onApplyWindowInsets(int left, int top, int right, int bottom) {
            mProfileContentContainer.setPadding(0, top, 0, 0);
            mProfileBannerSpace.setStatusBarHeight(top);

            if (mProfileBannerSpace.getToolbarHeight() == 0) {
                int toolbarHeight = mToolbar.getMeasuredHeight();
                if (toolbarHeight == 0) {
                    toolbarHeight = ThemeUtils.getActionBarHeight(getContext());
                }
                mProfileBannerSpace.setToolbarHeight(toolbarHeight);
            }
        }

    });
    mProfileContentContainer.setOnSizeChangedListener(new OnSizeChangedListener() {
        @Override
        public void onSizeChanged(View view, int w, int h, int oldw, int oldh) {
            final int toolbarHeight = mToolbar.getMeasuredHeight();
            mHeaderDrawerLayout.setPadding(0, toolbarHeight, 0, 0);
            mProfileBannerSpace.setToolbarHeight(toolbarHeight);
        }
    });

    mHeaderDrawerLayout.setDrawerCallback(this);

    mPagerAdapter = new SupportTabsAdapter(activity, getChildFragmentManager());

    mViewPager.setOffscreenPageLimit(3);
    mViewPager.setAdapter(mPagerAdapter);
    mPagerIndicator.setViewPager(mViewPager);
    mPagerIndicator.setTabDisplayOption(TabPagerIndicator.LABEL);
    mPagerIndicator.setOnPageChangeListener(this);

    mFollowButton.setOnClickListener(this);
    mProfileImageView.setOnClickListener(this);
    mProfileBannerView.setOnClickListener(this);
    mListedContainer.setOnClickListener(this);
    mGroupsContainer.setOnClickListener(this);
    mFollowersContainer.setOnClickListener(this);
    mFriendsContainer.setOnClickListener(this);
    mHeaderErrorIcon.setOnClickListener(this);
    mProfileBirthdayBannerView.setOnClickListener(this);
    mProfileBannerView.setOnSizeChangedListener(this);
    mProfileBannerSpace.setOnTouchListener(this);

    mProfileNameBackground.setBackgroundColor(mCardBackgroundColor);
    mProfileDetailsContainer.setBackgroundColor(mCardBackgroundColor);
    mPagerIndicator.setBackgroundColor(mCardBackgroundColor);

    final float actionBarElevation = ThemeUtils.getSupportActionBarElevation(activity);
    ViewCompat.setElevation(mPagerIndicator, actionBarElevation);

    setupBaseActionBar();
    setupUserPages();

    getUserInfo(accountId, userId, screenName, false);
}

From source file:de.mrapp.android.preference.activity.PreferenceActivity.java

/**
 * Shows the fragment, which corresponds to a specific preference header.
 *
 * @param preferenceHeader//from   ww w . j a  va  2 s. com
 *         The preference header, the fragment, which should be shown, corresponds to, as an
 *         instance of the class {@link PreferenceHeader}. The preference header may not be
 *         null
 * @param parameters
 *         The parameters, which should be passed to the fragment, as an instance of the class
 *         {@link Bundle} or null, if the preference header's extras should be used instead
 * @param forceTransition
 *         True, if instantiating a new fragment should be enforced, even if a fragment instance
 *         of the same class is already shown, false otherwise. Must be true for transitions,
 *         which have been initiated manually by the user in order to support using the same
 *         fragment class for multiple preference headers
 */
private void showPreferenceScreen(@NonNull final PreferenceHeader preferenceHeader,
        @Nullable final Bundle parameters, final boolean forceTransition) {
    if (parameters != null && preferenceHeader.getExtras() != null) {
        parameters.putAll(preferenceHeader.getExtras());
    }

    showPreferenceScreen(preferenceHeader, parameters, true, forceTransition);
}

From source file:de.mrapp.android.preference.activity.PreferenceActivity.java

/**
 * Notifies all registered listeners that the user wants to navigate to the next step of the
 * wizard./*from   w w  w. ja v a  2s.co  m*/
 *
 * @return A bundle, which may contain key-value pairs, which have been acquired in the wizard,
 * if navigating to the next step of the wizard should be allowed, as an instance of the class
 * {@link Bundle}, null otherwise
 */
private Bundle notifyOnNextStep() {
    Bundle result = null;

    for (WizardListener listener : wizardListeners) {
        Bundle bundle = listener.onNextStep(getListAdapter().indexOf(currentHeader), currentHeader,
                preferenceScreenFragment, currentBundle);

        if (bundle != null) {
            if (result == null) {
                result = new Bundle();
            }

            result.putAll(bundle);
        }
    }

    return result;
}