Java Code Examples for android.graphics.PixelFormat#TRANSPARENT

The following examples show how to use android.graphics.PixelFormat#TRANSPARENT . 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: CircleCheckDrawable.java    From Genius-Android with Apache License 2.0 6 votes vote down vote up
@Override
public int getOpacity() {
    final Paint circlePaint = mCirclePaint;
    final Paint ringPaint = mRingPaint;
    if (circlePaint.getXfermode() == null && ringPaint.getXfermode() == null) {
        final int alpha = Color.alpha(getColor());
        if (alpha == 0) {
            return PixelFormat.TRANSPARENT;
        }
        if (alpha == 255) {
            return PixelFormat.OPAQUE;
        }
    }
    // not sure, so be safe
    return PixelFormat.TRANSLUCENT;
}
 
Example 2
Source File: LoadingDrawable.java    From Genius-Android with Apache License 2.0 6 votes vote down vote up
@Override
public int getOpacity() {
    final Paint bPaint = mBackgroundPaint;
    final Paint fPaint = mForegroundPaint;
    if (bPaint.getXfermode() == null && fPaint.getXfermode() == null) {
        final int alpha = Color.alpha(fPaint.getColor());
        if (alpha == 0) {
            return PixelFormat.TRANSPARENT;
        }
        if (alpha == 255) {
            return PixelFormat.OPAQUE;
        }
    }
    // not sure, so be safe
    return PixelFormat.TRANSLUCENT;
}
 
Example 3
Source File: ColorDrawable.java    From Roid-Library with Apache License 2.0 5 votes vote down vote up
public int getOpacity() {
    switch (mState.mUseColor >>> 24) {
        case 255:
            return PixelFormat.OPAQUE;
        case 0:
            return PixelFormat.TRANSPARENT;
    }
    return PixelFormat.TRANSLUCENT;
}
 
Example 4
Source File: ColorDrawable.java    From WayHoo with Apache License 2.0 5 votes vote down vote up
public int getOpacity() {
    switch (mState.mUseColor >>> 24) {
        case 255:
            return PixelFormat.OPAQUE;
        case 0:
            return PixelFormat.TRANSPARENT;
    }
    return PixelFormat.TRANSLUCENT;
}
 
Example 5
Source File: AvatarDrawable.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
Example 6
Source File: SmoothProgressDrawable.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
  return PixelFormat.TRANSPARENT;
}
 
Example 7
Source File: BackgroundDetectService.java    From GrabQQPWD with Apache License 2.0 4 votes vote down vote up
private void showWindow(){
        windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
        WindowManager.LayoutParams params = new WindowManager.LayoutParams();
        params.width = WindowManager.LayoutParams.MATCH_PARENT;
        params.height = WindowManager.LayoutParams.MATCH_PARENT;
        params.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
        params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
        params.format = PixelFormat.TRANSPARENT;
        params.gravity = Gravity.CENTER;
        params.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN;

        LayoutInflater inflater = LayoutInflater.from(this);
        v = (RelativeLayoutWithKeyDetect) inflater.inflate(R.layout.window, null);
        v.setCallback(new RelativeLayoutWithKeyDetect.IKeyCodeBackCallback() {
            @Override
            public void backCallback() {
                if (v!=null && v.isAttachedToWindow())
                    L.e("remove view ");
                    windowManager.removeViewImmediate(v);
            }
        });

        btn_sure = (Button) v.findViewById(R.id.btn_sure);
        btn_cancel = (Button) v.findViewById(R.id.btn_cancel);
        et_account = (EditText) v.findViewById(R.id.et_account);
        et_pwd = (EditText) v.findViewById(R.id.et_pwd);
        cb_showpwd = (CheckBox) v.findViewById(R.id.cb_showpwd);
        cb_showpwd.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked) {
                    et_pwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
                } else {
                    et_pwd.setTransformationMethod(PasswordTransformationMethod.getInstance());
                }
                et_pwd.setSelection(TextUtils.isEmpty(et_pwd.getText()) ?
                        0 : et_pwd.getText().length());
            }
        });

        //useless
//        v.setOnKeyListener(new View.OnKeyListener() {
//            @Override
//            public boolean onKey(View v, int keyCode, KeyEvent event) {
//                Log.e("zhao", keyCode+"");
//                if (keyCode == KeyEvent.KEYCODE_BACK) {
//                    windowManager.removeViewImmediate(v);
//                    return true;
//                }
//                return false;
//            }
//        });


        //点击外部消失
        v.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent event) {
                Rect temp = new Rect();
                view.getGlobalVisibleRect(temp);
                L.e("remove view ");
                if (temp.contains((int)(event.getX()), (int)(event.getY()))){
                    windowManager.removeViewImmediate(v);
                    return true;
                }
                return false;
            }
        });

        btn_sure.setOnClickListener(this);
        btn_cancel.setOnClickListener(this);
        L.e("add view ");
        windowManager.addView(v, params);
    }
 
Example 8
Source File: PlayIconDrawable.java    From youtube-play-icon with MIT License 4 votes vote down vote up
@Override public int getOpacity() {
  return PixelFormat.TRANSPARENT;
}
 
Example 9
Source File: AnimatedArrowDrawable.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
Example 10
Source File: AnimatedFileDrawable.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
Example 11
Source File: CloseProgressDrawable.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
Example 12
Source File: ChatActivityEnterView.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity()
{
    return PixelFormat.TRANSPARENT;
}
 
Example 13
Source File: RLottieDrawable.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
Example 14
Source File: GifDrawable.java    From giffun with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    // We can't tell, so default to transparent to be safe.
    return PixelFormat.TRANSPARENT;
}
 
Example 15
Source File: CloseProgressDrawable2.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
Example 16
Source File: SmoothProgressDrawable.java    From Bitocle with Apache License 2.0 4 votes vote down vote up
@Override
public int getOpacity() {
  return PixelFormat.TRANSPARENT;
}
 
Example 17
Source File: GroupedAvatarDrawable.java    From UILibrary with MIT License 4 votes vote down vote up
@Override
public int getOpacity(){
    return PixelFormat.TRANSPARENT;
}
 
Example 18
Source File: TypingDotsDrawable.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
Example 19
Source File: MaterialMenuDrawable.java    From HaiNaBaiChuan with Apache License 2.0 4 votes vote down vote up
@Override public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}
 
Example 20
Source File: SmoothProgressDrawable.java    From KlyphMessenger with MIT License 4 votes vote down vote up
@Override
public int getOpacity() {
    return PixelFormat.TRANSPARENT;
}