本文整理汇总了Java中android.graphics.PixelFormat.TRANSPARENT属性的典型用法代码示例。如果您正苦于以下问题:Java PixelFormat.TRANSPARENT属性的具体用法?Java PixelFormat.TRANSPARENT怎么用?Java PixelFormat.TRANSPARENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.graphics.PixelFormat
的用法示例。
在下文中一共展示了PixelFormat.TRANSPARENT属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showKeyguardView
@Nullable
private View showKeyguardView (boolean showSettings) {
if (Build.VERSION.SDK_INT >= 23) {
if (!Settings.canDrawOverlays(mContext)) {
if (!showSettings)
return null;
Intent i = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
mContext.startActivity(i);
return null;
}
}
View keyguardView = LayoutInflater.from(mContext).inflate(R.layout.layout_keyguard, null);
WindowManager.LayoutParams wmParams = new WindowManager.LayoutParams();
wmParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
wmParams.format = PixelFormat.TRANSPARENT;
wmParams.flags=WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
| WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
wmParams.width=WindowManager.LayoutParams.MATCH_PARENT;
wmParams.height= WindowManager.LayoutParams.MATCH_PARENT;
mManager.addView(keyguardView, wmParams);
mContext.startActivity(new Intent(mContext, KeyguardLiveActivity.class));
return keyguardView;
}
示例2: onCreate
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
setRetainInstance(true);
mWindowManager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
mLayoutParams = new WindowManager.LayoutParams();
mLayoutParams.format = PixelFormat.TRANSPARENT;
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL;
mLayoutParams.token = getActivity().getWindow().getDecorView().getWindowToken();
mLayoutParams.gravity = Gravity.BOTTOM;
mLayoutParams.flags |= WindowManager.LayoutParams.FLAG_SPLIT_TOUCH|WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mLayoutParams.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
mLayoutParams.width = -1;
mLayoutParams.height = -2;
}
示例3: updateLayoutParams
private boolean updateLayoutParams() {
if (mLayoutParams == null) {
int max = Math.max(screenWidth, screenHeight);
mLayoutParams = new LayoutParams();
mLayoutParams.type = LayoutParams.TYPE_SYSTEM_OVERLAY;
mLayoutParams.height = mLayoutParams.width = max + 200;
mLayoutParams.flags |= LayoutParams.FLAG_NOT_TOUCHABLE;
mLayoutParams.flags |= LayoutParams.FLAG_NOT_FOCUSABLE;
mLayoutParams.flags |= LayoutParams.FLAG_LAYOUT_NO_LIMITS;
mLayoutParams.format = PixelFormat.TRANSPARENT;
}
if (mMaskView == null) {
mMaskView = new MaskView(this);
mMaskView.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
}
return mMaskView.setProfile(mColorProfile);
}
示例4: getOpacity
@Override
public int getOpacity() {
if (mLayers.length == 0) {
return PixelFormat.TRANSPARENT;
}
int opacity = PixelFormat.OPAQUE;
for (int i = 1; i < mLayers.length; i++) {
Drawable drawable = mLayers[i];
if (drawable != null) {
opacity = Drawable.resolveOpacity(opacity, drawable.getOpacity());
}
}
return opacity;
}
示例5: getOpacityFromColor
/**
* Gets the opacity from a color. Inspired by Android ColorDrawable.
* @param color
* @return opacity expressed by one of PixelFormat constants
*/
public static int getOpacityFromColor(int color) {
int colorAlpha = color >>> 24;
if (colorAlpha == 255) {
return PixelFormat.OPAQUE;
} else if (colorAlpha == 0) {
return PixelFormat.TRANSPARENT;
} else {
return PixelFormat.TRANSLUCENT;
}
}
示例6: getOpacityFromColor
/**
* Gets the opacity from a color. Inspired by Android ColorDrawable.
* @return opacity expressed by one of PixelFormat constants
*/
public static int getOpacityFromColor(int color) {
int colorAlpha = color >>> 24;
if (colorAlpha == 255) {
return PixelFormat.OPAQUE;
} else if (colorAlpha == 0) {
return PixelFormat.TRANSPARENT;
} else {
return PixelFormat.TRANSLUCENT;
}
}
示例7: createDragLayoutParams
/**
* 生成拖拽view的布局参数
* @return
*/
@NonNull
protected WindowManager.LayoutParams createDragLayoutParams(){
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
if (Build.VERSION.SDK_INT >= 19)
layoutParams.flags |= WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
layoutParams.format = PixelFormat.TRANSPARENT;
layoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
layoutParams.token = this.getWindowToken();
return layoutParams;
}
示例8: getOpacity
@Override
public int getOpacity() {
return PixelFormat.TRANSPARENT;
}
示例9: getOpacity
@Override
public int getOpacity() {
// We can't tell, so default to transparent to be safe.
return PixelFormat.TRANSPARENT;
}
示例10: getOpacity
@Override
public int getOpacity() {
return drawable == null ? PixelFormat.TRANSPARENT : drawable.getOpacity();
}
示例11: getOpacity
public int getOpacity() {
return PixelFormat.TRANSPARENT;
}