Java Code Examples for android.util.Property

The following are top voted examples for showing how to use android.util.Property. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: LaunchEnr   File: Workspace.java   View source code 6 votes vote down vote up
/**
 * Moves the workspace UI in the provided direction.
 * @param direction the direction to move the workspace
 * @param translation the amount of shift.
 * @param alpha the alpha for the workspace page
 */
private void setWorkspaceTranslationAndAlpha(Direction direction, float translation, float alpha) {
    Property<View, Float> property = direction.viewProperty;
    mPageAlpha[direction.ordinal()] = alpha;
    float finalAlpha = mPageAlpha[0] * mPageAlpha[1];

    View currentChild = getChildAt(getCurrentPage());
    if (currentChild != null) {
        property.set(currentChild, translation);
        currentChild.setAlpha(finalAlpha);
    }

    // When the animation finishes, reset all pages, just in case we missed a page.
    if (Float.compare(translation, 0) == 0) {
        for (int i = getChildCount() - 1; i >= 0; i--) {
            View child = getChildAt(i);
            property.set(child, translation);
            child.setAlpha(finalAlpha);
        }
    }
}
 
Example 2
Project: FlickLauncher   File: Workspace.java   View source code 6 votes vote down vote up
/**
 * Moves the workspace UI in the provided direction.
 * @param direction the direction to move the workspace
 * @param translation the amount of shift.
 * @param alpha the alpha for the workspace page
 */
private void setWorkspaceTranslationAndAlpha(Direction direction, float translation, float alpha) {
    Property<View, Float> property = direction.viewProperty;
    mPageAlpha[direction.ordinal()] = alpha;
    float finalAlpha = mPageAlpha[0] * mPageAlpha[1];

    View currentChild = getChildAt(getCurrentPage());
    if (currentChild != null) {
        property.set(currentChild, translation);
        currentChild.setAlpha(finalAlpha);
    }

    // When the animation finishes, reset all pages, just in case we missed a page.
    if (Float.compare(translation, 0) == 0) {
        for (int i = getChildCount() - 1; i >= 0; i--) {
            View child = getChildAt(i);
            property.set(child, translation);
            child.setAlpha(finalAlpha);
        }
    }
}
 
Example 3
Project: SimpleUILauncher   File: Workspace.java   View source code 6 votes vote down vote up
/**
 * Moves the workspace UI in the provided direction.
 * @param direction the direction to move the workspace
 * @param translation the amount of shift.
 * @param alpha the alpha for the workspace page
 */
private void setWorkspaceTranslationAndAlpha(Direction direction, float translation, float alpha) {
    Property<View, Float> property = direction.viewProperty;
    mPageAlpha[direction.ordinal()] = alpha;
    float finalAlpha = mPageAlpha[0] * mPageAlpha[1];

    View currentChild = getChildAt(getCurrentPage());
    if (currentChild != null) {
        property.set(currentChild, translation);
        currentChild.setAlpha(finalAlpha);
    }

    // When the animation finishes, reset all pages, just in case we missed a page.
    if (Float.compare(translation, 0) == 0) {
        for (int i = getChildCount() - 1; i >= 0; i--) {
            View child = getChildAt(i);
            property.set(child, translation);
            child.setAlpha(finalAlpha);
        }
    }
}
 
Example 4
Project: dashboard   File: AnimatorFactory.java   View source code 6 votes vote down vote up
private static AnimatorSet createTranslateAnimatorWithScaling(View view, Property<View, Float> translateProperty, Property<View, Float> scaleProperty, float start, float end, float scale, int duration) {
    Animator translateAnimator = ObjectAnimator.ofFloat(view, translateProperty, start, end);
    translateAnimator.setDuration(duration);

    Animator scaleAnimator1 = ObjectAnimator.ofFloat(view, scaleProperty, 1, scale);
    scaleAnimator1.setDuration(duration / 2);
    Animator scaleAnimator2 = ObjectAnimator.ofFloat(view, scaleProperty, scale, 1);
    scaleAnimator2.setDuration(duration / 2);

    AnimatorSet scaleAnimatorSet = new AnimatorSet();
    scaleAnimatorSet.playSequentially(scaleAnimator1, scaleAnimator2);

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(translateAnimator, scaleAnimatorSet);

    return animatorSet;
}
 
