Loading tools/layoutlib/bridge/src/android/os/SystemClock_Delegate.java +11 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.tools.layoutlib.annotations.LayoutlibDelegate; */ public class SystemClock_Delegate { private static long sBootTime = System.currentTimeMillis(); private static long sBootTimeNano = System.nanoTime(); @LayoutlibDelegate /*package*/ static boolean setCurrentTimeMillis(long millis) { Loading Loading @@ -59,6 +60,16 @@ public class SystemClock_Delegate { return System.currentTimeMillis() - sBootTime; } /** * Returns nanoseconds since boot, including time spent in sleep. * * @return elapsed nanoseconds since boot. */ @LayoutlibDelegate /*package*/ static long elapsedRealtimeNano() { return System.nanoTime() - sBootTimeNano; } /** * Returns milliseconds running in the current thread. * Loading tools/layoutlib/bridge/src/android/util/FloatMath_Delegate.java +38 −0 Original line number Diff line number Diff line Loading @@ -91,4 +91,42 @@ import com.android.tools.layoutlib.annotations.LayoutlibDelegate; /*package*/ static float sqrt(float value) { return (float)Math.sqrt(value); } /** * Returns the closest float approximation of the raising "e" to the power * of the argument. * * @param value to compute the exponential of * @return the exponential of value */ @LayoutlibDelegate /*package*/ static float exp(float value) { return (float)Math.exp(value); } /** * Returns the closest float approximation of the result of raising {@code * x} to the power of {@code y}. * * @param x the base of the operation. * @param y the exponent of the operation. * @return {@code x} to the power of {@code y}. */ @LayoutlibDelegate /*package*/ static float pow(float x, float y) { return (float)Math.pow(x, y); } /** * Returns {@code sqrt(}<i>{@code x}</i><sup>{@code 2}</sup>{@code +} <i> * {@code y}</i><sup>{@code 2}</sup>{@code )}. * * @param x a float number * @param y a float number * @return the hypotenuse */ @LayoutlibDelegate /*package*/ static float hypot(float x, float y) { return (float)Math.sqrt(x*x + y*y); } } Loading
tools/layoutlib/bridge/src/android/os/SystemClock_Delegate.java +11 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.tools.layoutlib.annotations.LayoutlibDelegate; */ public class SystemClock_Delegate { private static long sBootTime = System.currentTimeMillis(); private static long sBootTimeNano = System.nanoTime(); @LayoutlibDelegate /*package*/ static boolean setCurrentTimeMillis(long millis) { Loading Loading @@ -59,6 +60,16 @@ public class SystemClock_Delegate { return System.currentTimeMillis() - sBootTime; } /** * Returns nanoseconds since boot, including time spent in sleep. * * @return elapsed nanoseconds since boot. */ @LayoutlibDelegate /*package*/ static long elapsedRealtimeNano() { return System.nanoTime() - sBootTimeNano; } /** * Returns milliseconds running in the current thread. * Loading
tools/layoutlib/bridge/src/android/util/FloatMath_Delegate.java +38 −0 Original line number Diff line number Diff line Loading @@ -91,4 +91,42 @@ import com.android.tools.layoutlib.annotations.LayoutlibDelegate; /*package*/ static float sqrt(float value) { return (float)Math.sqrt(value); } /** * Returns the closest float approximation of the raising "e" to the power * of the argument. * * @param value to compute the exponential of * @return the exponential of value */ @LayoutlibDelegate /*package*/ static float exp(float value) { return (float)Math.exp(value); } /** * Returns the closest float approximation of the result of raising {@code * x} to the power of {@code y}. * * @param x the base of the operation. * @param y the exponent of the operation. * @return {@code x} to the power of {@code y}. */ @LayoutlibDelegate /*package*/ static float pow(float x, float y) { return (float)Math.pow(x, y); } /** * Returns {@code sqrt(}<i>{@code x}</i><sup>{@code 2}</sup>{@code +} <i> * {@code y}</i><sup>{@code 2}</sup>{@code )}. * * @param x a float number * @param y a float number * @return the hypotenuse */ @LayoutlibDelegate /*package*/ static float hypot(float x, float y) { return (float)Math.sqrt(x*x + y*y); } }