一、横屏调整为竖屏,显示导航栏,并且内容在导航栏之上显示
pContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
// 设置导航栏不隐藏且占用空间
if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api
View vv = pContext.getWindow().getDecorView();
vv.setSystemUiVisibility(View.VISIBLE);
} else if (Build.VERSION.SDK_INT >= 19) {
//for new api versions.
View decorView = pContext.getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
decorView.setSystemUiVisibility(uiOptions);
}
final WindowManager.LayoutParams attrs = pContext.getWindow().getAttributes();
attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
pContext.getWindow().setAttributes(attrs);
pContext.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
pContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
二、配置android studio的terminal指向git的bash.exe
2.1、下载安装git
2.2、配置Shell path指向bash.exe
1、打开Android Studio。
2、进入File > Settings (或 Android Studio > Preferences 在Mac上)。
3、在设置中,导航至Tools > Terminal。
4、在Shell path 下,选择Git Bash的路径。通常,Git Bash可执行文件的路径是C:\Program Files\Git\bin\bash.exe。