Search in sources :

Example 96 with Bundle

use of android.os.Bundle in project PhotoPicker by donglua.

the class PhotoPickerFragment method newInstance.

public static PhotoPickerFragment newInstance(boolean showCamera, boolean showGif, boolean previewEnable, int column, int maxCount, ArrayList<String> originalPhotos) {
    Bundle args = new Bundle();
    args.putBoolean(EXTRA_CAMERA, showCamera);
    args.putBoolean(EXTRA_GIF, showGif);
    args.putBoolean(EXTRA_PREVIEW_ENABLED, previewEnable);
    args.putInt(EXTRA_COLUMN, column);
    args.putInt(EXTRA_COUNT, maxCount);
    args.putStringArrayList(EXTRA_ORIGIN, originalPhotos);
    PhotoPickerFragment fragment = new PhotoPickerFragment();
    fragment.setArguments(args);
    return fragment;
}
Also used : Bundle(android.os.Bundle)

Example 97 with Bundle

use of android.os.Bundle in project NumberProgressBar by daimajia.

the class NumberProgressBar method onSaveInstanceState.

@Override
protected Parcelable onSaveInstanceState() {
    final Bundle bundle = new Bundle();
    bundle.putParcelable(INSTANCE_STATE, super.onSaveInstanceState());
    bundle.putInt(INSTANCE_TEXT_COLOR, getTextColor());
    bundle.putFloat(INSTANCE_TEXT_SIZE, getProgressTextSize());
    bundle.putFloat(INSTANCE_REACHED_BAR_HEIGHT, getReachedBarHeight());
    bundle.putFloat(INSTANCE_UNREACHED_BAR_HEIGHT, getUnreachedBarHeight());
    bundle.putInt(INSTANCE_REACHED_BAR_COLOR, getReachedBarColor());
    bundle.putInt(INSTANCE_UNREACHED_BAR_COLOR, getUnreachedBarColor());
    bundle.putInt(INSTANCE_MAX, getMax());
    bundle.putInt(INSTANCE_PROGRESS, getProgress());
    bundle.putString(INSTANCE_SUFFIX, getSuffix());
    bundle.putString(INSTANCE_PREFIX, getPrefix());
    bundle.putBoolean(INSTANCE_TEXT_VISIBILITY, getProgressTextVisibility());
    return bundle;
}
Also used : Bundle(android.os.Bundle)

Example 98 with Bundle

use of android.os.Bundle in project NumberProgressBar by daimajia.

the class NumberProgressBar method onRestoreInstanceState.

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        final Bundle bundle = (Bundle) state;
        mTextColor = bundle.getInt(INSTANCE_TEXT_COLOR);
        mTextSize = bundle.getFloat(INSTANCE_TEXT_SIZE);
        mReachedBarHeight = bundle.getFloat(INSTANCE_REACHED_BAR_HEIGHT);
        mUnreachedBarHeight = bundle.getFloat(INSTANCE_UNREACHED_BAR_HEIGHT);
        mReachedBarColor = bundle.getInt(INSTANCE_REACHED_BAR_COLOR);
        mUnreachedBarColor = bundle.getInt(INSTANCE_UNREACHED_BAR_COLOR);
        initializePainters();
        setMax(bundle.getInt(INSTANCE_MAX));
        setProgress(bundle.getInt(INSTANCE_PROGRESS));
        setPrefix(bundle.getString(INSTANCE_PREFIX));
        setSuffix(bundle.getString(INSTANCE_SUFFIX));
        setProgressTextVisibility(bundle.getBoolean(INSTANCE_TEXT_VISIBILITY) ? Visible : Invisible);
        super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
        return;
    }
    super.onRestoreInstanceState(state);
}
Also used : Bundle(android.os.Bundle)

Example 99 with Bundle

use of android.os.Bundle in project UltimateAndroid by cymcsg.

the class ItemSelectionSupport method onSaveInstanceState.

public Bundle onSaveInstanceState() {
    final Bundle state = new Bundle();
    state.putInt(STATE_KEY_CHOICE_MODE, mChoiceMode.ordinal());
    state.putParcelable(STATE_KEY_CHECKED_STATES, mCheckedStates);
    state.putParcelable(STATE_KEY_CHECKED_ID_STATES, mCheckedIdStates);
    state.putInt(STATE_KEY_CHECKED_COUNT, mCheckedCount);
    return state;
}
Also used : Bundle(android.os.Bundle)

Example 100 with Bundle

use of android.os.Bundle in project UltimateAndroid by cymcsg.

the class TwoWayLayoutManager method onLayoutChildren.

@Override
public void onLayoutChildren(Recycler recycler, State state) {
    final ItemSelectionSupport itemSelection = ItemSelectionSupport.from(mRecyclerView);
    if (itemSelection != null) {
        final Bundle itemSelectionState = getPendingItemSelectionState();
        if (itemSelectionState != null) {
            itemSelection.onRestoreInstanceState(itemSelectionState);
        }
        if (state.didStructureChange()) {
            itemSelection.onAdapterDataChanged();
        }
    }
    final int anchorItemPosition = getAnchorItemPosition(state);
    detachAndScrapAttachedViews(recycler);
    fillSpecific(anchorItemPosition, recycler, state);
    onLayoutScrapList(recycler, state);
    setPendingScrollPositionWithOffset(RecyclerView.NO_POSITION, 0);
    mPendingSavedState = null;
}
Also used : Bundle(android.os.Bundle)

Aggregations

Bundle (android.os.Bundle)6155 Intent (android.content.Intent)826 RemoteException (android.os.RemoteException)477 View (android.view.View)342 Test (org.junit.Test)266 ArrayList (java.util.ArrayList)216 TextView (android.widget.TextView)203 PersistableBundle (android.os.PersistableBundle)201 PendingIntent (android.app.PendingIntent)185 IOException (java.io.IOException)176 Uri (android.net.Uri)155 ImageView (android.widget.ImageView)152 ComponentName (android.content.ComponentName)124 Fragment (android.support.v4.app.Fragment)124 Message (android.os.Message)122 JSONObject (org.json.JSONObject)112 Account (android.accounts.Account)108 Context (android.content.Context)102 Parcelable (android.os.Parcelable)99 Bitmap (android.graphics.Bitmap)90