Example usage for android.os Bundle putIntegerArrayList

List of usage examples for android.os Bundle putIntegerArrayList

Introduction

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

Prototype

@Override
public void putIntegerArrayList(@Nullable String key, @Nullable ArrayList<Integer> value) 

Source Link

Document

Inserts an ArrayList value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.customdatepicker.time.TimePickerDialog.java

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
    if (mTimePicker != null) {
        outState.putParcelable(KEY_INITIAL_TIME, mTimePicker.getTime());
        outState.putBoolean(KEY_IS_24_HOUR_VIEW, mIs24HourMode);
        outState.putInt(KEY_CURRENT_ITEM_SHOWING, mTimePicker.getCurrentItemShowing());
        outState.putBoolean(KEY_IN_KB_MODE, mInKbMode);
        if (mInKbMode) {
            outState.putIntegerArrayList(KEY_TYPED_TIMES, mTypedTimes);
        }/*w w  w  . j  a v  a 2s . com*/
        outState.putString(KEY_TITLE, mTitle);
        outState.putBoolean(KEY_THEME_DARK, mThemeDark);
        outState.putBoolean(KEY_THEME_DARK_CHANGED, mThemeDarkChanged);
        outState.putInt(KEY_ACCENT, mAccentColor);
        outState.putBoolean(KEY_VIBRATE, mVibrate);
        outState.putBoolean(KEY_DISMISS, mDismissOnPause);
        outState.putParcelableArray(KEY_SELECTABLE_TIMES, mSelectableTimes);
        outState.putParcelable(KEY_MIN_TIME, mMinTime);
        outState.putParcelable(KEY_MAX_TIME, mMaxTime);
        outState.putBoolean(KEY_ENABLE_SECONDS, mEnableSeconds);
        outState.putBoolean(KEY_ENABLE_MINUTES, mEnableMinutes);
        outState.putInt(KEY_OK_RESID, mOkResid);
        outState.putString(KEY_OK_STRING, mOkString);
        outState.putInt(KEY_OK_COLOR, mOkColor);
        outState.putInt(KEY_CANCEL_RESID, mCancelResid);
        outState.putString(KEY_CANCEL_STRING, mCancelString);
        outState.putInt(KEY_CANCEL_COLOR, mCancelColor);
        outState.putSerializable(KEY_VERSION, mVersion);
    }
}

From source file:com.amaze.filemanager.fragments.Main.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    int index;/*w  w w.  j ava  2s.c  om*/
    View vi;
    if (listView != null) {
        if (IS_LIST) {

            index = (mLayoutManager).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        } else {
            index = (mLayoutManagerGrid).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        }
        int top = (vi == null) ? 0 : vi.getTop();
        outState.putInt("index", index);
        outState.putInt("top", top);
        outState.putBoolean("IS_LIST", IS_LIST);
        outState.putParcelableArrayList("list", LIST_ELEMENTS);
        outState.putString("CURRENT_PATH", CURRENT_PATH);
        outState.putBoolean("selection", selection);
        outState.putInt("openMode", openMode);
        outState.putInt("folder_count", folder_count);
        outState.putInt("file_count", file_count);
        if (selection) {
            outState.putIntegerArrayList("position", adapter.getCheckedItemPositions());
        }
        outState.putBoolean("results", results);
        outState.putParcelable("adapter", adapter);
        if (openMode == 1) {
            outState.putString("SmbPath", smbPath);
        }
    }
}

