微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.util.Property的实例源码

项目:LaunchEnr    文件Workspace.java   
/**
 * 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);
        }
    }
}
项目:FlickLauncher    文件Workspace.java   
/**
 * 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,translation);
            child.setAlpha(finalAlpha);
        }
    }
}
项目:SimpleUILauncher    文件Workspace.java   
/**
 * 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,translation);
            child.setAlpha(finalAlpha);
        }
    }
}
项目:dashboard    文件AnimatorFactory.java   
private static AnimatorSet createTranslateAnimatorWithScaling(View view,Property<View,Float> translateProperty,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,scale,1);
    scaleAnimator2.setDuration(duration / 2);

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

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

    return animatorSet;
}
项目:FMTech    文件gyo.java   
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);
}
项目:FMTech    文件gyo.java   
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;
    }
  }
}
项目:Noyze    文件SettingsHelper.java   
/**
 * 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;
}
项目:love    文件sqlBuilder.java   
/**
 * 将游标转换为业务实体
 * @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;
}
项目:QuizUpWinner    文件VsActivityAnimationHelper.java   
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;
}
项目:adt-leanback-support    文件Slide.java   
private Animator createAnimation(final View view,Float> property,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,end);

    SlideAnimatorListener listener = new SlideAnimatorListener(view,terminalValue,end,finalVisibility);
    anim.addListener(listener);
    anim.addPauseListener(listener);
    anim.setInterpolator(interpolator);
    return anim;
}
项目:plusTimer    文件CurrentSessionTimerFragment.java   
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,getScrambleTextElevationorShadowAlpha(overrideShowShadow));
        mScrambleElevationAnimator.setDuration(150);
        mScrambleElevationAnimator.start();
    };
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        mScrambleText.postOnAnimation(animate);
    } else {
        mScrambleText.post(animate);
    }
}
项目:GitHub    文件ButterKnife.java   
/**
 * 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);
  }
}
项目:GitHub    文件ButterKnife.java   
/**
 * 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,count = array.length; i < count; i++) {
    setter.set(array[i],value);
  }
}
项目:GitHub    文件ButterKnife.java   
/** 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,V value) {
  setter.set(view,value);
}
项目:LaunchEnr    文件LauncherAnimutils.java   
public static ObjectAnimator ofFloat(View target,float... values) {
    ObjectAnimator anim = ObjectAnimator.ofFloat(target,values);
    cancelOnDestroyActivity(anim);
    new FirstFrameAnimatorHelper(anim,target);
    return anim;
}
项目:LaunchEnr    文件Workspace.java   
/**
 * 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> 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());
}
项目:weex-3d-map    文件WXAnimationBean.java   
private static @NonNull Map<Property<View,Float>,Float> createDefaultTransform(){
  Map<Property<View,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;
}
项目:weex-3d-map    文件WXAnimationBean.java   
private void initHolders(){
  for (Map.Entry<Property<View,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)));
  }
}
项目:ucar-weex-core    文件WXAnimationBean.java   
private static @NonNull Map<Property<View,Float> defaultMap= new ArrayMap<>(5);
  defaultMap.put(View.TRANSLATION_X,0f);
  return defaultMap;
}
项目:ucar-weex-core    文件WXAnimationBean.java   
private void initHolders(){
  for (Map.Entry<Property<View,3)));
  }
}
项目:magellan    文件DefaultTransition.java   
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,fromTranslation));
  }
  set.play(ObjectAnimator.ofFloat(to,toTranslation,0));
  return set;
}
项目:boohee_v5.6    文件ButterKnife.java   
@TargetApi(14)
public static <T extends View,V> void apply(List<T> list,Property<? super T,V value) {
    int count = list.size();
    for (int i = 0; i < count; i++) {
        setter.set(list.get(i),value);
    }
}
项目:FlickLauncher    文件LauncherAnimutils.java   
public static ObjectAnimator ofFloat(View target,target);
    return anim;
}
项目:FlickLauncher    文件Workspace.java   
/**
 * 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,direction.ordinal());
}
项目:android_additive_animations    文件AdditiveAnimation.java   
/**
 * 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,float startValue,float targetValue) {
    mTarget = target;
    mProperty = property;
    mTargetValue = targetValue;
    mStartValue = startValue;
    setTag(property.getName());
}
项目:android_additive_animations    文件AdditiveAnimation.java   
public AdditiveAnimation(T target,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());
}
项目:android_additive_animations    文件AdditiveAnimationStateManager.java   
Float getActualPropertyValue(Property<T,Float> property) {
    Float lastTarget = getLastTargetValue(property.getName());
    if(lastTarget == null) {
        lastTarget = property.get(mAnimationTargetView);
    }
    return lastTarget;
}
项目:android_additive_animations    文件BaseAdditiveAnimator.java   
protected final T animatePropertyBy(Property<V,float by) {
    initValueAnimatorIfNeeded();
    float currentTarget = getTargetPropertyValue(property);
    if(getQueuedPropertyValue(property.getName()) != null) {
        currentTarget = getQueuedPropertyValue(property.getName());
    }
    return animate(createAnimation(property,currentTarget + by));
}
项目:android_additive_animations    文件BaseAdditiveAnimator.java   
protected final T animatePropertiesAlongPath(Property<V,Float> xProperty,Property<V,Float> yProperty,Float> rotationProperty,Path path) {
    PathEvaluator sharedEvaluator = new PathEvaluator();
    if(xProperty != null) {
        animate(xProperty,path,PathEvaluator.PathMode.X,sharedEvaluator);
    }
    if(yProperty != null) {
        animate(yProperty,PathEvaluator.PathMode.Y,sharedEvaluator);
    }
    if(rotationProperty != null) {
        animate(rotationProperty,PathEvaluator.PathMode.ROTATION,sharedEvaluator);
    }
    return self();
}
项目:SimpleUILauncher    文件LauncherAnimutils.java   
public static ObjectAnimator ofFloat(View target,target);
    return anim;
}
项目:SimpleUILauncher    文件Workspace.java   
/**
 * 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,direction.ordinal());
}
项目:weex-uikit    文件WXAnimationBean.java   
private static @NonNull Map<Property<View,0f);
  return defaultMap;
}
项目:weex-uikit    文件WXAnimationBean.java   
private void initHolders(){
  for (Map.Entry<Property<View,3)));
  }
}
项目:Android-ButterKinfe    文件ButterKnife.java   
/**
 * 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,value);
  }
}
项目:Android-ButterKinfe    文件ButterKnife.java   
/**
 * 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,value);
  }
}
项目:Android-ButterKinfe    文件ButterKnife.java   
/** 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,value);
}
项目:truth-android    文件PropertySubject.java   
public static <T,V> SubjectFactory<PropertySubject<T,V>,V>> type() {
  return new SubjectFactory<PropertySubject<T,V>>() {
    @Override
    public PropertySubject<T,V> getSubject(FailureStrategy fs,V> that) {
      return new PropertySubject<T,V>(fs,that);
    }
  };
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。