From 73ed613c802ef866d74d9b1d5bcf273183d6fe00 Mon Sep 17 00:00:00 2001 From: wangqi Date: Mon, 21 May 2018 15:57:36 -0700 Subject: Set navigation bar color when dialpad is visible. Instead of fake a black bar on voice incall UI, the more reliable way is to set navigation bar color. Bug: 79902234 Test: manual PiperOrigin-RevId: 197475300 Change-Id: I96085700e633570ef385386cdf366d758e50a6e2 --- java/com/android/dialer/util/ViewUtil.java | 44 ------------------------------ 1 file changed, 44 deletions(-) (limited to 'java/com/android/dialer/util') diff --git a/java/com/android/dialer/util/ViewUtil.java b/java/com/android/dialer/util/ViewUtil.java index 211b3ed12..81a32f985 100644 --- a/java/com/android/dialer/util/ViewUtil.java +++ b/java/com/android/dialer/util/ViewUtil.java @@ -19,19 +19,16 @@ package com.android.dialer.util; import android.content.ContentResolver; import android.content.Context; import android.graphics.Paint; -import android.graphics.Point; import android.os.PowerManager; import android.provider.Settings; import android.provider.Settings.Global; import android.support.annotation.NonNull; import android.text.TextUtils; import android.util.TypedValue; -import android.view.Display; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.view.ViewTreeObserver.OnPreDrawListener; -import android.view.WindowManager; import android.widget.TextView; import java.util.Locale; @@ -142,45 +139,4 @@ public class ViewUtil { return Settings.Global.getFloat(contentResolver, Global.ANIMATOR_DURATION_SCALE, 1.0f) == 0 || powerManager.isPowerSaveMode(); } - - /** - * Get navigation bar height by calculating difference between app usable size and real screen - * size. Note that this won't work in multi-window mode so it's caller's responsibility to check - * if the app is in multi-window mode before using this. - * - * @param context Context - * @return Navigation bar height - */ - public static int getNavigationBarHeight(Context context) { - WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); - Display display = windowManager.getDefaultDisplay(); - Point appUsableSize = getAppUsableScreenSize(display); - Point realScreenSize = getRealScreenSize(display); - - // Navigation bar on the right. - if (appUsableSize.x < realScreenSize.x) { - return appUsableSize.y; - } - - // Navigation bar at the bottom. - if (appUsableSize.y < realScreenSize.y) { - return realScreenSize.y - appUsableSize.y; - } - - // Navigation bar is not present. - return 0; - } - - private static Point getAppUsableScreenSize(Display display) { - Point size = new Point(); - display.getSize(size); - return size; - } - - private static Point getRealScreenSize(Display display) { - Point size = new Point(); - display.getRealSize(size); - - return size; - } } -- cgit v1.2.3