예제 #1
0
 static 
 {
     $SwitchMap$android$widget$ImageView$ScaleType = new int[android.widget.ImageView.ScaleType.values().length];
     try
     {
         $SwitchMap$android$widget$ImageView$ScaleType[android.widget.ImageView.ScaleType.CENTER_INSIDE.ordinal()] = 1;
     }
     catch (NoSuchFieldError nosuchfielderror7) { }
     try
     {
         $SwitchMap$android$widget$ImageView$ScaleType[android.widget.ImageView.ScaleType.FIT_CENTER.ordinal()] = 2;
     }
     catch (NoSuchFieldError nosuchfielderror6) { }
     try
     {
         $SwitchMap$android$widget$ImageView$ScaleType[android.widget.ImageView.ScaleType.FIT_START.ordinal()] = 3;
     }
     catch (NoSuchFieldError nosuchfielderror5) { }
     try
     {
         $SwitchMap$android$widget$ImageView$ScaleType[android.widget.ImageView.ScaleType.FIT_END.ordinal()] = 4;
     }
     catch (NoSuchFieldError nosuchfielderror4) { }
     try
     {
         $SwitchMap$android$widget$ImageView$ScaleType[android.widget.ImageView.ScaleType.CENTER_CROP.ordinal()] = 5;
     }
     catch (NoSuchFieldError nosuchfielderror3) { }
     try
     {
         $SwitchMap$android$widget$ImageView$ScaleType[android.widget.ImageView.ScaleType.FIT_XY.ordinal()] = 6;
     }
     catch (NoSuchFieldError nosuchfielderror2) { }
     try
     {
         $SwitchMap$android$widget$ImageView$ScaleType[android.widget.ImageView.ScaleType.CENTER.ordinal()] = 7;
     }
     catch (NoSuchFieldError nosuchfielderror1) { }
     try
     {
         $SwitchMap$android$widget$ImageView$ScaleType[android.widget.ImageView.ScaleType.MATRIX.ordinal()] = 8;
     }
     catch (NoSuchFieldError nosuchfielderror)
     {
         return;
     }
 }
  public static Map<String, Object> getConstants() {
    HashMap<String, Object> constants = new HashMap<String, Object>();
    constants.put(
        "UIView",
        MapBuilder.of(
            "ContentMode",
            MapBuilder.of(
                "ScaleAspectFit",
                ImageView.ScaleType.FIT_CENTER.ordinal(),
                "ScaleAspectFill",
                ImageView.ScaleType.CENTER_CROP.ordinal(),
                "ScaleAspectCenter",
                ImageView.ScaleType.CENTER_INSIDE.ordinal())));

    DisplayMetrics displayMetrics = DisplayMetricsHolder.getWindowDisplayMetrics();
    DisplayMetrics screenDisplayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics();
    constants.put(
        "Dimensions",
        MapBuilder.of(
            "windowPhysicalPixels",
            MapBuilder.of(
                "width",
                displayMetrics.widthPixels,
                "height",
                displayMetrics.heightPixels,
                "scale",
                displayMetrics.density,
                "fontScale",
                displayMetrics.scaledDensity,
                "densityDpi",
                displayMetrics.densityDpi),
            "screenPhysicalPixels",
            MapBuilder.of(
                "width",
                screenDisplayMetrics.widthPixels,
                "height",
                screenDisplayMetrics.heightPixels,
                "scale",
                screenDisplayMetrics.density,
                "fontScale",
                screenDisplayMetrics.scaledDensity,
                "densityDpi",
                screenDisplayMetrics.densityDpi)));

    constants.put(
        "StyleConstants",
        MapBuilder.of(
            "PointerEventsValues",
            MapBuilder.of(
                "none",
                PointerEvents.NONE.ordinal(),
                "boxNone",
                PointerEvents.BOX_NONE.ordinal(),
                "boxOnly",
                PointerEvents.BOX_ONLY.ordinal(),
                "unspecified",
                PointerEvents.AUTO.ordinal())));

    constants.put(
        "PopupMenu",
        MapBuilder.of(
            ACTION_DISMISSED, ACTION_DISMISSED, ACTION_ITEM_SELECTED, ACTION_ITEM_SELECTED));

    constants.put(
        "AccessibilityEventTypes",
        MapBuilder.of(
            "typeWindowStateChanged",
            AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED,
            "typeViewClicked",
            AccessibilityEvent.TYPE_VIEW_CLICKED));

    return constants;
  }