FileDocCategorySizeDatePackage
Config.javaAPI DocAndroid 5.1 API3925Thu Mar 12 22:22:44 GMT 2015com.android.layoutlib.bridge.bars

Config

public class Config extends Object
Various helper methods to simulate older versions of platform.

Fields Summary
private static final String
GINGERBREAD_DIR
private static final String
JELLYBEAN_DIR
private static final String
KITKAT_DIR
private static final String
DEFAULT_RESOURCE_DIR
private static final List
sDefaultResourceDir
private static final int
WHITE
private static final int
BLACK
Constructors Summary
Methods Summary
public static java.util.ListgetResourceDirs(int platformVersion)

        // Special case the most used scenario.
        if (platformVersion == 0) {
            return sDefaultResourceDir;
        }
        List<String> list = new ArrayList<String>(4);
        // Gingerbread - uses custom battery and wifi icons.
        if (platformVersion <= GINGERBREAD) {
            list.add(GINGERBREAD_DIR);
        }
        // ICS - JellyBean uses custom battery, wifi.
        if (platformVersion <= JELLY_BEAN_MR2) {
            list.add(JELLYBEAN_DIR);
        }
        // KitKat - uses custom wifi and nav icons.
        if (platformVersion <= KITKAT) {
            list.add(KITKAT_DIR);
        }
        list.add(DEFAULT_RESOURCE_DIR);

        return Collections.unmodifiableList(list);
    
public static intgetStatusBarColor(int platformVersion)

        // return white for froyo and earlier; black otherwise.
        return platformVersion == 0 || platformVersion >= GINGERBREAD ? BLACK : WHITE;
    
public static java.lang.StringgetTime(int platformVersion)

        if (platformVersion == 0) {
            return "5:00";
        }
        if (platformVersion < GINGERBREAD) {
            return "2:20";
        }
        if (platformVersion < ICE_CREAM_SANDWICH) {
            return "2:30";
        }
        if (platformVersion < JELLY_BEAN) {
            return "4:00";
        }
        if (platformVersion < KITKAT) {
            return "4:30";
        }
        if (platformVersion <= KITKAT_WATCH) {
            return "4:40";
        }
        // Should never happen.
        return "4:04";
    
public static intgetTimeColor(int platformVersion)

        if (platformVersion == 0 || platformVersion >= KITKAT ||
                platformVersion > FROYO && platformVersion < HONEYCOMB) {
            // Gingerbread and KitKat onwards.
            return WHITE;
        }
        // Black for froyo.
        if (platformVersion < GINGERBREAD) {
            return BLACK;
        } else if (platformVersion < KITKAT) {
            // Honeycomb to JB-mr2: Holo blue light.
            return 0xff33b5e5;
        }
        // Should never happen.
        return WHITE;
    
public static java.lang.StringgetWifiIconType(int platformVersion)

        return platformVersion == 0 ? "xml" : "png";
    
public static booleanshowOnScreenNavBar(int platformVersion)


         
        return platformVersion == 0 || platformVersion >= ICE_CREAM_SANDWICH;