最終更新:2015-07-16 (木) 17:46:42 (1462d)  

AOSP/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java はてなブックマークを見る
Top / AOSP / frameworks / base / policy / src / com / android / internal / policy / impl / PhoneWindowManager.java

public class PhoneWindowManager implements WindowManagerPolicy

概要

処理

windowTypeToLayerLw

Android/UIの判定 (setInitialDisplaySize?)

Android 4.4

  • // SystemUI (status bar) layout policy
    int shortSizeDp = shortSize * DisplayMetrics.DENSITY_DEFAULT / density;
    int longSizeDp = longSize * DisplayMetrics.DENSITY_DEFAULT / density;
    
    // Allow the navigation bar to move on small devices (phones).
    mNavigationBarCanMove = shortSizeDp < 600;

Android 4.3

  • // SystemUI (status bar) layout policy
    int shortSizeDp = shortSize * DisplayMetrics.DENSITY_DEFAULT / density;
    
    if (shortSizeDp < 600) {
        // 0-599dp: "phone" UI with a separate status & navigation bar
        mHasSystemNavBar = false;
        mNavigationBarCanMove = true;
    } else if (shortSizeDp < 720) {
        // 600+dp: "phone" UI with modifications for larger screens
        mHasSystemNavBar = false;
        mNavigationBarCanMove = false;
    }

Android 4.2

  • int shortSizeDp = shortSize * DisplayMetrics.DENSITY_DEFAULT / density;
    
    if (shortSizeDp < 600) {
        // 0-599dp: "phone" UI with a separate status & navigation bar
        mHasSystemNavBar = false;
        mNavigationBarCanMove = true;
    } else if (shortSizeDp < 720) {
        // 600+dp: "phone" UI with modifications for larger screens
        mHasSystemNavBar = false;
        mNavigationBarCanMove = false;
    }

Android 4.1

  • int shortSizeDp = shortSize
            * DisplayMetrics.DENSITY_DEFAULT
            / DisplayMetrics.DENSITY_DEVICE;
    
    if (shortSizeDp < 600) {
        // 0-599dp: "phone" UI with a separate status & navigation bar
        mHasSystemNavBar = false;
        mNavigationBarCanMove = true;
    } else if (shortSizeDp < 720) {
        // 600-719dp: "phone" UI with modifications for larger screens
        mHasSystemNavBar = false;
        mNavigationBarCanMove = false;
    } else {
        // 720dp: "tablet" UI with a single combined status & navigation bar
        mHasSystemNavBar = true;
        mNavigationBarCanMove = false;
    }

Android 4.0.4

  • // Determine whether the status bar can hide based on the size
    // of the screen.  We assume sizes > 600dp are tablets where we
    // will use the system bar.
    int shortSizeDp = shortSize
            * DisplayMetrics.DENSITY_DEFAULT
            / DisplayMetrics.DENSITY_DEVICE;
    mStatusBarCanHide = shortSizeDp < 600;

メモ

  • mNavigationBarCanMove? - 横画面にした時にナビゲーションバーを移動するかどうか

関連