Example 5
Project: FMTech   File: gyo.java   View source code 6 votes vote down vote up
public gyo()
{
  Map localMap1 = this.c;
  Property[] arrayOfProperty1 = new Property[2];
  arrayOfProperty1[0] = gyt.a;
  arrayOfProperty1[1] = gyt.b;
  localMap1.put("position", arrayOfProperty1);
  this.d.put("position", new String[] { "x", "y" });
  Map localMap2 = this.c;
  Property[] arrayOfProperty2 = new Property[2];
  arrayOfProperty2[0] = View.SCALE_X;
  arrayOfProperty2[1] = View.SCALE_Y;
  localMap2.put("scale", arrayOfProperty2);
  this.d.put("scale", new String[] { "sx", "sy" });
  Map localMap3 = this.c;
  Property[] arrayOfProperty3 = new Property[1];
  arrayOfProperty3[0] = View.ALPHA;
  localMap3.put("opacity", arrayOfProperty3);
  this.d.put("opacity", null);
}
 
Example 6
Project: FMTech   File: gyo.java   View source code 6 votes vote down vote up
static float a(gyp paramgyp, Property<?, ?> paramProperty, double paramDouble)
{
  if (!paramgyp.a(paramProperty)) {
    throw new bm("Cannot animate position if stage size was not defined");
  }
  float f = 1.0F;
  if (paramProperty == gyt.a) {
    f = paramgyp.a;
  }
  for (;;)
  {
    return f * (float)paramDouble;
    if (paramProperty == gyt.b) {
      f = paramgyp.b;
    }
  }
}
 
Example 7
Project: Noyze   File: SettingsHelper.java   View source code 6 votes vote down vote up
/**
 * Retrieves the value stored in {@link android.content.SharedPreferences} for a
 * given {@link android.util.Property} associated with a VolumePanel.
 * @return The given value, {@code defVal} if none was set, or null is the
 * value could not be retrieved.
 * @throws ClassCastException If a type error occurred between SP and Property.
 */
@SuppressWarnings("unchecked")
public <T, E> E getProperty(Class<T> clazz, Property<T, E> property, E defVal)
        throws ClassCastException {
    Class<E> type = property.getType();
    String name = getName(clazz, property);

    // Handle all types supported by SharedPreferences.
    if (type.equals(Integer.TYPE) || type.equals(Integer.class))
        return (E) Integer.valueOf(mPreferences.getInt(name, (Integer) defVal));
    else if (type.equals(String.class) || type.equals(CharSequence.class))
        return (E) mPreferences.getString(name, ((defVal == null) ? (String) defVal : defVal.toString()));
    else if (type.equals(Boolean.TYPE) || type.equals(Boolean.class))
        return (E) Boolean.valueOf(mPreferences.getBoolean(name, (Boolean) defVal));
    else if (type.equals(Long.TYPE) || type.equals(Long.class))
        return (E) Long.valueOf(mPreferences.getLong(name, (Long) defVal));
    else if (type.equals(Float.TYPE) || type.equals(Float.class))
        return (E) Float.valueOf(mPreferences.getFloat(name, (Float) defVal));
    else if (type.getClass().isAssignableFrom(Set.class))
        return (E) mPreferences.getStringSet(name, (Set<String>) defVal);

    return defVal;
}
 
Example 8
Project: love   File: SqlBuilder.java   View source code 6 votes vote down vote up
/**
 * 将游标转换为业务实体
 * @param cursor
 * @param table
 * @return
 */
