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


Java View.isAttachedToWindow方法代码示例

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


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

示例1: onAnimationStart

import android.view.View; //导入方法依赖的package包/类
@Override
public void onAnimationStart(Animator animation) {
    // Enable all necessary layers
    Iterator<Map.Entry<View, Integer>> itr = mViewsToLayerTypeMap.entrySet().iterator();
    while (itr.hasNext()) {
        Map.Entry<View, Integer> entry = itr.next();
        View v = entry.getKey();
        entry.setValue(v.getLayerType());
        v.setLayerType(View.LAYER_TYPE_HARDWARE, null);
        if (v.isAttachedToWindow() && v.getVisibility() == View.VISIBLE) {
            v.buildLayer();
        }
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:15,代码来源:AnimationLayerSet.java

示例2: isAttachedToWindow

import android.view.View; //导入方法依赖的package包/类
private static boolean isAttachedToWindow(View view) {
    if (Build.VERSION.SDK_INT >= 19) {
        return view.isAttachedToWindow();
    } else {
        return view.getWindowToken() != null;
    }
}
 
开发者ID:lizhangqu,项目名称:FrescoLoader,代码行数:8,代码来源:FrescoLoader.java

示例3: isAttachedToWindow

import android.view.View; //导入方法依赖的package包/类
private boolean isAttachedToWindow(View view) {
    if (Build.VERSION.SDK_INT >= 19) {
        return view.isAttachedToWindow();
    } else {
        return view.getWindowToken() != null;
    }
}
 
开发者ID:lizhangqu,项目名称:FrescoLoader,代码行数:8,代码来源:ViewCompat.java

示例4: checkAttachedToWindow

import android.view.View; //导入方法依赖的package包/类
private boolean checkAttachedToWindow(View view) {
    if (Build.VERSION.SDK_INT >= 19) {
        return view.isAttachedToWindow();
    }
    //Unfortunately, we have no way of truly knowing on versions less than 19
    return true;
}
 
开发者ID:ovenbits,项目名称:QuickActionView,代码行数:8,代码来源:QuickActionView.java

示例5: isAttachedToHierarchy

import android.view.View; //导入方法依赖的package包/类
private static boolean isAttachedToHierarchy(View v) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        return v.isAttachedToWindow();
    }
    return v.getParent() != null;   // Best-effort fallback (without adding support-v4 just for this...)
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:7,代码来源:JumpingBeansSpan.java

示例6: isAttachedToWindow

import android.view.View; //导入方法依赖的package包/类
public static boolean isAttachedToWindow(View view) {
    return view.isAttachedToWindow();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:ViewCompatKitKat.java

示例7: checkCameraViewPosition

import android.view.View; //导入方法依赖的package包/类
private void checkCameraViewPosition() {
    if (!deviceHasGoodCamera) {
        return;
    }
    int count = attachPhotoRecyclerView.getChildCount();
    for (int a = 0; a < count; a++) {
        View child = attachPhotoRecyclerView.getChildAt(a);
        if (child instanceof PhotoAttachCameraCell) {
            if (Build.VERSION.SDK_INT >= 19) {
                if (!child.isAttachedToWindow()) {
                    break;
                }
            }
            child.getLocationInWindow(cameraViewLocation);
            float listViewX = listView.getX() + backgroundPaddingLeft;
            if (cameraViewLocation[0] < listViewX) {
                cameraViewOffsetX = (int) (listViewX - cameraViewLocation[0]);
                if (cameraViewOffsetX >= AndroidUtilities.dp(80)) {
                    cameraViewOffsetX = 0;
                    cameraViewLocation[0] = AndroidUtilities.dp(-100);
                    cameraViewLocation[1] = 0;
                } else {
                    cameraViewLocation[0] += cameraViewOffsetX;
                }
            } else {
                cameraViewOffsetX = 0;
            }
            if (Build.VERSION.SDK_INT >= 21 && cameraViewLocation[1] < AndroidUtilities.statusBarHeight) {
                cameraViewOffsetY = AndroidUtilities.statusBarHeight - cameraViewLocation[1];
                if (cameraViewOffsetY >= AndroidUtilities.dp(80)) {
                    cameraViewOffsetY = 0;
                    cameraViewLocation[0] = AndroidUtilities.dp(-100);
                    cameraViewLocation[1] = 0;
                } else {
                    cameraViewLocation[1] += cameraViewOffsetY;
                }
            } else {
                cameraViewOffsetY = 0;
            }
            applyCameraViewPosition();
            return;
        }
    }
    cameraViewOffsetX = 0;
    cameraViewOffsetY = 0;
    cameraViewLocation[0] = AndroidUtilities.dp(-100);
    cameraViewLocation[1] = 0;
    applyCameraViewPosition();
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:50,代码来源:ChatAttachAlert.java

示例8: isAttachedToHierarchy

import android.view.View; //导入方法依赖的package包/类
private static boolean isAttachedToHierarchy(View v) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        return v.isAttachedToWindow();
    }
    return v.getParent() != null;   // Best-effort fallback
}
 
开发者ID:kingwang666,项目名称:BookLoadingView,代码行数:7,代码来源:JumpingBeansSpan.java


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