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