Java Code Examples for android.os.Parcel.createIntArray()

The following are Jave code examples for showing how to use createIntArray() of the android.os.Parcel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: DateTimePicker   File: Utils.java   Source Code and License Vote up 6 votes
public static boolean colorHasState(ColorStateList color, int state) {
    Parcel parcel = Parcel.obtain();
    color.writeToParcel(parcel, 0);

    // hack from ColorStateList.hasState(...)
    final int specCount = parcel.readInt();
    for (int specIndex = 0; specIndex < specCount; specIndex++) {
        final int[] states = parcel.createIntArray();
        final int stateCount = states.length;
        for (int stateIndex = 0; stateIndex < stateCount; stateIndex++) {
            if (states[stateIndex] == state || states[stateIndex] == ~state) {
                return true;
            }
        }
    }
    return false;

    // this is not good because it will return true only if the said 'state' is the only selector on the color
    // int[] states = new int[]{state};
    // return color.getColorForState(states, Integer.MIN_VALUE) != Integer.MIN_VALUE && color.getColorForState(states, Integer.MAX_VALUE) != Integer.MAX_VALUE;
}
 
Example 2
Project: Watermark   File: Configuration.java   Source Code and License Vote up 6 votes
protected Configuration(Parcel in) {
    image = in.readByte() != 0;
    selectedList = in.createTypedArrayList(MediaBean.CREATOR);
    radio = in.readByte() != 0;
    crop = in.readByte() != 0;
    maxSize = in.readInt();
    hideBottomControls = in.readByte() != 0;
    compressionQuality = in.readInt();
    gestures = in.createIntArray();
    maxBitmapSize = in.readInt();
    maxScaleMultiplier = in.readFloat();
    aspectRatioX = in.readFloat();
    aspectRatioY = in.readFloat();
    selectedByDefault = in.readInt();
    aspectRatio = in.createTypedArray(AspectRatio.CREATOR);
    freestyleCropEnabled = in.readByte() != 0;
    ovalDimmedLayer = in.readByte() != 0;
    maxResultWidth = in.readInt();
    maxResultHeight = in.readInt();
    imageLoaderType = in.readInt();
    imageConfig = in.readInt();
    hideCamera = in.readByte() != 0;
    isPlayGif = in.readByte() != 0;
    hidePreview = in.readByte() != 0;
    isVideoPreview = in.readByte() != 0;
}
 
Example 3
Project: SimpleDialogFragments   File: Input.java   Source Code and License Vote up 6 votes
private Input(Parcel in) {
    super(in);
    hint = in.readString();
    hintResourceId = in.readInt();
    text = in.readString();
    textResourceId = in.readInt();
    inputType = in.readInt();
    maxLength = in.readInt();
    minLength = in.readInt();
    suggestionArrayRes = in.readInt();
    suggestionStringResArray = in.createIntArray();
    suggestions = in.createStringArray();
    passwordToggleVisible = in.readByte() != 0;
    forceSuggestion = in.readByte() != 0;
    pattern = in.readString();
    patternError = in.readString();
    patternErrorId = in.readInt();
}
 
Example 4
Project: Pocket-Plays-for-Twitch   File: StreamInfo.java   Source Code and License Vote up 6 votes
public StreamInfo(Parcel in) {
	String[] stringsData = in.createStringArray();
	int[] intData = in.createIntArray();

	if (stringsData.length == 2) {
		this.game = stringsData[0];
		this.title = stringsData[1];
	}

	if (intData.length == 2) {
		this.currentViewers = intData[0];
		this.priority = intData[1];
	}

	this.startedAt = in.readLong();
	this.previews =in.createStringArray();
	this.channelInfo = in.readParcelable(StreamInfo.class.getClassLoader());
}
 
