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


Java PixelFormat.TRANSPARENT属性代码示例

本文整理汇总了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;
}
 
开发者ID:TaRGroup,项目名称:Keyguard,代码行数:24,代码来源:MaskWindowUtils.java

示例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;
}
 
开发者ID:AlphaBoom,项目名称:ClassifyView,代码行数:16,代码来源:IReaderMockFragment.java

示例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);
}
 
开发者ID:tranleduy2000,项目名称:screenfilter,代码行数:19,代码来源:MaskService.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:ArrayDrawable.java

示例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;
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:DrawableUtils.java

示例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;
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:14,代码来源:ColorUtil.java

示例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;
}
 
开发者ID:AlphaBoom,项目名称:ClassifyView,代码行数:15,代码来源:ClassifyView.java

示例8: getOpacity

@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
开发者ID:JMaroz,项目名称:RoundButton,代码行数:4,代码来源:CircularAnimatedDrawable.java

示例9: getOpacity

@Override
public int getOpacity() {
  // We can't tell, so default to transparent to be safe.
  return PixelFormat.TRANSPARENT;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:GifDrawable.java

示例10: getOpacity

@Override
public int getOpacity() {
    return drawable == null ? PixelFormat.TRANSPARENT : drawable.getOpacity();
}
 
开发者ID:nichbar,项目名称:Aequorea,代码行数:4,代码来源:DrawableWrapper.java

示例11: getOpacity

public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:3,代码来源:DefaultProgressDrawable.java


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