File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
autosize/src/main/java/me/jessyan/autosize/utils Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1919import android .content .res .Resources ;
2020import android .graphics .Point ;
2121import android .os .Build ;
22+ import android .provider .Settings ;
2223import android .util .DisplayMetrics ;
2324import android .view .Display ;
2425import android .view .WindowManager ;
@@ -82,6 +83,13 @@ public static int[] getScreenSize(Context context) {
8283 }
8384
8485 public static int getHeightOfNavigationBar (Context context ) {
86+ //如果小米手机开启了全面屏手势隐藏了导航栏则返回 0
87+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .JELLY_BEAN_MR1 ) {
88+ if (Settings .Global .getInt (context .getContentResolver (), "force_fsg_nav_bar" , 0 ) != 0 ) {
89+ return 0 ;
90+ }
91+ }
92+
8593 Display d = ((WindowManager ) context .getSystemService (Context .WINDOW_SERVICE )).getDefaultDisplay ();
8694
8795 int realHeight = getScreenSize (context )[1 ];
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ android {
2121}
2222
2323dependencies {
24- implementation ' me.jessyan:autosize:0.7.0'
25- // implementation project(':autosize')
24+ // implementation 'me.jessyan:autosize:0.7.0'
25+ implementation project(' :autosize' )
2626 implementation ' com.android.support:appcompat-v7:27.1.1'
2727 implementation ' cat.ereza:customactivityoncrash:2.2.0'
2828 testImplementation ' junit:junit:4.12'
You can’t perform that action at this time.
0 commit comments