Example 5
Project: data-mediator   File: HistoryData.java   Source Code and License Vote up 6 votes
protected HistoryData(Parcel in) {
    this.age = in.readInt();
    this.id = in.readLong();
    this.testShort = (short) in.readInt();
    this.testByte = in.readByte();
    this.testBoolean = in.readByte() != 0;
    this.testFloat = in.readFloat();
    this.testDouble = in.readDouble();
    this.testChar = (char) in.readInt();
    this.testLONG = (Long) in.readValue(Long.class.getClassLoader());
    this.testDOUBLE = (Double) in.readValue(Double.class.getClassLoader());
    this.testCharacter = (Character) in.readSerializable();
    this.testBOOLEAN = (Boolean) in.readValue(Boolean.class.getClassLoader());
    this.testSHORT = (Short) in.readValue(Short.class.getClassLoader());
    this.name = in.readString();
    this.data = in.readParcelable(ResultData.class.getClassLoader());
    this.datas = in.createTypedArrayList(ResultData.CREATOR);
    this.testArrayResultData = in.createTypedArray(ResultData.CREATOR);
    this.testArrayInt = in.createIntArray();
    this.testArrayInteger = (Integer[]) in.readArray(Integer[].class.getClassLoader());
}
 
Example 6
Project: AndroidShareElement   File: ShareElementInfo.java   Source Code and License Vote up 6 votes
protected ShareElementInfo(Parcel in) {
    mOriginalLocation = in.createIntArray();
    mTargetLocation = in.createIntArray();
    mOriginalValues = in.createFloatArray();
    mTargetValues = in.createFloatArray();
    mOriginalWidth = in.readInt();
    mOriginalHeight = in.readInt();
    mTargetWidth = in.readInt();
    mTargetHeight = in.readInt();
    mOriginalViewWidth = in.readInt();
    mOriginalViewHeight = in.readInt();
    mTargetViewWidth = in.readInt();
    mTargetViewHeight = in.readInt();
    mCenterOffsetX = in.readInt();
    mCenterOffsetY = in.readInt();
    mScaleX = in.readFloat();
    mScaleY = in.readFloat();
    mPivotX = in.readFloat();
    mPivotY = in.readFloat();
}
 
Example 7
Project: Phoenix-for-VK   File: BaseOption.java   Source Code and License Vote up 5 votes
protected BaseOption(Parcel in) {
    optionType = in.readInt();
    key = in.readInt();
    active = in.readByte() != 0;
    title = in.readInt();
    parentDependencyKey = in.readInt();
    childDependencies = in.createIntArray();
}
 
Example 8
Project: letv   File: BackStackState.java   Source Code and License Vote up 5 votes
public BackStackState(Parcel in) {
    this.mOps = in.createIntArray();
    this.mTransition = in.readInt();
    this.mTransitionStyle = in.readInt();
    this.mName = in.readString();
    this.mIndex = in.readInt();
    this.mBreadCrumbTitleRes = in.readInt();
    this.mBreadCrumbTitleText = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
    this.mBreadCrumbShortTitleRes = in.readInt();
    this.mBreadCrumbShortTitleText = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
    this.mSharedElementSourceNames = in.createStringArrayList();
    this.mSharedElementTargetNames = in.createStringArrayList();
}
 
Example 9
Project: FontProvider   File: FontInfo.java   Source Code and License Vote up 5 votes
private FontInfo(Parcel in) {
    this.name = in.readString();
    this.variant = in.readString();
    this.language = in.createStringArray();
    this.ttc_index = in.createIntArray();
    this.size = in.readString();
    this.preview_text = in.createStringArray();
    this.url_prefix = in.readString();
    this.style = in.createTypedArray(Style.CREATOR);
}
 
Example 10
Project: chaosflix   File: Stream.java   Source Code and License Vote up 5 votes
protected Stream(Parcel in) {
	slug = in.readString();
	display = in.readString();
	type = in.readString();
	isTranslated = in.readByte() != 0;
	videoSize = in.createIntArray();
	int mapSize = in.readInt();
	urls = new HashMap<>();
	for(int i = 0; i< mapSize; i++){
		urls.put(in.readString(),in.readParcelable(StreamUrl.class.getClassLoader()));
	}
}
 