From source file:nu.yona.timepicker.time.TimePickerDialog.java

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
    if (mTimePicker != null) {
        outState.putParcelable(KEY_INITIAL_TIME, mTimePicker.getTime());
        outState.putBoolean(KEY_IS_24_HOUR_VIEW, mIs24HourMode);
        outState.putInt(KEY_CURRENT_ITEM_SHOWING, mTimePicker.getCurrentItemShowing());
        outState.putBoolean(KEY_IN_KB_MODE, mInKbMode);
        if (mInKbMode) {
            outState.putIntegerArrayList(KEY_TYPED_TIMES, mTypedTimes);
        }//www  .  jav  a 2  s.c o m
        outState.putString(KEY_TITLE, mTitle);
        outState.putBoolean(KEY_THEME_DARK, mThemeDark);
        outState.putBoolean(KEY_THEME_DARK_CHANGED, mThemeDarkChanged);
        outState.putInt(KEY_ACCENT, mAccentColor);
        outState.putBoolean(KEY_VIBRATE, mVibrate);
        outState.putBoolean(KEY_DISMISS, mDismissOnPause);
        outState.putParcelableArray(KEY_SELECTABLE_TIMES, mSelectableTimes);
        outState.putParcelable(KEY_MIN_TIME, mMinTime);
        outState.putParcelable(KEY_MAX_TIME, mMaxTime);
        outState.putBoolean(KEY_ENABLE_SECONDS, mEnableSeconds);
        outState.putInt(KEY_OK_RESID, mOkResid);
        outState.putString(KEY_OK_STRING, mOkString);
        outState.putInt(KEY_CANCEL_RESID, mCancelResid);
        outState.putString(KEY_CANCEL_STRING, mCancelString);
    }

    if (mTimePickerEnd != null) {
        //Todo for second time picker when needed
    }
}

From source file:com.filemanager.free.fragments.Main.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    int index;/*from  w  w  w  . j  av a 2s .  c  om*/
    View vi;
    if (listView != null) {
        if (IS_LIST) {
            index = (mLayoutManager).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        } else {
            index = (mLayoutManagerGrid).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        }
        int top = (vi == null) ? 0 : vi.getTop();
        outState.putInt("index", index);
        outState.putInt("top", top);
        outState.putBoolean("IS_LIST", IS_LIST);
        outState.putParcelableArrayList("list", LIST_ELEMENTS);
        outState.putString("CURRENT_PATH", CURRENT_PATH);
        outState.putBoolean("selection", selection);
        outState.putInt("openMode", openMode);
        outState.putInt("folder_count", folder_count);
        outState.putInt("file_count", file_count);
        if (selection) {
            outState.putIntegerArrayList("position", adapter.getCheckedItemPositions());
        }
        outState.putBoolean("results", results);

        if (openMode == 1) {
            outState.putString("SmbPath", smbPath);
        }
    }
}

From source file:com.igniva.filemanager.fragments.Main.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    int index;//  w  w w.  ja v  a  2 s  .  c  o m
    View vi;
    if (listView != null) {
        if (IS_LIST) {

            index = (mLayoutManager).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        } else {
            index = (mLayoutManagerGrid).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        }
        int top = (vi == null) ? 0 : vi.getTop();
        outState.putInt("index", index);
        outState.putInt("top", top);
        //outState.putBoolean("IS_LIST", IS_LIST);
        outState.putParcelableArrayList("list", LIST_ELEMENTS);
        outState.putString("CURRENT_PATH", CURRENT_PATH);
        outState.putBoolean("selection", selection);
        outState.putInt("openMode", openMode);
        outState.putInt("folder_count", folder_count);
        outState.putInt("file_count", file_count);
        if (selection) {
            outState.putIntegerArrayList("position", adapter.getCheckedItemPositions());
        }
        outState.putBoolean("results", results);
        if (openMode == 1) {
            outState.putString("SmbPath", smbPath);
        }
    }
}

From source file:com.amaze.filemanager.fragments.MainFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    int index;/*from  ww w .  ja  v  a 2  s .  c  o m*/
    View vi;
    if (listView != null) {
        if (IS_LIST) {
            index = (mLayoutManager).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        } else {
            index = (mLayoutManagerGrid).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        }

        int top = (vi == null) ? 0 : vi.getTop();

        outState.putInt("index", index);
        outState.putInt("top", top);
        outState.putParcelableArrayList("list", LIST_ELEMENTS);
        outState.putString("CURRENT_PATH", CURRENT_PATH);
        outState.putBoolean("selection", selection);
        outState.putInt("openMode", openMode.ordinal());
        outState.putInt("folder_count", folder_count);
        outState.putInt("file_count", file_count);

        if (selection) {
            outState.putIntegerArrayList("position", adapter.getCheckedItemsIndex());
        }

        outState.putBoolean("results", results);

        if (openMode == OpenMode.SMB) {
            outState.putString("SmbPath", smbPath);
        }
    }
}

