default immersive status bar in android

This commit is contained in:
王劲鹏 2020-01-14 14:46:02 +08:00 committed by osborn
parent 1e167f541b
commit 7f20103148

View File

@ -15,7 +15,10 @@
*/
package pub.doric;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
@ -38,5 +41,9 @@ public class DoricActivity extends AppCompatActivity {
.add(R.id.container, doricFragment)
.commit();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}
}