android.support.v4.view.ViewCompat#MEASURED_STATE_MASK源码实例Demo

下面列出了android.support.v4.view.ViewCompat#MEASURED_STATE_MASK 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: FimiX8-RE   文件: ImageUtils.java
private static int YUV2RGB(int y, int u, int v) {
    u -= 128;
    v -= 128;
    int y1192 = (y + -16 < 0 ? 0 : y - 16) * 1192;
    int r = y1192 + (v * 1634);
    int g = (y1192 - (v * 833)) - (u * 400);
    int b = y1192 + (u * 2066);
    if (r > kMaxChannelValue) {
        r = kMaxChannelValue;
    } else if (r < 0) {
        r = 0;
    }
    if (g > kMaxChannelValue) {
        g = kMaxChannelValue;
    } else if (g < 0) {
        g = 0;
    }
    if (b > kMaxChannelValue) {
        b = kMaxChannelValue;
    } else if (b < 0) {
        b = 0;
    }
    return ((ViewCompat.MEASURED_STATE_MASK | ((r << 6) & 16711680)) | ((g >> 2) & MotionEventCompat.ACTION_POINTER_INDEX_MASK)) | ((b >> 10) & 255);
}
 
源代码2 项目: FimiX8-RE   文件: H264ToBitmap.java
public static int[] convertByteToColor(byte[] data) {
    int size = data.length;
    if (size == 0) {
        return null;
    }
    int[] color = new int[(size / 4)];
    int colorLen = color.length;
    for (int i = 0; i < colorLen; i++) {
        int blue = data[(i * 4) + 2] & 255;
        color[i] = ((((data[i * 4] & 255) << 16) | ((data[(i * 4) + 1] & 255) << 8)) | blue) | ViewCompat.MEASURED_STATE_MASK;
    }
    return color;
}
 
源代码3 项目: FimiX8-RE   文件: PercentLayoutHelper.java
private static boolean shouldHandleMeasuredWidthTooSmall(View view, PercentLayoutInfo info) {
    int state = ViewCompat.getMeasuredWidthAndState(view) & ViewCompat.MEASURED_STATE_MASK;
    if (info == null || info.widthPercent == null || info.mPreservedParams == null || state != 16777216 || info.widthPercent.percent < 0.0f || info.mPreservedParams.width != -2) {
        return false;
    }
    return true;
}
 
private static boolean shouldHandleMeasuredWidthTooSmall(View view, PercentLayoutInfo info)
{
    int state = ViewCompat.getMeasuredWidthAndState(view) & ViewCompat.MEASURED_STATE_MASK;
    if (info == null || info.widthPercent == null)
    {
        return false;
    }
    return state == ViewCompat.MEASURED_STATE_TOO_SMALL && info.widthPercent.percent >= 0 &&
            info.mPreservedParams.width == ViewGroup.LayoutParams.WRAP_CONTENT;
}
 
private static boolean shouldHandleMeasuredHeightTooSmall(View view, PercentLayoutInfo info)
{
    int state = ViewCompat.getMeasuredHeightAndState(view) & ViewCompat.MEASURED_STATE_MASK;
    if (info == null || info.heightPercent == null)
    {
        return false;
    }
    return state == ViewCompat.MEASURED_STATE_TOO_SMALL && info.heightPercent.percent >= 0 &&
            info.mPreservedParams.height == ViewGroup.LayoutParams.WRAP_CONTENT;
}
 
源代码6 项目: FimiX8-RE   文件: TestJava.java
public static byte[] getBytes(float data) {
    int intBits = Float.floatToIntBits(data);
    return new byte[]{(byte) (intBits & 255), (byte) ((MotionEventCompat.ACTION_POINTER_INDEX_MASK & intBits) >> 8), (byte) ((16711680 & intBits) >> 16), (byte) ((ViewCompat.MEASURED_STATE_MASK & intBits) >> 24)};
}
 
源代码7 项目: FimiX8-RE   文件: StatusBarUtil.java
private static int calculateStatusColor(@ColorInt int color, int alpha) {
    float a = 1.0f - (((float) alpha) / 255.0f);
    return ((ViewCompat.MEASURED_STATE_MASK | (((int) (((double) (((float) ((color >> 16) & 255)) * a)) + 0.5d)) << 16)) | (((int) (((double) (((float) ((color >> 8) & 255)) * a)) + 0.5d)) << 8)) | ((int) (((double) (((float) (color & 255)) * a)) + 0.5d));
}
 
源代码8 项目: FimiX8-RE   文件: PercentLayoutHelper.java
private static boolean shouldHandleMeasuredHeightTooSmall(View view, PercentLayoutInfo info) {
    if (info == null || info.heightPercent == null || info.mPreservedParams == null || (ViewCompat.getMeasuredHeightAndState(view) & ViewCompat.MEASURED_STATE_MASK) != 16777216 || info.heightPercent.percent < 0.0f || info.mPreservedParams.height != -2) {
        return false;
    }
    return true;
}
 
源代码9 项目: FimiX8-RE   文件: StatusBarCompat.java
private static int calculateStatusBarColor(int color, int alpha) {
    float a = 1.0f - (((float) alpha) / 255.0f);
    return ((ViewCompat.MEASURED_STATE_MASK | (((int) (((double) (((float) ((color >> 16) & 255)) * a)) + 0.5d)) << 16)) | (((int) (((double) (((float) ((color >> 8) & 255)) * a)) + 0.5d)) << 8)) | ((int) (((double) (((float) (color & 255)) * a)) + 0.5d));
}
 
源代码10 项目: JD-Test   文件: PercentLayoutHelper.java
private static boolean shouldHandleMeasuredWidthTooSmall(View view, PercentLayoutInfo info) {
    int state = ViewCompat.getMeasuredWidthAndState(view) & ViewCompat.MEASURED_STATE_MASK;
    return state == ViewCompat.MEASURED_STATE_TOO_SMALL && info.widthPercent >= 0 &&
            info.mPreservedParams.width == ViewGroup.LayoutParams.WRAP_CONTENT;
}
 
源代码11 项目: JD-Test   文件: PercentLayoutHelper.java
private static boolean shouldHandleMeasuredHeightTooSmall(View view, PercentLayoutInfo info) {
    int state = ViewCompat.getMeasuredHeightAndState(view) & ViewCompat.MEASURED_STATE_MASK;
    return state == ViewCompat.MEASURED_STATE_TOO_SMALL && info.heightPercent >= 0 &&
            info.mPreservedParams.height == ViewGroup.LayoutParams.WRAP_CONTENT;
}
 
 同类方法