From source file:com.amaze.carbonfilemanager.fragments.MainFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    int index;// www. ja  va2 s  .  co m
    View vi;
    if (listView != null) {
        if (IS_LIST) {
            index = (mLayoutManager).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        } else {
            index = (mLayoutManagerGrid).findFirstVisibleItemPosition();
            vi = listView.getChildAt(0);
        }

        int top = (vi == null) ? 0 : vi.getTop();

        outState.putInt("index", index);
        outState.putInt("top", top);
        //outState.putBoolean("IS_LIST", IS_LIST);
        outState.putParcelableArrayList("list", getLayoutElements());
        outState.putString("CURRENT_PATH", CURRENT_PATH);
        outState.putBoolean("selection", selection);
        outState.putInt("openMode", openMode.ordinal());
        outState.putInt("folder_count", folder_count);
        outState.putInt("file_count", file_count);

        if (selection) {
            outState.putIntegerArrayList("position", adapter.getCheckedItemPositions());
        }

        outState.putBoolean("results", results);

        if (openMode == OpenMode.SMB) {
            outState.putString("SmbPath", smbPath);
        }
    }
}

From source file:com.xandy.calendar.EventInfoFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putLong(BUNDLE_KEY_EVENT_ID, mEventId);
    outState.putLong(BUNDLE_KEY_START_MILLIS, mStartMillis);
    outState.putLong(BUNDLE_KEY_END_MILLIS, mEndMillis);
    outState.putBoolean(BUNDLE_KEY_IS_DIALOG, mIsDialog);
    outState.putInt(BUNDLE_KEY_WINDOW_STYLE, mWindowStyle);
    outState.putBoolean(BUNDLE_KEY_DELETE_DIALOG_VISIBLE, mDeleteDialogVisible);
    outState.putInt(BUNDLE_KEY_CALENDAR_COLOR, mCalendarColor);
    outState.putBoolean(BUNDLE_KEY_CALENDAR_COLOR_INIT, mCalendarColorInitialized);
    outState.putInt(BUNDLE_KEY_ORIGINAL_COLOR, mOriginalColor);
    outState.putBoolean(BUNDLE_KEY_ORIGINAL_COLOR_INIT, mOriginalColorInitialized);
    outState.putInt(BUNDLE_KEY_CURRENT_COLOR, mCurrentColor);
    outState.putBoolean(BUNDLE_KEY_CURRENT_COLOR_INIT, mCurrentColorInitialized);
    outState.putInt(BUNDLE_KEY_CURRENT_COLOR_KEY, mCurrentColorKey);

    // We'll need the temporary response for configuration changes.
    outState.putInt(BUNDLE_KEY_TENTATIVE_USER_RESPONSE, mTentativeUserSetResponse);
    if (mTentativeUserSetResponse != Attendees.ATTENDEE_STATUS_NONE && mEditResponseHelper != null) {
        outState.putInt(BUNDLE_KEY_RESPONSE_WHICH_EVENTS, mEditResponseHelper.getWhichEvents());
    }//from w  w  w .j av a2s  .co  m

    // Save the current response.
    int response;
    if (mAttendeeResponseFromIntent != Attendees.ATTENDEE_STATUS_NONE) {
        response = mAttendeeResponseFromIntent;
    } else {
        response = mOriginalAttendeeResponse;
    }
    outState.putInt(BUNDLE_KEY_ATTENDEE_RESPONSE, response);
    if (mUserSetResponse != Attendees.ATTENDEE_STATUS_NONE) {
        response = mUserSetResponse;
        outState.putInt(BUNDLE_KEY_USER_SET_ATTENDEE_RESPONSE, response);
        outState.putInt(BUNDLE_KEY_RESPONSE_WHICH_EVENTS, mWhichEvents);
    }

    // Save the reminders.
    mReminders = EventViewUtils.reminderItemsToReminders(mReminderViews, mReminderMinuteValues,
            mReminderMethodValues);
    int numReminders = mReminders.size();
    ArrayList<Integer> reminderMinutes = new ArrayList<Integer>(numReminders);
    ArrayList<Integer> reminderMethods = new ArrayList<Integer>(numReminders);
    for (CalendarEventModel.ReminderEntry reminder : mReminders) {
        reminderMinutes.add(reminder.getMinutes());
        reminderMethods.add(reminder.getMethod());
    }
    outState.putIntegerArrayList(BUNDLE_KEY_REMINDER_MINUTES, reminderMinutes);
    outState.putIntegerArrayList(BUNDLE_KEY_REMINDER_METHODS, reminderMethods);
}

