Gravity.BOTTOM); Window window = dialogMyAddress.getWindow(); Window window1 = getWindow();// window.getDecorView...().setMinimumWidth(getResources().getDisplayMetrics().widthPixels);//window.getDecorView().setBackgroundColor...默认是有 padding 的,大小为 42,可以通过 mWindow.getDecorView().getPaddingTop() 来获取。...().setMinimumWidth(getResources().getDisplayMetrics().widthPixels);window.getDecorView().setBackgroundColor...().setMinimumWidth(getResources().getDisplayMetrics().widthPixels); window.getDecorView().setBackgroundColor
Android 部分机型没有物理按键,只有虚拟按键,Activity全屏方法如下: 1、在 setContentView(R.layout.activity_main);之前添加 getWindow().getDecorView...().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); 2、当用户划出虚拟按键后,自动再隐藏方法如下: getWindow().getDecorView...0x00001000; } else { uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE; } getWindow().getDecorView...().setSystemUiVisibility(uiOptions); } }); 3、dialog 隐藏方法 mDialog.getWindow().getDecorView().setSystemUiVisibility...(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); mDialog.getWindow().getDecorView().setOnSystemUiVisibilityChangeListener
finish; 第二步,重写Activity的onBackPressed()方法 @Override public void onBackPressed() { getWindow().getDecorView...Activity的onStart()方法 @Override protected void onStart() { super.onStart(); getWindow().getDecorView...getWindow().getDecorView().postDelayed(mFinishRunnable, 1000 * 10); moveTaskToBack(true); }...mFinishRunnable . */ @Override protected void onStart() { super.onStart(); getWindow().getDecorView
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); window.setStatusBarColor(Color.TRANSPARENT); window.getDecorView...window.setStatusBarColor(Color.TRANSPARENT); if (isDarkMode()) { int uiOption = window.getDecorView...().getSystemUiVisibility(); //没有DARK_STATUS_BAR属性,通过位运算将LIGHT_STATUS_BAR属性去除 window.getDecorView....setSystemUiVisibility(uiOption & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } else { window.getDecorView...; window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); //window.getDecorView
WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.getDecorView...().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); 状态栏白色字体: int flag = window.getDecorView...().getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; window.getDecorView().setSystemUiVisibility...setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); }else{ int flag = activity.getWindow().getDecorView...().getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; window.getDecorView().setSystemUiVisibility
View decorView = getWindow().getDecorView(); // int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION...View decorView =this.getWindow().getDecorView(); decorView.setSystemUiVisibility(...{ super.onCreate(savedInstanceState); hideBottomUIMenu(); this.getWindow().getDecorView...* @param window */ public void hideNavigationBar(final Window window) { window.getDecorView...(); mProgressDialog.setTextSize(v,24); mProgressDialog.getWindow().getDecorView
上代码 dialog.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); dialog.getWindow...().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener()...View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; uiOptions |= 0x00001000; dialog.getWindow().getDecorView...WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); super.show(); fullScreenImmersive(getWindow().getDecorView
Build.VERSION.SDK_INT 11 && Build.VERSION.SDK_INT < 19) { // lower api View v = this.getWindow().getDecorView...View decorView = getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION...Build.VERSION.SDK_INT 11 && Build.VERSION.SDK_INT < 19) { // lower api View v = this.getWindow().getDecorView
withoutUseStatusBarColor) { //android6.0以后可以对状态栏文字颜色和图标进行修改 getWindow().getDecorView...Activity通过上面的设置,可以实现如下效果: 上面设置状态栏文字颜色和图标为暗色主要采用了以下两个标志: //设置状态栏文字颜色及图标为深色 getWindow().getDecorView()...//设置状态栏文字颜色及图标为浅色 getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN...transaction, fourFragment, thirdFragment, secondFragment, homeFragment);//展示第一个fragment getWindow().getDecorView.../展示第二个fragment if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { //实现状态栏图标和文字颜色为暗色 getWindow().getDecorView
Build.VERSION.SDK_INT 11 && Build.VERSION.SDK_INT < 19) { View v = ((Activity) context).getWindow().getDecorView...View decorView = ((Activity) context).getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION...往下看: public static void showNavKey(Context context, int systemUiVisibility) {//getWindow().getDecorView...().getSystemUiVisibility() 传入0也可以 ((Activity) context).getWindow().getDecorView().setSystemUiVisibility
中提供了亮色状态栏模式,配置只需一行代码: if (Build.VERSION.SDK_INT = Build.VERSION_CODES.M) { activity.getWindow().getDecorView...activity.getWindow(); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.getDecorView...true)){ result=2; }else if (Build.VERSION.SDK_INT = Build.VERSION_CODES.M) { activity.getWindow().getDecorView...2){ FlymeSetStatusBarLightMode(activity.getWindow(), true); }else if(type==3){ activity.getWindow().getDecorView...){ FlymeSetStatusBarLightMode(activity.getWindow(), false); }else if(type==3){ activity.getWindow().getDecorView
把subDecor返回赋值给mSubDecor } } } 总结一下createSubDecor方法,一共做了三件事: 1 this.mWindow.getDecorView...下面分析这三步骤 Step1 this.mWindow.getDecorView(); this.mWindow 这个是啥呢?...那就到里PhoneWindow面看一下 getDecorView()是如何实现的 PhoneWindow.java: @Override public final View getDecorView...().findViewById(id); } public abstract View getDecorView(); } getDecorView的具体实现又回到了PhoneWindow...中; @Override public final View getDecorView() { if (mDecor == null || mForceDecorInstall
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.getDecorView...} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { activity.getWindow().getDecorView...FlymeSetStatusBarLightMode(activity.getWindow(), true); } else if (type == 3) { activity.getWindow().getDecorView...,旧方法无效但不会报错,所以两个方式都要加上 if (dark) { activity.getWindow().getDecorView...View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } else { activity.getWindow().getDecorView
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); if (hideStatusBarBackground) { window.getDecorView...View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); } else { window.getDecorView...WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.setStatusBarColor(Color.TRANSPARENT); window.getDecorView...window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.getDecorView...getStatusBarHeight(Activity activity) { Rect frame = new Rect(); activity.getWindow().getDecorView
MotionEvent.ACTION_UP: if (isHandle) { isSlide = false; isHandle = false; isAnimate = true; int width = getWindow().getDecorView...public void onAnimationEnd(Animator animation) { isAnimate = false; if (mAnimatedValue == getWindow().getDecorView...initSlideBackView() { mSlideBackView = new SlideBackView(this); ViewGroup decorView = (ViewGroup) getWindow().getDecorView...mSlideBackView); } private void moveView(float moveX) { ViewGroup decorView = (ViewGroup) getWindow().getDecorView
hideSoftInputFromWindow (IBinder windowToken, int flags) windowToken:第一个参数可以使用View.getWindowToken()或者getWindow().getDecorView...().getWindowToken() flags:隐藏软键盘的标志位,可以传0 关闭软键盘,windowToken不需要已获取焦点的View,所以可以使用getWindow().getDecorView...= null) { imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0); } 注意:如果是使用
activity.getWindow(); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.getDecorView...activity.getWindow(); //window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); //window.getDecorView...if(FlymeSetStatusBarLightMode(activity.getWindow(), true)){ result=2; }else { activity.getWindow().getDecorView...Build.VERSION_CODES.M) { //开发版 7.7.13 及以后版本采用了系统API,旧方法无效但不会报错,所以两个方式都要加上 if(dark){ activity.getWindow().getDecorView...View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); }else { activity.getWindow().getDecorView
DecorView这个大家应该很熟悉,通过getWindow().getDecorView()就可以得到此对象,在6.0以上,我们可以通过以下方式设置状态栏字体变黑: getWindow().getDecorView...解决思路:首先,我们通过getWindow().getDecorView()可以获取到这个DecorView类的对象,然后通过反射修改这个对象的成员mSemiTransparentStatusBarColor...decorViewClazz.getDeclaredField("mSemiTransparentStatusBarColor"); field.setAccessible(true); field.setInt(getWindow().getDecorView
public static Bitmap snapShotWithStatusBar(Activity activity) { View view = activity.getWindow().getDecorView...static Bitmap snapShotWithoutStatusBar(Activity activity) { View view = activity.getWindow().getDecorView...Bitmap bmp = view.getDrawingCache(); Rect frame = new Rect(); activity.getWindow().getDecorView
activity.getWindow(); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.getDecorView...result = 2; } else if (Build.VERSION.SDK_INT = Build.VERSION_CODES.M) { //6.0以上 activity.getWindow().getDecorView...Build.VERSION_CODES.M) { //开发版 7.7.13 及以后版本采用了系统API,旧方法无效但不会报错,所以两个方式都要加上 if (dark) { activity.getWindow().getDecorView...View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } else { activity.getWindow().getDecorView
领取专属 10元无门槛券
手把手带您无忧上云