本文整理汇总了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();
}
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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...)
}
示例6: isAttachedToWindow
import android.view.View; //导入方法依赖的package包/类
public static boolean isAttachedToWindow(View view) {
return view.isAttachedToWindow();
}
示例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();
}
示例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
}