AI2 Component  (Version nb184)
HoneycombUtil.java
Go to the documentation of this file.
1 // -*- mode: java; c-basic-offset: 2; -*-
2 // Copyright 2009-2011 Google, All Rights reserved
3 // Copyright 2011-2018 MIT, All rights reserved
4 // Released under the Apache License, Version 2.0
5 // http://www.apache.org/licenses/LICENSE-2.0
6 package com.google.appinventor.components.runtime.util;
7 
8 import android.content.Context;
9 import android.view.View;
10 import android.view.ViewGroup;
11 import android.widget.Spinner;
12 
18 public class HoneycombUtil {
19 
20  public static final int VIEWGROUP_MEASURED_HEIGHT_STATE_SHIFT = ViewGroup.MEASURED_HEIGHT_STATE_SHIFT;
21 
22  private HoneycombUtil() {
23  }
24 
25  public static int combineMeasuredStates(ViewGroup view, int curState, int newState) {
26  return view.combineMeasuredStates(curState, newState);
27  }
28 
29  public static int getMeasuredState(View view) {
30  return view.getMeasuredState();
31  }
32 
33  public static int resolveSizeAndState(ViewGroup view, int maxWidth, int widthMeasureSpec, int childState) {
34  return view.resolveSizeAndState(maxWidth, widthMeasureSpec, childState);
35  }
36 
37  public static void viewSetRotate(View view, double rotationAngle) {
38  view.setRotation((float) rotationAngle);
39  }
40 
41  public static Spinner makeSpinner(Context activity) {
42  return new Spinner(activity, Spinner.MODE_DIALOG);
43  }
44 }
com.google.appinventor.components.runtime.util.HoneycombUtil.getMeasuredState
static int getMeasuredState(View view)
Definition: HoneycombUtil.java:29
com.google.appinventor.components.runtime.util.HoneycombUtil.VIEWGROUP_MEASURED_HEIGHT_STATE_SHIFT
static final int VIEWGROUP_MEASURED_HEIGHT_STATE_SHIFT
Definition: HoneycombUtil.java:20
com.google.appinventor.components.runtime.util.HoneycombUtil.viewSetRotate
static void viewSetRotate(View view, double rotationAngle)
Definition: HoneycombUtil.java:37
com.google.appinventor.components.runtime.util.HoneycombUtil.resolveSizeAndState
static int resolveSizeAndState(ViewGroup view, int maxWidth, int widthMeasureSpec, int childState)
Definition: HoneycombUtil.java:33
com.google.appinventor.components.runtime.util.HoneycombUtil.combineMeasuredStates
static int combineMeasuredStates(ViewGroup view, int curState, int newState)
Definition: HoneycombUtil.java:25
com.google.appinventor.components.runtime.util.HoneycombUtil.makeSpinner
static Spinner makeSpinner(Context activity)
Definition: HoneycombUtil.java:41
com.google.appinventor.components.runtime.util.HoneycombUtil
Definition: HoneycombUtil.java:18