Java Code Examples for android.graphics.PixelFormat#TRANSLUCENT

The following examples show how to use android.graphics.PixelFormat#TRANSLUCENT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VideoChatHeadService.java    From VideoChatHeads with The Unlicense 6 votes vote down vote up
private void addCloseView() {

        liClose = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);

        // add close view ImageView centered on the bottom of the screen
        mCloseViewParams = new WindowManager.LayoutParams(
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.TYPE_PHONE,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                PixelFormat.TRANSLUCENT);

        mCloseViewParams.gravity = Gravity.BOTTOM | Gravity.CENTER;
        mCloseViewParams.height = 400;
        mCloseViewParams.width = WindowManager.LayoutParams.MATCH_PARENT;

        closeView = liClose.inflate(R.layout.view_layout_close, null);

        ivCloseView = (ImageView) closeView.findViewById(R.id.img_close);

        mCloseViewParams.x = 0;
        mCloseViewParams.y = 0;

        mWindowManager.addView(closeView, mCloseViewParams);
    }
 
Example 2
Source File: UETMenu.java    From UETool with MIT License 5 votes vote down vote up
private WindowManager.LayoutParams getWindowLayoutParams() {
    params.width = FrameLayout.LayoutParams.WRAP_CONTENT;
    params.height = FrameLayout.LayoutParams.WRAP_CONTENT;
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
        params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
    } else {
        params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
    }
    params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
    params.format = PixelFormat.TRANSLUCENT;
    params.gravity = Gravity.TOP | Gravity.LEFT;
    params.x = 10;
    params.y = y;
    return params;
}
 
Example 3
Source File: WindowStateAnimator.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Try to change the pixel format without recreating the surface. This
 * will be common in the case of changing from PixelFormat.OPAQUE to
 * PixelFormat.TRANSLUCENT in the hardware-accelerated case as both
 * requested formats resolve to the same underlying SurfaceControl format
 * @return True if format was succesfully changed, false otherwise
 */
boolean tryChangeFormatInPlaceLocked() {
    if (mSurfaceController == null) {
        return false;
    }
    final LayoutParams attrs = mWin.getAttrs();
    final boolean isHwAccelerated = (attrs.flags & FLAG_HARDWARE_ACCELERATED) != 0;
    final int format = isHwAccelerated ? PixelFormat.TRANSLUCENT : attrs.format;
    if (format == mSurfaceFormat) {
        setOpaqueLocked(!PixelFormat.formatHasAlpha(attrs.format));
        return true;
    }
    return false;
}
 
Example 4
Source File: CoolDragAndDropGridView.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
private ImageView createDragImageView(final View v, final int x, final int y) {

		v.destroyDrawingCache();
		v.setDrawingCacheEnabled(true);
		Bitmap bm = Bitmap.createBitmap(v.getDrawingCache());

		mDragPointX = x - v.getLeft();
		mDragPointY = y - v.getTop();

		mWindowParams = new WindowManager.LayoutParams();
		mWindowParams.gravity = Gravity.TOP | Gravity.LEFT;

		mWindowParams.x = x - mDragPointX + mDragOffsetX;
		mWindowParams.y = y - mDragPointY + mDragOffsetY;

		mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
		mWindowParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
		mWindowParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
				| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;

		mWindowParams.format = PixelFormat.TRANSLUCENT;
		mWindowParams.alpha = 0.7f;
		mWindowParams.windowAnimations = 0;

		ImageView iv = new ImageView(getContext());
		iv.setBackgroundColor(Color.parseColor("#ff555555"));
		iv.setImageBitmap(bm);

		mWindowManager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);// "window"
		mWindowManager.addView(iv, mWindowParams);
		return iv;

	}
 
Example 5
Source File: AnimatedCircleDrawable.java    From Camera2 with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity()
{
    return PixelFormat.TRANSLUCENT;
}
 
Example 6
Source File: PathDrawable.java    From ProjectX with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}
 
