當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。