Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8240c97b authored by Chet Haase's avatar Chet Haase
Browse files

Un-hide FloatProperty and IntProperty

These simple utility classes (used internally since Property was first introduced
way back in Jellybean) are the best way to avoid autoboxing when using the Property
approach to ObjectAnimator. But since their hidden, developers have to use the
autoboxing version (Property, the superclass) or know to come up with their own
primitive-optimized property subclasses.

This CL simply un-hides these two classes to make them usable outside of the framework.

Issue #21722783 Make [Int|Float]Property public

Change-Id: I7f3a456d108bf48587d711255d3577cce3ac5e24
parent 0c5a924e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -34268,6 +34268,18 @@ package android.util {
  public deprecated class FloatMath {
  }
  public abstract class FloatProperty extends android.util.Property {
    ctor public FloatProperty(java.lang.String);
    method public final void set(T, java.lang.Float);
    method public abstract void setValue(T, float);
  }
  public abstract class IntProperty extends android.util.Property {
    ctor public IntProperty(java.lang.String);
    method public final void set(T, java.lang.Integer);
    method public abstract void setValue(T, int);
  }
  public final class JsonReader implements java.io.Closeable {
    ctor public JsonReader(java.io.Reader);
    method public void beginArray() throws java.io.IOException;
+12 −0
Original line number Diff line number Diff line
@@ -36565,6 +36565,18 @@ package android.util {
  public deprecated class FloatMath {
  }
  public abstract class FloatProperty extends android.util.Property {
    ctor public FloatProperty(java.lang.String);
    method public final void set(T, java.lang.Float);
    method public abstract void setValue(T, float);
  }
  public abstract class IntProperty extends android.util.Property {
    ctor public IntProperty(java.lang.String);
    method public final void set(T, java.lang.Integer);
    method public abstract void setValue(T, int);
  }
  public final class JsonReader implements java.io.Closeable {
    ctor public JsonReader(java.io.Reader);
    method public void beginArray() throws java.io.IOException;
+2 −6
Original line number Diff line number Diff line
@@ -15,18 +15,14 @@
 */
package android.util;

import android.util.Property;

/**
 * An implementation of {@link android.util.Property} to be used specifically with fields of type
 * <code>float</code>. This type-specific subclass enables performance benefit by allowing
 * calls to a {@link #set(Object, Float) set()} function that takes the primitive
 * calls to a {@link #setValue(Object, float) setValue()} function that takes the primitive
 * <code>float</code> type and avoids autoboxing and other overhead associated with the
 * <code>Float</code> class.
 *
 * @param <T> The class on which the Property is declared.
 *
 * @hide
 */
public abstract class FloatProperty<T> extends Property<T, Float> {

@@ -35,7 +31,7 @@ public abstract class FloatProperty<T> extends Property<T, Float> {
    }

    /**
     * A type-specific override of the {@link #set(Object, Float)} that is faster when dealing
     * A type-specific variant of {@link #set(Object, Float)} that is faster when dealing
     * with fields of type <code>float</code>.
     */
    public abstract void setValue(T object, float value);
+2 −6
Original line number Diff line number Diff line
@@ -15,18 +15,14 @@
 */
package android.util;

import android.util.Property;

/**
 * An implementation of {@link android.util.Property} to be used specifically with fields of type
 * <code>int</code>. This type-specific subclass enables performance benefit by allowing
 * calls to a {@link #set(Object, Integer) set()} function that takes the primitive
 * calls to a {@link #setValue(Object, int) setValue()} function that takes the primitive
 * <code>int</code> type and avoids autoboxing and other overhead associated with the
 * <code>Integer</code> class.
 *
 * @param <T> The class on which the Property is declared.
 *
 * @hide
 */
public abstract class IntProperty<T> extends Property<T, Integer> {

@@ -35,7 +31,7 @@ public abstract class IntProperty<T> extends Property<T, Integer> {
    }

    /**
     * A type-specific override of the {@link #set(Object, Integer)} that is faster when dealing
     * A type-specific variant of {@link #set(Object, Integer)} that is faster when dealing
     * with fields of type <code>int</code>.
     */
    public abstract void setValue(T object, int value);