Example 11
Project: iosched-reader   File: TagFilterHolder.java   Source Code and License Vote up 5 votes
public TagFilterHolder createFromParcel(Parcel in) {
    TagFilterHolder holder = new TagFilterHolder();

    String[] filters = in.createStringArray();
    in.readStringArray(filters);
    Collections.addAll(holder.mSelectedFilters, filters);

    int[] categories = in.createIntArray();
    in.readIntArray(categories);
    System.arraycopy(categories, 0, holder.mCategories, 0, categories.length);

    holder.mShowLiveStreamedSessions = in.readInt() == 1;

    return holder;
}
 
Example 12
Project: SimpleDialogFragments   File: Spinner.java   Source Code and License Vote up 5 votes
protected Spinner(Parcel in) {
    super(in);
    itemArrayRes = in.readInt();
    itemStringResArray = in.createIntArray();
    items = in.createStringArray();
    text = in.readString();
    textResourceId = in.readInt();
    placeholder = in.readString();
    placeholderResourceId = in.readInt();
    position = in.readInt();
}
 
Example 13
Project: boohee_v5.6   File: BackStackState.java   Source Code and License Vote up 5 votes
public BackStackState(Parcel in) {
    this.mOps = in.createIntArray();
    this.mTransition = in.readInt();
    this.mTransitionStyle = in.readInt();
    this.mName = in.readString();
    this.mIndex = in.readInt();
    this.mBreadCrumbTitleRes = in.readInt();
    this.mBreadCrumbTitleText = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
    this.mBreadCrumbShortTitleRes = in.readInt();
    this.mBreadCrumbShortTitleText = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
    this.mSharedElementSourceNames = in.createStringArrayList();
    this.mSharedElementTargetNames = in.createStringArrayList();
}
 
Example 14
Project: Veggietizer   File: Achievement.java   Source Code and License Vote up 5 votes
private Achievement(Parcel in) {
    String[] strings = in.createStringArray();
    int[] ints = in.createIntArray();

    description = strings[0];
    heading = strings[1];
    shareText = strings[2];
    iconLockedID = ints[0];
    iconUnlockedID = ints[1];
    criterion = in.readParcelable(Criterion.class.getClassLoader());
}
 
Example 15
Project: FullSizePopupSpinner   File: FullSizePopupSpinner.java   Source Code and License Vote up 4 votes
private SavedState(@NonNull Parcel in) {
    super(in);
    this.mItemsTextsResIds = in.createIntArray();
    mSelectedItemPosition = in.readInt();
    mItemsIconsResIds = in.createIntArray();
}
 
Example 16
Project: letv   File: FragmentManagerState.java   Source Code and License Vote up 4 votes
public FragmentManagerState(Parcel in) {
    this.mActive = (FragmentState[]) in.createTypedArray(FragmentState.CREATOR);
    this.mAdded = in.createIntArray();
    this.mBackStack = (BackStackState[]) in.createTypedArray(BackStackState.CREATOR);
}
 
Example 17
Project: FontProvider   File: FontRequests.java   Source Code and License Vote up 4 votes
protected FontRequests(Parcel in) {
    this.weight = in.createIntArray();
    this.requests = in.createTypedArray(FontRequest.CREATOR);
}
 
Example 18
Project: NumberPadTimePicker   File: NumberPadTimePicker.java   Source Code and License Vote up 4 votes
private SavedState(Parcel in) {
    super(in);
    mNptpState = new NumberPadTimePickerState(in.createIntArray(),
            in.readInt(), in.readInt());
}
 
Example 19
Project: AndProx   File: TuneResult.java   Source Code and License Vote up 4 votes
protected TuneResult(Parcel in) {
    graphData = in.createIntArray();
}
 
Example 20
Project: boohee_v5.6   File: FragmentManagerState.java   Source Code and License Vote up 4 votes
public FragmentManagerState(Parcel in) {
    this.mActive = (FragmentState[]) in.createTypedArray(FragmentState.CREATOR);
    this.mAdded = in.createIntArray();
    this.mBackStack = (BackStackState[]) in.createTypedArray(BackStackState.CREATOR);
}