android.support.annotation.Size类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(80)

本文整理了Java中android.support.annotation.Size类的一些代码示例,展示了Size类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Size类的具体详情如下:
包路径:android.support.annotation.Size
类名称:Size

Size介绍

暂无

代码示例

代码示例来源:origin: dinuscxj/LoadingDrawable

public Builder setLevelColors(@Size(3) int[] colors) {
  this.mLevelColors = colors;
  return this;
}

代码示例来源:origin: ZacSweers/inspector

long exact = size.value();
long min = size.min();
long max = size.max();
long multiple = size.multiple();
if (exact != -1) {
 validationBlock.beginControlFlow("if ($L != $L)", sizeVar, exact)

代码示例来源:origin: io.sweers.inspector/inspector-android-compiler-extension

long exact = size.value();
long min = size.min();
long max = size.max();
long multiple = size.multiple();
if (exact != -1) {
 validationBlock.beginControlFlow("if ($L != $L)", sizeVar, exact)

代码示例来源:origin: dinuscxj/LoadingDrawable

public Builder setColors(@Size(2) int[] colors) {
  this.mColors = colors;
  return this;
}

代码示例来源:origin: Rajawali/Rajawali

/**
 * Returns the backing array of this {@link Matrix4}.
 *
 * @return double array containing the backing array. The returned array is owned
 * by this {@link Matrix4} and is subject to change as the implementation sees fit.
 */
@NonNull
@Size(16)
public double[] getDoubleValues() {
  return m;
}

代码示例来源:origin: Rajawali/Rajawali

/**
 * Fills x, y, z values into first three positions in the
 * supplied array, if it is large enough to accommodate
 * them.
 *
 * @param array The array to be populated
 *
 * @return The passed array with the xyz values inserted
 */
@NonNull
@Size(min = 3)
public double[] toArray(@Size(min = 3) double[] array) {
  if (array != null && array.length >= 3) {
    array[0] = x;
    array[1] = y;
    array[2] = z;
  }
  return array;
}

代码示例来源:origin: Rajawali/Rajawali

/**
 * Copies the backing array of this {@link Matrix4} into the provided double array.
 *
 * @param doubleArray double array to store the copy in. Must be at least 16 elements long.
 *                    Entries will be placed starting at the 0 index.
 */
public void toArray(@NonNull @Size(min = 16) double[] doubleArray) {
  System.arraycopy(m, 0, doubleArray, 0, 16);
}

代码示例来源:origin: Rajawali/Rajawali

@NonNull
public Matrix4 setAll(@NonNull @Size(min = 16) float[] matrix) {
  // @formatter:off
  m[0] = matrix[0];	m[1] = matrix[1];	m[2] = matrix[2];	m[3] = matrix[3];
  m[4] = matrix[4];	m[5] = matrix[5];	m[6] = matrix[6];	m[7] = matrix[7];
  m[8] = matrix[8];	m[9] = matrix[9];	m[10] = matrix[10];	m[11] = matrix[11];
  m[12] = matrix[12];	m[13] = matrix[13];	m[14] = matrix[14];	m[15] = matrix[15];
  return this;
  // @formatter:on
}

代码示例来源:origin: Rajawali/Rajawali

/**
 * Constructs a new {@link Vector3} with components initialized from the input double array.
 *
 * @param values A double array of values to be parsed for each component.
 *
 * @throws IllegalArgumentException if there are fewer than 3 values in the array.
 */
public Vector3(@NonNull @Size(min = 3) double[] values) throws IllegalArgumentException {
  if (values.length < 3)
    throw new IllegalArgumentException("Vector3 must be initialized with an array length of at least 3.");
  x = values[0];
  y = values[1];
  z = values[2];
}

代码示例来源:origin: dinuscxj/LoadingDrawable

@Size(2)
private int[] mColors;

代码示例来源:origin: Rajawali/Rajawali

/**
 * Copies the backing array of this {@link Matrix4} into the provided float array.
 *
 * @param floatArray float array to store the copy in. Must be at least 16 elements long.
 *                   Entries will be placed starting at the 0 index.
 */
public void toFloatArray(@NonNull @Size(min = 16) float[] floatArray) {
  // @formatter:off
  floatArray[0] = (float)m[0];	floatArray[1] = (float)m[1];	floatArray[2] = (float)m[2];	floatArray[3]
      = (float)m[3];
  floatArray[4] = (float)m[4];	floatArray[5] = (float)m[5];	floatArray[6] = (float)m[6];	floatArray[7]
      = (float)m[7];
  floatArray[8] = (float)m[8];	floatArray[9] = (float)m[9];	floatArray[10] = (float)m[10];	floatArray[11]
      = (float)m[11];
  floatArray[12] = (float)m[12];	floatArray[13] = (float)m[13];	floatArray[14] = (float)m[14];	floatArray[15]
      = (float)m[15];
  // @formatter:on
}

代码示例来源:origin: dinuscxj/LoadingDrawable

@Size(3)
private int[] mLevelColors;

代码示例来源:origin: Rajawali/Rajawali

/**
 * Multiplies this {@link Vector3} and the provided 4x4 matrix.
 *
 * @param matrix double[16] representation of a 4x4 matrix.
 *
 * @return A reference to this {@link Vector3} to facilitate chaining.
 */
@NonNull
public Vector3 multiply(@NonNull @Size(min = 16) double[] matrix) {
  double vx = x, vy = y, vz = z;
  x = vx * matrix[Matrix4.M00] + vy * matrix[Matrix4.M01] + vz * matrix[Matrix4.M02] + matrix[Matrix4.M03];
  y = vx * matrix[Matrix4.M10] + vy * matrix[Matrix4.M11] + vz * matrix[Matrix4.M12] + matrix[Matrix4.M13];
  z = vx * matrix[Matrix4.M20] + vy * matrix[Matrix4.M21] + vz * matrix[Matrix4.M22] + matrix[Matrix4.M23];
  return this;
}

代码示例来源:origin: Rajawali/Rajawali

/**
 * Constructs a new {@link Vector3} with components initialized from the input {@link String} array.
 *
 * @param values A {@link String} array of values to be parsed for each component.
 *
 * @throws IllegalArgumentException if there are fewer than 3 values in the array.
 * @throws NumberFormatException if there is a problem parsing the {@link String} values into doubles.
 */
public Vector3(@NonNull @Size(min = 3) String[] values) throws IllegalArgumentException, NumberFormatException {
  this(Float.parseFloat(values[0]), Float.parseFloat(values[1]), Float.parseFloat(values[2]));
}

代码示例来源:origin: CarGuo/GSYVideoPlayer

/**
 * 倍速播放
 *
 * @param speed 倍速播放,默认为1
 * @param pitch 音量缩放,默认为1,修改会导致声音变调
 */
public void setSpeed(@Size(min = 0) float speed, @Size(min = 0) float pitch) {
  PlaybackParameters playbackParameters = new PlaybackParameters(speed, pitch);
  mSpeedPlaybackParameters = playbackParameters;
  if (mInternalPlayer != null) {
    mInternalPlayer.setPlaybackParameters(playbackParameters);
  }
}

代码示例来源:origin: Rajawali/Rajawali

/**
 * Sets the elements of this {@link Matrix4} based on the provided double array.
 * The array length must be greater than or equal to 16 and the array will be copied
 * from the 0 index.
 *
 * @param matrix double array containing the values for the matrix in column major order.
 *               The array is not modified or referenced after this constructor completes.
 *
 * @return A reference to this {@link Matrix4} to facilitate chaining.
 */
@NonNull
public Matrix4 setAll(@NonNull @Size(min = 16) double[] matrix) {
  System.arraycopy(matrix, 0, m, 0, 16);
  return this;
}

代码示例来源:origin: oasisfeng/condom

private CondomContext(final CondomCore condom, final @Nullable Context app_context, final @Nullable @Size(max=16) String tag) {
  super(condom.mBase);
  final Context base = condom.mBase;
  mCondom = condom;
  mApplicationContext = app_context != null ? app_context : this;
  mBaseContext = new Lazy<Context>() { @Override protected Context create() {
    return new PseudoContextImpl(CondomContext.this);
  }};
  TAG = CondomCore.buildLogTag("Condom", "Condom.", tag);
}

代码示例来源:origin: oasisfeng/condom

CondomApplication(final CondomCore condom, final Application app, final @Nullable @Size(max = 13) String tag) {
  mCondom = condom;
  mApplication = app;
  TAG = CondomCore.buildLogTag("CondomApp", "CondomApp.", tag);
}

代码示例来源:origin: Rajawali/Rajawali

/**
 * Constructs a new {@link Matrix4} based on the provided float array. The array length
 * must be greater than or equal to 16 and the array will be copied from the 0 index.
 *
 * @param matrix float array containing the values for the matrix in column major order.
 *               The array is not modified or referenced after this constructor completes.
 */
public Matrix4(@NonNull @Size(min = 16) float[] matrix) {
  this(ArrayUtils.convertFloatsToDoubles(matrix));
}

代码示例来源:origin: Rajawali/Rajawali

public void toRotationMatrix(@NonNull @Size(min = 16) double[] matrix) {
  final double x2 = x * x;
  final double y2 = y * y;

相关文章