Example 7
Source File: KcaBattleViewService.java    From kcanotify_h5-master with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean onTouch(View v, MotionEvent event) {
    int xMargin = (int) getResources().getDimension(R.dimen.item_popup_xmargin);
    if (menuView.getParent() != null) {
        return false;
    }
    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            if (!isTouchDown && api_data != null) {
                isTouchDown = true;
                try {
                    int selected = getshipidx(v.getId());
                    setItemViewLayout(selected);
                    itemViewParams = new WindowManager.LayoutParams(
                            WindowManager.LayoutParams.WRAP_CONTENT,
                            WindowManager.LayoutParams.WRAP_CONTENT,
                            getWindowLayoutType(),
                            WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                            PixelFormat.TRANSLUCENT);
                    itemViewParams.x = (int) (event.getRawX() + xMargin);
                    itemViewParams.y = (int) event.getRawY();
                    itemViewParams.gravity = Gravity.TOP | Gravity.START;
                    if (itemView.getParent() != null) {
                        mManager.updateViewLayout(itemView, itemViewParams);
                    } else {
                        mManager.addView(itemView, itemViewParams);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    sendReport(e, KcaBattleViewService.ERORR_ITEMVIEW);
                }
            }
            Log.e("KCA", "ACTION_DOWN");
            return true;
        case MotionEvent.ACTION_UP:
            itemView.setVisibility(View.GONE);
            isTouchDown = false;
            Log.e("KCA", "ACTION_UP");
            return false;
        default:
            return false;
    }
}
 
Example 8
Source File: FontDrawable.java    From FontDrawable with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}
 
Example 9
Source File: PersonBubbleActivity.java    From android-popup-info with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity()
{
	return PixelFormat.TRANSLUCENT;
}
 
Example 10
Source File: RoundedDrawable.java    From QuickReturn with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}
 
Example 11
Source File: FastBitmapDrawable.java    From LiveBlurListView with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
	return PixelFormat.TRANSLUCENT;
}
 
Example 12
Source File: BackgroundAlphaColorDrawable.java    From GravityBox with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}
 
Example 13
Source File: TinyCoach.java    From TinyDancer with MIT License 4 votes vote down vote up
private void addViewToWindow(View view) {

        int permissionFlag = PermissionCompat.getFlag();

        WindowManager.LayoutParams paramsF = new WindowManager.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.WRAP_CONTENT,
                permissionFlag,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                PixelFormat.TRANSLUCENT);

        // configure starting coordinates
        if (fpsConfig.xOrYSpecified) {
            paramsF.x = fpsConfig.startingXPosition;
            paramsF.y = fpsConfig.startingYPosition;
            paramsF.gravity = FPSConfig.DEFAULT_GRAVITY;
        } else if (fpsConfig.gravitySpecified) {
            paramsF.x = 0;
            paramsF.y = 0;
            paramsF.gravity = fpsConfig.startingGravity;
        } else {
            paramsF.gravity = FPSConfig.DEFAULT_GRAVITY;
            paramsF.x = fpsConfig.startingXPosition;
            paramsF.y = fpsConfig.startingYPosition;
        }

        // add view to the window
        windowManager.addView(view, paramsF);

        // create gesture detector to listen for double taps
        GestureDetector gestureDetector = new GestureDetector(view.getContext(), simpleOnGestureListener);

        // attach touch listener
        view.setOnTouchListener(new DancerTouchListener(paramsF, windowManager, gestureDetector));

        // disable haptic feedback
        view.setHapticFeedbackEnabled(false);

        // show the meter
        show();
    }
 
Example 14
Source File: ClipDrawable.java    From ProjectX with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}
 
Example 15
Source File: MaterialProgressDrawable.java    From KUAS-AP-Material with MIT License 4 votes vote down vote up
@Override
public int getOpacity() {
	return PixelFormat.TRANSLUCENT;
}
 
Example 16
Source File: BubbleDrawable.java    From imsdk-android with MIT License 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}
 
Example 17
Source File: VoIPActivity.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity(){
    return PixelFormat.TRANSLUCENT;
}
 
Example 18
Source File: CustomShadow.java    From HaiNaBaiChuan with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}
 
Example 19
Source File: ColorCircleDrawable.java    From kolabnotes-android with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}
 
Example 20
Source File: PlayPauseDrawable.java    From uPods-android with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSLUCENT;
}