public static  <T> T cursor2Entity(Cursor cursor, String table){
    try {
        if(cursor!=null ){
            Class<?> clazz = ReflectBeanUtil.getClazzByBeanName(geneClassName(table));
            T  entity = (T) clazz.newInstance();
            Map<String, Field> fields = ReflectBeanUtil.getFields(geneClassName(table));
            int columnCount = cursor.getColumnCount();
            if(columnCount>0){
                for(int i=0;i<columnCount;i++){
                    String column = cursor.getColumnName(i);
                    String value = cursor.getString(i);
                    Field field = fields.get(column);
                    Property property = Property.of(clazz, field.getType(), column);
                    property.set(entity, value);
                }
                return entity;
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
 
Example 9
Project: QuizUpWinner   File: VsActivityAnimationHelper.java   View source code 6 votes vote down vote up
private static AnimatorSet getOpponentSlideOutAnimator(Activity paramActivity, Point paramPoint)
{
  AnimatorSet localAnimatorSet = new AnimatorSet();
  View localView1 = paramActivity.findViewById(2131296583);
  Property localProperty1 = View.TRANSLATION_X;
  float[] arrayOfFloat1 = new float[2];
  arrayOfFloat1[0] = 0.0F;
  arrayOfFloat1[1] = paramPoint.x;
  ObjectAnimator localObjectAnimator = ObjectAnimator.ofFloat(localView1, localProperty1, arrayOfFloat1);
  View localView2 = paramActivity.findViewById(2131296272);
  Property localProperty2 = View.TRANSLATION_X;
  float[] arrayOfFloat2 = new float[2];
  arrayOfFloat2[0] = 0.0F;
  arrayOfFloat2[1] = paramPoint.x;
  localAnimatorSet.playTogether(new Animator[] { localObjectAnimator, ObjectAnimator.ofFloat(localView2, localProperty2, arrayOfFloat2) });
  return localAnimatorSet;
}
 
Example 10
Project: adt-leanback-support   File: Slide.java   View source code 6 votes vote down vote up
private Animator createAnimation(final View view, Property<View, Float> property,
        float start, float end, float terminalValue, TimeInterpolator interpolator,
        int finalVisibility) {
    float[] startPosition = (float[]) view.getTag(R.id.lb_slide_transition_value);
    if (startPosition != null) {
        start = View.TRANSLATION_Y == property ? startPosition[1] : startPosition[0];
        view.setTag(R.id.lb_slide_transition_value, null);
    }
    final ObjectAnimator anim = ObjectAnimator.ofFloat(view, property, start, end);

    SlideAnimatorListener listener = new SlideAnimatorListener(view, property, terminalValue, end,
            finalVisibility);
    anim.addListener(listener);
    anim.addPauseListener(listener);
    anim.setInterpolator(interpolator);
    return anim;
}
 
Example 11
Project: Noyze   File: SettingsHelper.java   View source code 6 votes vote down vote up
/**
 * Retrieves the value stored in {@link android.content.SharedPreferences} for a
 * given {@link android.util.Property} associated with a VolumePanel.
 * @return The given value, {@code defVal} if none was set, or null is the
 * value could not be retrieved.
 * @throws ClassCastException If a type error occurred between SP and Property.
 */
@SuppressWarnings("unchecked")
public <T, E> E getProperty(Class<T> clazz, Property<T, E> property, E defVal)
        throws ClassCastException {
    Class<E> type = property.getType();
    String name = getName(clazz, property);

    // Handle all types supported by SharedPreferences.
    if (type.equals(Integer.TYPE) || type.equals(Integer.class))
        return (E) Integer.valueOf(mPreferences.getInt(name, (Integer) defVal));
    else if (type.equals(String.class) || type.equals(CharSequence.class))
        return (E) mPreferences.getString(name, ((defVal == null) ? (String) defVal : defVal.toString()));
    else if (type.equals(Boolean.TYPE) || type.equals(Boolean.class))
        return (E) Boolean.valueOf(mPreferences.getBoolean(name, (Boolean) defVal));
    else if (type.equals(Long.TYPE) || type.equals(Long.class))
        return (E) Long.valueOf(mPreferences.getLong(name, (Long) defVal));
    else if (type.equals(Float.TYPE) || type.equals(Float.class))
        return (E) Float.valueOf(mPreferences.getFloat(name, (Float) defVal));
    else if (type.getClass().isAssignableFrom(Set.class))
        return (E) mPreferences.getStringSet(name, (Set<String>) defVal);

    return defVal;
}
 
Example 12
Project: plusTimer   File: CurrentSessionTimerFragment.java   View source code 6 votes vote down vote up
private void invalidateScrambleShadow(final boolean overrideShowShadow) {
    Runnable animate = () -> {
        if (mScrambleElevationAnimator != null) {
            mScrambleElevationAnimator.cancel();
        }
        Property<View, Float> property;
        View view;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            property = View.TRANSLATION_Z;
            view = mScrambleText;
        } else {
            property = View.ALPHA;
            view = mScrambleTextShadow;
        }
        mScrambleElevationAnimator = ObjectAnimator.ofFloat(view,
                property, getScrambleTextElevationOrShadowAlpha(overrideShowShadow));
        mScrambleElevationAnimator.setDuration(150);
        mScrambleElevationAnimator.start();
    };
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        mScrambleText.postOnAnimation(animate);
    } else {
        mScrambleText.post(animate);
    }
}
 
Example 13
Project: GitHub   File: ButterKnife.java   View source code 5 votes vote down vote up
/**
 * Apply the specified {@code value} across the {@code list} of views using the {@code property}.
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) // http://b.android.com/213630
@RequiresApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@UiThread
public static <T extends View, V> void apply(@NonNull List<T> list,
    @NonNull Property<? super T, V> setter, V value) {
  //noinspection ForLoopReplaceableByForEach
  for (int i = 0, count = list.size(); i < count; i++) {
    setter.set(list.get(i), value);
  }
}
 
Example 14
Project: GitHub   File: ButterKnife.java   View source code 5 votes vote down vote up
/**
 * Apply the specified {@code value} across the {@code array} of views using the {@code property}.
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) // http://b.android.com/213630
@RequiresApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@UiThread
public static <T extends View, V> void apply(@NonNull T[] array,
    @NonNull Property<? super T, V> setter, V value) {
  //noinspection ForLoopReplaceableByForEach
  for (int i = 0, count = array.length; i < count; i++) {
    setter.set(array[i], value);
  }
}
 
Example 15
Project: GitHub   File: ButterKnife.java   View source code 5 votes vote down vote up
/** Apply {@code value} to {@code view} using {@code property}. */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) // http://b.android.com/213630
@RequiresApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@UiThread
public static <T extends View, V> void apply(@NonNull T view,
    @NonNull Property<? super T, V> setter, V value) {
  setter.set(view, value);
}
 
Example 16
Project: LaunchEnr   File: LauncherAnimUtils.java   View source code 5 votes vote down vote up
public static ObjectAnimator ofFloat(View target, Property<View, Float> property,
        float... values) {
    ObjectAnimator anim = ObjectAnimator.ofFloat(target, property, values);
    cancelOnDestroyActivity(anim);
    new FirstFrameAnimatorHelper(anim, target);
    return anim;
}
 
Example 17
Project: LaunchEnr   File: Workspace.java   View source code 5 votes vote down vote up
/**
 * Moves the Hotseat UI in the provided direction.
 * @param direction the direction to move the workspace
 * @param translation the amount of shift.
 * @param alpha the alpha for the hotseat page
 */
public void setHotseatTranslationAndAlpha(Direction direction, float translation, float alpha) {
    Property<View, Float> property = direction.viewProperty;
    // Skip the page indicator movement in the vertical bar layout
    if (direction != Direction.Y || !mLauncher.getDeviceProfile().isVerticalBarLayout()) {
        property.set(mPageIndicator, translation);
    }
    property.set(mLauncher.getHotseat(), translation);
    setHotseatAlphaAtIndex(alpha, direction.ordinal());
}
 
Example 18
Project: weex-3d-map   File: WXAnimationBean.java   View source code 5 votes vote down vote up
private static @NonNull Map<Property<View, Float>, Float> createDefaultTransform(){
  Map<Property<View, Float>, Float> defaultMap=
      WXDataStructureUtil.newHashMapWithExpectedSize(5);
  defaultMap.put(View.TRANSLATION_X, 0f);
  defaultMap.put(View.TRANSLATION_Y, 0f);
  defaultMap.put(View.SCALE_X, 1f);
  defaultMap.put(View.SCALE_Y, 1f);
  defaultMap.put(View.ROTATION, 0f);
  return defaultMap;
}
 
Example 19
Project: weex-3d-map   File: WXAnimationBean.java   View source code 5 votes vote down vote up
private void initHolders(){
  for (Map.Entry<Property<View, Float>, Float> entry : transformMap.entrySet()) {
    holders.add(PropertyValuesHolder.ofFloat(entry.getKey(), entry.getValue()));
  }
  if (!TextUtils.isEmpty(opacity)) {
    holders.add(PropertyValuesHolder.ofFloat(View.ALPHA, WXUtils.fastGetFloat(opacity, 3)));
  }
}
 
Example 20
Project: ucar-weex-core   File: WXAnimationBean.java   View source code 5 votes vote down vote up
private static @NonNull Map<Property<View, Float>, Float> createDefaultTransform(){
  Map<Property<View, Float>, Float> defaultMap= new ArrayMap<>(5);
  defaultMap.put(View.TRANSLATION_X, 0f);
  defaultMap.put(View.TRANSLATION_Y, 0f);
  defaultMap.put(View.SCALE_X, 1f);
  defaultMap.put(View.SCALE_Y, 1f);
  defaultMap.put(View.ROTATION, 0f);
  return defaultMap;
}
 
Example 21
Project: ucar-weex-core   File: WXAnimationBean.java   View source code 5 votes vote down vote up
private void initHolders(){
  for (Map.Entry<Property<View, Float>, Float> entry : transformMap.entrySet()) {
    holders.add(PropertyValuesHolder.ofFloat(entry.getKey(), entry.getValue()));
  }
  if (!TextUtils.isEmpty(opacity)) {
    holders.add(PropertyValuesHolder.ofFloat(View.ALPHA, WXUtils.fastGetFloat(opacity, 3)));
  }
}
 
Example 22
Project: magellan   File: DefaultTransition.java   View source code 5 votes vote down vote up
private AnimatorSet createAnimator(View from, View to, NavigationType navType, Direction direction) {
  Property<View, Float> axis;
  int fromTranslation;
  int toTranslation;
  int sign = direction.sign();

  switch (navType) {
    case GO:
      axis = View.TRANSLATION_X;
      fromTranslation = sign * -from.getWidth();
      toTranslation = sign * to.getWidth();
      break;
    case SHOW:
      axis = View.TRANSLATION_Y;
      fromTranslation = direction == FORWARD ? 0 : from.getHeight();
      toTranslation = direction == BACKWARD ? 0 : to.getHeight();
      break;
    default:
      axis = View.TRANSLATION_X;
      fromTranslation = 0;
      toTranslation = 0;
      break;
  }
  AnimatorSet set = new AnimatorSet();
  if (from != null) {
    set.play(ObjectAnimator.ofFloat(from, axis, 0, fromTranslation));
  }
  set.play(ObjectAnimator.ofFloat(to, axis, toTranslation, 0));
  return set;
}
 
Example 23
Project: boohee_v5.6   File: ButterKnife.java   View source code 5 votes vote down vote up
@TargetApi(14)
public static <T extends View, V> void apply(List<T> list, Property<? super T, V> setter, V value) {
    int count = list.size();
    for (int i = 0; i < count; i++) {
        setter.set(list.get(i), value);
    }
}
 
Example 24
Project: FlickLauncher   File: LauncherAnimUtils.java   View source code 5 votes vote down vote up
public static ObjectAnimator ofFloat(View target, Property<View, Float> property,
        float... values) {
    ObjectAnimator anim = ObjectAnimator.ofFloat(target, property, values);
    cancelOnDestroyActivity(anim);
    new FirstFrameAnimatorHelper(anim, target);
    return anim;
}
 
Example 25
Project: FlickLauncher   File: Workspace.java   View source code 5 votes vote down vote up
/**
 * Moves the Hotseat UI in the provided direction.
 * @param direction the direction to move the workspace
 * @param translation the amount of shift.
 * @param alpha the alpha for the hotseat page
 */
public void setHotseatTranslationAndAlpha(Direction direction, float translation, float alpha) {
    Property<View, Float> property = direction.viewProperty;
    // Skip the page indicator movement in the vertical bar layout
    if (direction != Direction.Y || !mLauncher.getDeviceProfile().isVerticalBarLayout()) {
        property.set(mPageIndicator, translation);
    }
    property.set(mLauncher.getHotseat(), translation);
    setHotseatAlphaAtIndex(alpha, direction.ordinal());
}
 
Example 26
Project: android_additive_animations   File: AdditiveAnimation.java   View source code 5 votes vote down vote up
/**
 * The preferred constructor to use when animating properties. If you use this constructor, you
 * don't need to worry about the logic to apply the changes. This is taken care of by using the
 * Setter provided by `property`.
 */
public AdditiveAnimation(T target, Property<T, Float> property, float startValue, float targetValue) {
    mTarget = target;
    mProperty = property;
    mTargetValue = targetValue;
    mStartValue = startValue;
    setTag(property.getName());
}
 
Example 27
Project: android_additive_animations   File: AdditiveAnimation.java   View source code 5 votes vote down vote up
public AdditiveAnimation(T target, Property<T, Float> property, float startValue, Path path, PathEvaluator.PathMode pathMode, PathEvaluator sharedEvaluator) {
    mTarget = target;
    mProperty = property;
    mStartValue = startValue;
    mPath = path;
    mSharedPathEvaluator = sharedEvaluator;
    mPathMode = pathMode;
    mTargetValue = evaluateAt(1f);
    setTag(property.getName());
}
 
Example 28
Project: android_additive_animations   File: AdditiveAnimationStateManager.java   View source code 5 votes vote down vote up
Float getActualPropertyValue(Property<T, Float> property) {
    Float lastTarget = getLastTargetValue(property.getName());
    if(lastTarget == null) {
        lastTarget = property.get(mAnimationTargetView);
    }
    return lastTarget;
}
 
Example 29
Project: android_additive_animations   File: BaseAdditiveAnimator.java   View source code 5 votes vote down vote up
protected final T animatePropertyBy(Property<V, Float> property, float by) {
    initValueAnimatorIfNeeded();
    float currentTarget = getTargetPropertyValue(property);
    if(getQueuedPropertyValue(property.getName()) != null) {
        currentTarget = getQueuedPropertyValue(property.getName());
    }
    return animate(createAnimation(property, currentTarget + by));
}
 
Example 30
Project: android_additive_animations   File: BaseAdditiveAnimator.java   View source code 5 votes vote down vote up
protected final T animatePropertiesAlongPath(Property<V, Float> xProperty, Property<V, Float> yProperty, Property<V, Float> rotationProperty, Path path) {
    PathEvaluator sharedEvaluator = new PathEvaluator();
    if(xProperty != null) {
        animate(xProperty, path, PathEvaluator.PathMode.X, sharedEvaluator);
    }
    if(yProperty != null) {
        animate(yProperty, path, PathEvaluator.PathMode.Y, sharedEvaluator);
    }
    if(rotationProperty != null) {
        animate(rotationProperty, path, PathEvaluator.PathMode.ROTATION, sharedEvaluator);
    }
    return self();
}
 
Example 31
Project: SimpleUILauncher   File: LauncherAnimUtils.java   View source code 5 votes vote down vote up
public static ObjectAnimator ofFloat(View target, Property<View, Float> property,
        float... values) {
    ObjectAnimator anim = ObjectAnimator.ofFloat(target, property, values);
    cancelOnDestroyActivity(anim);
    new FirstFrameAnimatorHelper(anim, target);
    return anim;
}
 
Example 32
Project: SimpleUILauncher   File: Workspace.java   View source code 5 votes vote down vote up
/**
 * Moves the Hotseat UI in the provided direction.
 * @param direction the direction to move the workspace
 * @param translation the amount of shift.
 * @param alpha the alpha for the hotseat page
 */
public void setHotseatTranslationAndAlpha(Direction direction, float translation, float alpha) {
    Property<View, Float> property = direction.viewProperty;
    // Skip the page indicator movement in the vertical bar layout
    if (direction != Direction.Y || !mLauncher.getDeviceProfile().isVerticalBarLayout()) {
        property.set(mPageIndicator, translation);
    }
    property.set(mLauncher.getHotseat(), translation);
    setHotseatAlphaAtIndex(alpha, direction.ordinal());
}
 
Example 33
Project: weex-uikit   File: WXAnimationBean.java   View source code 5 votes vote down vote up
private static @NonNull Map<Property<View, Float>, Float> createDefaultTransform(){
  Map<Property<View, Float>, Float> defaultMap= new ArrayMap<>(5);
  defaultMap.put(View.TRANSLATION_X, 0f);
  defaultMap.put(View.TRANSLATION_Y, 0f);
  defaultMap.put(View.SCALE_X, 1f);
  defaultMap.put(View.SCALE_Y, 1f);
  defaultMap.put(View.ROTATION, 0f);
  return defaultMap;
}
 
Example 34
Project: weex-uikit   File: WXAnimationBean.java   View source code 5 votes vote down vote up
private void initHolders(){
  for (Map.Entry<Property<View, Float>, Float> entry : transformMap.entrySet()) {
    holders.add(PropertyValuesHolder.ofFloat(entry.getKey(), entry.getValue()));
  }
  if (!TextUtils.isEmpty(opacity)) {
    holders.add(PropertyValuesHolder.ofFloat(View.ALPHA, WXUtils.fastGetFloat(opacity, 3)));
  }
}
 
Example 35
Project: weex-3d-map   File: WXAnimationBean.java   View source code 5 votes vote down vote up
private static @NonNull Map<Property<View, Float>, Float> createDefaultTransform(){
  Map<Property<View, Float>, Float> defaultMap=
      WXDataStructureUtil.newHashMapWithExpectedSize(5);
  defaultMap.put(View.TRANSLATION_X, 0f);
  defaultMap.put(View.TRANSLATION_Y, 0f);
  defaultMap.put(View.SCALE_X, 1f);
  defaultMap.put(View.SCALE_Y, 1f);
  defaultMap.put(View.ROTATION, 0f);
  return defaultMap;
}
 
Example 36
Project: weex-3d-map   File: WXAnimationBean.java   View source code 5 votes vote down vote up
private void initHolders(){
  for (Map.Entry<Property<View, Float>, Float> entry : transformMap.entrySet()) {
    holders.add(PropertyValuesHolder.ofFloat(entry.getKey(), entry.getValue()));
  }
  if (!TextUtils.isEmpty(opacity)) {
    holders.add(PropertyValuesHolder.ofFloat(View.ALPHA, WXUtils.fastGetFloat(opacity, 3)));
  }
}
 
Example 37
Project: Android-ButterKinfe   File: ButterKnife.java   View source code 5 votes vote down vote up
/**
 * Apply the specified {@code value} across the {@code list} of views using the {@code property}.
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) // http://b.android.com/213630
@RequiresApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@UiThread
public static <T extends View, V> void apply(@NonNull List<T> list,
    @NonNull Property<? super T, V> setter, V value) {
  //noinspection ForLoopReplaceableByForEach
  for (int i = 0, count = list.size(); i < count; i++) {
    setter.set(list.get(i), value);
  }
}
 
Example 38
Project: Android-ButterKinfe   File: ButterKnife.java   View source code 5 votes vote down vote up
/**
 * Apply the specified {@code value} across the {@code array} of views using the {@code property}.
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) // http://b.android.com/213630
@RequiresApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@UiThread
public static <T extends View, V> void apply(@NonNull T[] array,
    @NonNull Property<? super T, V> setter, V value) {
  //noinspection ForLoopReplaceableByForEach
  for (int i = 0, count = array.length; i < count; i++) {
    setter.set(array[i], value);
  }
}
 
Example 39
Project: Android-ButterKinfe   File: ButterKnife.java   View source code 5 votes vote down vote up
/** Apply {@code value} to {@code view} using {@code property}. */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) // http://b.android.com/213630
@RequiresApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@UiThread
public static <T extends View, V> void apply(@NonNull T view,
    @NonNull Property<? super T, V> setter, V value) {
  setter.set(view, value);
}
 
Example 40
Project: truth-android   File: PropertySubject.java   View source code 5 votes vote down vote up
public static <T, V> SubjectFactory<PropertySubject<T, V>, Property<T, V>> type() {
  return new SubjectFactory<PropertySubject<T, V>, Property<T, V>>() {
    @Override
    public PropertySubject<T, V> getSubject(FailureStrategy fs, Property<T, V> that) {
      return new PropertySubject<T, V>(fs, that);
    }
  };
}