当前位置: 首页>>代码示例>>Java>>正文


Java ViewCompat.MEASURED_SIZE_MASK属性代码示例

本文整理汇总了Java中android.support.v4.view.ViewCompat.MEASURED_SIZE_MASK属性的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.MEASURED_SIZE_MASK属性的具体用法?Java ViewCompat.MEASURED_SIZE_MASK怎么用?Java ViewCompat.MEASURED_SIZE_MASK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.support.v4.view.ViewCompat的用法示例。


在下文中一共展示了ViewCompat.MEASURED_SIZE_MASK属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dimChildView

private void dimChildView(View v, float mag, int fadeColor) {
    LayoutParams lp = (LayoutParams) v.getLayoutParams();
    if (mag > 0.0f && fadeColor != 0) {
        int color = (((int) (((float) ((-16777216 & fadeColor) >>> 24)) * mag)) << 24) | (ViewCompat.MEASURED_SIZE_MASK & fadeColor);
        if (lp.dimPaint == null) {
            lp.dimPaint = new Paint();
        }
        lp.dimPaint.setColorFilter(new PorterDuffColorFilter(color, Mode.SRC_OVER));
        if (ViewCompat.getLayerType(v) != 2) {
            ViewCompat.setLayerType(v, 2, lp.dimPaint);
        }
        invalidateChildRegion(v);
    } else if (ViewCompat.getLayerType(v) != 0) {
        if (lp.dimPaint != null) {
            lp.dimPaint.setColorFilter(null);
        }
        DisableLayerRunnable dlr = new DisableLayerRunnable(v);
        this.mPostedRunnables.add(dlr);
        ViewCompat.postOnAnimation(this, dlr);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:21,代码来源:SlidingPaneLayout.java

示例2: isBlackBitmap

public static boolean isBlackBitmap(Bitmap bitmap) throws Throwable {
    if (bitmap == null || bitmap.isRecycled()) {
        return true;
    }
    boolean z;
    int[] iArr = new int[(bitmap.getWidth() * bitmap.getHeight())];
    bitmap.getPixels(iArr, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
    for (int i : iArr) {
        if ((i & ViewCompat.MEASURED_SIZE_MASK) != 0) {
            z = true;
            break;
        }
    }
    z = false;
    return !z;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:16,代码来源:BitmapHelper.java

示例3: readSettings

private void readSettings(Handler handler, int flags, int length) throws IOException {
    boolean clearPrevious = true;
    int numberOfEntries = this.source.readInt();
    if (length != (numberOfEntries * 8) + 4) {
        throw ioException("TYPE_SETTINGS length: %d != 4 + 8 * %d", Integer.valueOf
                (length), Integer.valueOf(numberOfEntries));
    }
    Settings settings = new Settings();
    for (int i = 0; i < numberOfEntries; i++) {
        int w1 = this.source.readInt();
        int id = w1 & ViewCompat.MEASURED_SIZE_MASK;
        settings.set(id, (-16777216 & w1) >>> 24, this.source.readInt());
    }
    if ((flags & 1) == 0) {
        clearPrevious = false;
    }
    handler.settings(clearPrevious, settings);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:Spdy3.java

示例4: mixColors

public static int mixColors(int fromColor, int toColor, float toAlpha) {
    float[] fromCmyk = cmykFromRgb(fromColor);
    float[] toCmyk = cmykFromRgb(toColor);
    float[] result = new float[4];
    for (int i = 0; i < 4; i++) {
        result[i] = Math.min(1.0f, (fromCmyk[i] * (1.0f - toAlpha)) + (toCmyk[i] * toAlpha));
    }
    return -16777216 + (ViewCompat.MEASURED_SIZE_MASK & rgbFromCmyk(result));
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:9,代码来源:ScrollUtils.java

示例5: setAlphaComponent

@ColorInt
public static int setAlphaComponent(@ColorInt int color, @IntRange(from = 0, to = 255) int alpha) {
    if (alpha >= 0 && alpha <= 255) {
        return (ViewCompat.MEASURED_SIZE_MASK & color) | (alpha << 24);
    }
    throw new IllegalArgumentException("alpha must be between 0 and 255.");
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:7,代码来源:ColorUtils.java

示例6: drawScrim

private void drawScrim(Canvas canvas, View child) {
    int color = (((int) (((float) ((this.mScrimColor & -16777216) >>> 24)) * this
            .mScrimOpacity)) << 24) | (this.mScrimColor & ViewCompat.MEASURED_SIZE_MASK);
    if ((this.mTrackingEdge & 1) != 0) {
        canvas.clipRect(0, 0, child.getLeft(), getHeight());
    } else if ((this.mTrackingEdge & 2) != 0) {
        canvas.clipRect(child.getRight(), 0, getRight(), getHeight());
    } else if ((this.mTrackingEdge & 8) != 0) {
        canvas.clipRect(child.getLeft(), child.getBottom(), getRight(), getHeight());
    }
    canvas.drawColor(color);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:SwipeBackLayout.java

示例7: getAlphaColor

private int getAlphaColor(int color, int alpha) {
    if (alpha < 0) {
        alpha = 0;
    }
    if (alpha > 255) {
        alpha = 255;
    }
    return (ViewCompat.MEASURED_SIZE_MASK & color) | (alpha << 24);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:AnimCheckBox.java

示例8: a

public static synchronized void a(int i, int i2) {
    synchronized (g.class) {
        if (i2 < ViewCompat.MEASURED_SIZE_MASK) {
            a.a.put(Integer.valueOf((i << 24) | i2), Long.valueOf(System.currentTimeMillis()));
        } else {
            com.xiaomi.channel.commonutils.logger.b.d("stats key should less than 16777215");
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:g.java

示例9: getColorWithAlpha

public static int getColorWithAlpha(float alpha, int baseColor) {
    return (Math.min(255, Math.max(0, (int) (255.0f * alpha))) << 24) + (ViewCompat.MEASURED_SIZE_MASK & baseColor);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:3,代码来源:ScrollUtils.java

示例10: nextFrame

public boolean nextFrame(Handler handler) throws IOException {
    boolean inFinished = false;
    try {
        boolean control;
        int w1 = this.source.readInt();
        int w2 = this.source.readInt();
        if ((Integer.MIN_VALUE & w1) != 0) {
            control = true;
        } else {
            control = false;
        }
        int flags = (-16777216 & w2) >>> 24;
        int length = w2 & ViewCompat.MEASURED_SIZE_MASK;
        if (control) {
            int version = (2147418112 & w1) >>> 16;
            int type = w1 & 65535;
            if (version != 3) {
                throw new ProtocolException("version != 3: " + version);
            }
            switch (type) {
                case 1:
                    readSynStream(handler, flags, length);
                    return true;
                case 2:
                    readSynReply(handler, flags, length);
                    return true;
                case 3:
                    readRstStream(handler, flags, length);
                    return true;
                case 4:
                    readSettings(handler, flags, length);
                    return true;
                case 6:
                    readPing(handler, flags, length);
                    return true;
                case 7:
                    readGoAway(handler, flags, length);
                    return true;
                case 8:
                    readHeaders(handler, flags, length);
                    return true;
                case 9:
                    readWindowUpdate(handler, flags, length);
                    return true;
                default:
                    this.source.skip((long) length);
                    return true;
            }
        }
        int streamId = w1 & ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
        if ((flags & 1) != 0) {
            inFinished = true;
        }
        handler.data(inFinished, streamId, this.source, length);
        return true;
    } catch (IOException e) {
        return false;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:59,代码来源:Spdy3.java

示例11: readSettings

private void readSettings(Handler handler, int length, byte flags, int streamId) throws
        IOException {
    if (streamId != 0) {
        throw Http2.ioException("TYPE_SETTINGS streamId != 0", new Object[0]);
    } else if ((flags & 1) != 0) {
        if (length != 0) {
            throw Http2.ioException("FRAME_SIZE_ERROR ack frame should be empty!", new
                    Object[0]);
        }
        handler.ackSettings();
    } else if (length % 6 != 0) {
        throw Http2.ioException("TYPE_SETTINGS length %% 6 != 0: %s", Integer.valueOf
                (length));
    } else {
        Settings settings = new Settings();
        for (int i = 0; i < length; i += 6) {
            short id = this.source.readShort();
            int value = this.source.readInt();
            switch (id) {
                case (short) 1:
                case (short) 6:
                    break;
                case (short) 2:
                    if (!(value == 0 || value == 1)) {
                        throw Http2.ioException("PROTOCOL_ERROR SETTINGS_ENABLE_PUSH != 0" +
                                " or 1", new Object[0]);
                    }
                case (short) 3:
                    id = (short) 4;
                    break;
                case (short) 4:
                    id = (short) 7;
                    if (value >= 0) {
                        break;
                    }
                    throw Http2.ioException("PROTOCOL_ERROR SETTINGS_INITIAL_WINDOW_SIZE " +
                            "> 2^31 - 1", new Object[0]);
                case (short) 5:
                    if (value >= 16384 && value <= ViewCompat.MEASURED_SIZE_MASK) {
                        break;
                    }
                    throw Http2.ioException("PROTOCOL_ERROR SETTINGS_MAX_FRAME_SIZE: %s",
                            Integer.valueOf(value));
                    break;
                default:
                    throw Http2.ioException("PROTOCOL_ERROR invalid settings id: %s",
                            Short.valueOf(id));
            }
            settings.set(id, 0, value);
        }
        handler.settings(false, settings);
        if (settings.getHeaderTableSize() >= 0) {
            this.hpackReader.headerTableSizeSetting(settings.getHeaderTableSize());
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:56,代码来源:Http2.java

示例12: applyAlpha

private static int applyAlpha(int color, float alpha) {
    return (color & ViewCompat.MEASURED_SIZE_MASK) | (((int) (((float) Color.alpha(color)) * alpha)) << 24);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:3,代码来源:VectorDrawableCompat.java


注:本文中的android.support.v4.view.ViewCompat.MEASURED_SIZE_MASK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。