public ImageSurfaceView(Context context, AttributeSet attrs) {
super(context, attrs);
mSurHolder = getHolder();
mSurHolder.addCallback(this);
this.setOnTouchListener(this);
setZOrderOnTop(true);//使surfaceview放到最顶层
getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
java类android.graphics.PixelFormat的实例源码
ImageSurfaceView.java 文件源码
项目:tvConnect_android
阅读 21
收藏 0
点赞 0
评论 0
ARLauncher.java 文件源码
项目:trascendentAR
阅读 39
收藏 0
点赞 0
评论 0
@Override
public void initialize(ApplicationListener listener, AndroidApplicationConfiguration config){
//Las siguientes dos lines son necesaria para poder añadir markers de la manera que ARToolKit lo maneja
AssetHelper assetHelper = new AssetHelper(getAssets());
assetHelper.cacheAssetFolder(this, "Data");
mainLayout = new FrameLayout(this);
config.r = 8;
config.g = 8;
config.b = 8;
config.a = 8;
//Configuraciones basicas
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
gameView = initializeForView(listener, config);
if(graphics.getView() instanceof SurfaceView){
SurfaceView glView = (SurfaceView)graphics.getView();
glView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
setContentView(mainLayout);
}
PopupIndicator.java 文件源码
项目:screenfilter
阅读 38
收藏 0
点赞 0
评论 0
private WindowManager.LayoutParams createPopupLayout(IBinder token) {
WindowManager.LayoutParams p = new WindowManager.LayoutParams();
p.gravity = Gravity.START | Gravity.TOP;
p.width = ViewGroup.LayoutParams.MATCH_PARENT;
p.height = ViewGroup.LayoutParams.MATCH_PARENT;
p.format = PixelFormat.TRANSLUCENT;
p.flags = computeFlags(p.flags);
p.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
p.token = token;
p.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN;
p.setTitle("DiscreteSeekBar Indicator:" + Integer.toHexString(hashCode()));
return p;
}
DrawableUtilsTest.java 文件源码
项目:GitHub
阅读 29
收藏 0
点赞 0
评论 0
@Test
public void testGetOpacityFromColor() {
assertEquals(PixelFormat.TRANSPARENT, DrawableUtils.getOpacityFromColor(0x00000000));
assertEquals(PixelFormat.TRANSPARENT, DrawableUtils.getOpacityFromColor(0x00123456));
assertEquals(PixelFormat.TRANSPARENT, DrawableUtils.getOpacityFromColor(0x00FFFFFF));
assertEquals(PixelFormat.TRANSLUCENT, DrawableUtils.getOpacityFromColor(0xC0000000));
assertEquals(PixelFormat.TRANSLUCENT, DrawableUtils.getOpacityFromColor(0xC0123456));
assertEquals(PixelFormat.TRANSLUCENT, DrawableUtils.getOpacityFromColor(0xC0FFFFFF));
assertEquals(PixelFormat.OPAQUE, DrawableUtils.getOpacityFromColor(0xFF000000));
assertEquals(PixelFormat.OPAQUE, DrawableUtils.getOpacityFromColor(0xFF123456));
assertEquals(PixelFormat.OPAQUE, DrawableUtils.getOpacityFromColor(0xFFFFFFFF));
}
StyleActivity.java 文件源码
项目:RLibrary
阅读 22
收藏 0
点赞 0
评论 0
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
L.e(getClass().getSimpleName() + " 任务栈:" + getTaskId());
getWindow().setFormat(PixelFormat.TRANSLUCENT);//TBS X5
loadActivityStyle();
initWindow();
initUIActivity();
// onCreateView();
}
OverlayService.java 文件源码
项目:EasyOne
阅读 23
收藏 0
点赞 0
评论 0
@Override
public void onCreate() {
super.onCreate();
FrameLayout frameLayout = new FrameLayout(this);
frameLayout.setBackgroundColor(getResources().getColor(R.color.colorPhoneDark, getTheme()));
WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
//change this through preferences
int dragWidth = 20;
WindowManager.LayoutParams params = new WindowManager.LayoutParams(dragWidth, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, PixelFormat.TRANSLUCENT);
//change this through preferences
params.gravity = Gravity.START;
params.x = 0;
params.y = 0;
frameLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
Toast.makeText(OverlayService.this, "yo", Toast.LENGTH_SHORT)
.show();
return false;
}
});
if (windowManager != null) {
windowManager.addView(frameLayout, params);
}
}
ColorBarActivity.java 文件源码
项目:grafika
阅读 30
收藏 0
点赞 0
评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_color_bar);
mSurfaceView = (SurfaceView) findViewById(R.id.colorBarSurfaceView);
mSurfaceView.getHolder().addCallback(this);
mSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
}
AsyncDrawable.java 文件源码
项目:Markwon
阅读 40
收藏 0
点赞 0
评论 0
@Override
public int getOpacity() {
final int opacity;
if (hasResult()) {
opacity = result.getOpacity();
} else {
opacity = PixelFormat.TRANSPARENT;
}
return opacity;
}
ScreenSharingFragment.java 文件源码
项目:accelerator-core-android
阅读 30
收藏 0
点赞 0
评论 0
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void setUpVirtualDisplay() {
mScreen = (ViewGroup) getActivity().getWindow().getDecorView().getRootView();
// display metrics
DisplayMetrics metrics = getResources().getDisplayMetrics();
mDensity = metrics.densityDpi;
Display mDisplay = getActivity().getWindowManager().getDefaultDisplay();
Point size = new Point();
mDisplay.getRealSize(size);
mWidth = size.x;
mHeight = size.y;
// start capture reader
mImageReader = ImageReader.newInstance(mWidth, mHeight, PixelFormat.RGBA_8888, 2);
int flags = DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR;
mVirtualDisplay = mMediaProjection.createVirtualDisplay("ScreenCapture", mWidth, mHeight, mDensity, flags, mImageReader.getSurface(), null, null);
size.set(mWidth, mHeight);
//create ScreenCapturer
mScreenCapturer = new ScreenSharingCapturer(getActivity(), mScreen, mImageReader);
mListener.onScreenCapturerReady();
}
FloatingWidgetService.java 文件源码
项目:FloatingWidget
阅读 23
收藏 0
点赞 0
评论 0
private void initPosition() {
mParams = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
mParams.gravity = Gravity.TOP | Gravity.LEFT;
mParams.x = 0;
mParams.y = 150;
mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
mWindowManager.addView(mFloatingView, mParams);
}