From source file:com.android.calendar.EventInfoFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putLong(BUNDLE_KEY_EVENT_ID, mEventId);
    outState.putLong(BUNDLE_KEY_START_MILLIS, mStartMillis);
    outState.putLong(BUNDLE_KEY_END_MILLIS, mEndMillis);
    outState.putBoolean(BUNDLE_KEY_IS_DIALOG, mIsDialog);
    outState.putInt(BUNDLE_KEY_WINDOW_STYLE, mWindowStyle);
    outState.putBoolean(BUNDLE_KEY_DELETE_DIALOG_VISIBLE, mDeleteDialogVisible);
    outState.putInt(BUNDLE_KEY_CALENDAR_COLOR, mCalendarColor);
    outState.putBoolean(BUNDLE_KEY_CALENDAR_COLOR_INIT, mCalendarColorInitialized);
    outState.putInt(BUNDLE_KEY_ORIGINAL_COLOR, mOriginalColor);
    outState.putBoolean(BUNDLE_KEY_ORIGINAL_COLOR_INIT, mOriginalColorInitialized);
    outState.putInt(BUNDLE_KEY_CURRENT_COLOR, mCurrentColor);
    outState.putBoolean(BUNDLE_KEY_CURRENT_COLOR_INIT, mCurrentColorInitialized);
    outState.putInt(BUNDLE_KEY_CURRENT_COLOR_KEY, mCurrentColorKey);
    outState.putInt(BUNDLE_KEY_DELETE_DIALOG_CHOICE, mDeleteDialogChoice);

    // We'll need the temporary response for configuration changes.
    outState.putInt(BUNDLE_KEY_TENTATIVE_USER_RESPONSE, mTentativeUserSetResponse);
    if (mTentativeUserSetResponse != Attendees.ATTENDEE_STATUS_NONE && mEditResponseHelper != null) {
        outState.putInt(BUNDLE_KEY_RESPONSE_WHICH_EVENTS, mEditResponseHelper.getWhichEvents());
    }/*w  w w.j ava2 s  .  c o m*/

    // Save the current response.
    int response;
    if (mAttendeeResponseFromIntent != Attendees.ATTENDEE_STATUS_NONE) {
        response = mAttendeeResponseFromIntent;
    } else {
        response = mOriginalAttendeeResponse;
    }
    outState.putInt(BUNDLE_KEY_ATTENDEE_RESPONSE, response);
    if (mUserSetResponse != Attendees.ATTENDEE_STATUS_NONE) {
        response = mUserSetResponse;
        outState.putInt(BUNDLE_KEY_USER_SET_ATTENDEE_RESPONSE, response);
        outState.putInt(BUNDLE_KEY_RESPONSE_WHICH_EVENTS, mWhichEvents);
    }

    // Save the reminders.
    mReminders = EventViewUtils.reminderItemsToReminders(mReminderViews, mReminderMinuteValues,
            mReminderMethodValues);
    int numReminders = mReminders.size();
    ArrayList<Integer> reminderMinutes = new ArrayList<Integer>(numReminders);
    ArrayList<Integer> reminderMethods = new ArrayList<Integer>(numReminders);
    for (ReminderEntry reminder : mReminders) {
        reminderMinutes.add(reminder.getMinutes());
        reminderMethods.add(reminder.getMethod());
    }
    outState.putIntegerArrayList(BUNDLE_KEY_REMINDER_MINUTES, reminderMinutes);
    outState.putIntegerArrayList(BUNDLE_KEY_REMINDER_METHODS, reminderMethods);
}