当前位置: 首页>>代码示例>>Java>>正文


Java Spring.getCurrentValue方法代码示例

本文整理汇总了Java中com.facebook.rebound.Spring.getCurrentValue方法的典型用法代码示例。如果您正苦于以下问题:Java Spring.getCurrentValue方法的具体用法?Java Spring.getCurrentValue怎么用?Java Spring.getCurrentValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.rebound.Spring的用法示例。


在下文中一共展示了Spring.getCurrentValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override
public void onSpringUpdate(Spring spring) {
	final double value = spring.getCurrentValue();
	
	final float mapToggleX = (float) SpringUtil.mapValueFromRangeToRange(value, 0, 1, spotMinX, spotMaxX);
	spotX = mapToggleX;
	
	float mapOffLineWidth = (float) SpringUtil.mapValueFromRangeToRange(1 - value, 0, 1, 10, spotSize);
	
	offLineWidth = mapOffLineWidth;
	
	final int fb = Color.blue(onColor);
	final int fr = Color.red(onColor);
	final int fg = Color.green(onColor);
	
	final int tb = Color.blue(offBorderColor);
	final int tr = Color.red(offBorderColor);
	final int tg = Color.green(offBorderColor);
	
	int sb = (int) SpringUtil.mapValueFromRangeToRange(1 - value, 0, 1, fb, tb);
	int sr = (int) SpringUtil.mapValueFromRangeToRange(1 - value, 0, 1, fr, tr);
	int sg = (int) SpringUtil.mapValueFromRangeToRange(1 - value, 0, 1, fg, tg);
	
	sb = clamp(sb, 0, 255);
	sr = clamp(sr, 0, 255);
	sg = clamp(sg, 0, 255);
	
	borderColor = Color.rgb(sr, sg, sb);
	
	postInvalidate();
}
 
开发者ID:CarlisleChan,项目名称:Incubators,代码行数:32,代码来源:IOSToggleButton.java

示例2: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override
public void onSpringUpdate(Spring spring) {
    float value = (float) spring.getCurrentValue();
    float scale = 1f - (value * 0.5f);
    view.setScaleX(scale);
    view.setScaleY(scale);
}
 
开发者ID:sdsmdg,项目名称:liener,代码行数:8,代码来源:BubbleHead.java

示例3: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override
public void onSpringUpdate(Spring spring) {
  float val = (float) spring.getCurrentValue();
  float minTranslate = mRevealPx;
  float maxTranslate = mStashPx;
  float range = maxTranslate - minTranslate;
  float yTranslate = (val * range) + minTranslate;
  SpringConfiguratorView.this.setTranslationY(yTranslate);
}
 
开发者ID:xujunbin,项目名称:FloatWindow,代码行数:10,代码来源:SpringConfiguratorView.java

示例4: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override
public void onSpringUpdate(Spring spring) {
  double val = spring.getCurrentValue();
  float xlat = (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, getWidth());
  setTranslationX(xlat);
  if (mCallback != null) {
    mCallback.onProgress(spring.getCurrentValue());
  }
}
 
开发者ID:cheyiliu,项目名称:test4XXX,代码行数:10,代码来源:ExampleContainerView.java

示例5: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override
public void onSpringUpdate(Spring spring) {
    float value = (float) spring.getCurrentValue();
    float scale = 1f - (value * 0.5f);
    ViewCompat.setScaleX(DragCard.this, scale);
    ViewCompat.setScaleY(DragCard.this, scale);
}
 
开发者ID:wangkang0627,项目名称:SwipCard,代码行数:8,代码来源:DragCard.java

示例6: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override public void onSpringUpdate(Spring spring) {
  super.onSpringUpdate(spring);
  val = spring.getCurrentValue();
  ViewCompat.setTranslationX(viewCallback.getFabButton(),
      (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, centerX + 100));
  ViewCompat.setTranslationY(viewCallback.getFabButton(),
      (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, centerY + 100));
  ViewCompat.setTranslationX(viewCallback.getBoundMenu(),
      (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, centerX + 100));
  ViewCompat.setTranslationY(viewCallback.getBoundMenu(),
      (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, centerY ));
}
 
开发者ID:ppamorim,项目名称:Bound,代码行数:13,代码来源:SpringController.java

示例7: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override public void onSpringUpdate(Spring spring) {
  super.onSpringUpdate(spring);

  verticalCurrentValue = spring.getCurrentValue();

  float rotation = (float) SpringUtil.mapValueFromRangeToRange(verticalCurrentValue, 0, 1,
      0, -30);
  ViewCompat.setRotationX(frontCreditCardView, rotation);
  ViewCompat.setRotationX(backCreditCardView, rotation);

  float scale = (float) SpringUtil.mapValueFromRangeToRange(verticalCurrentValue, 0, 1, 1, 0.7);
  ViewCompat.setScaleX(frontCreditCardView, scale);
  ViewCompat.setScaleY(frontCreditCardView, scale);
  ViewCompat.setScaleX(backCreditCardView, scale);
  ViewCompat.setScaleY(backCreditCardView, scale);

  if(bottomView != null) {
    int creditCardHeight = frontCreditCardView.getHeight();
    float cardPositionY = (float) SpringUtil.mapValueFromRangeToRange(verticalCurrentValue, 0,
        1, 0, -(creditCardHeight / 6.5));
    ViewCompat.setTranslationY(frontCreditCardView, cardPositionY);
    ViewCompat.setTranslationY(backCreditCardView, cardPositionY);
    ViewCompat.setTranslationY(bottomView,
        (float) SpringUtil.mapValueFromRangeToRange(verticalCurrentValue, 0, 1, 0,
            -(creditCardHeight / 2.5)));
  }
}
 
开发者ID:ppamorim,项目名称:pagarme-android,代码行数:28,代码来源:CardHashView.java

示例8: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override public void onSpringUpdate(Spring spring) {

      double val = spring.getCurrentValue();
      switch (dragPosition) {
        case LEFT:
          ViewCompat.setTranslationX(dragView,
              (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, -dragView.getWidth()));
          break;
        case RIGHT:
          ViewCompat.setTranslationX(dragView,
              (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, dragView.getWidth()));
          break;
        case TOP:
          ViewCompat.setTranslationY(dragView,
              (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, dragView.getHeight()));
          break;
        case BOTTOM:
          ViewCompat.setTranslationY(dragView,
              (float) SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, -dragView.getHeight()));
          break;
        default:
          break;
      }

      ViewCompat.setAlpha(shadowView,
          (float) (MAX_ALPHA - SpringUtil.mapValueFromRangeToRange(val, 0, 1, 0, 1)));

      if (draggerCallback != null) {
        draggerCallback.onProgress(spring.getCurrentValue());
      }
    }
 
开发者ID:ppamorim,项目名称:Dragger,代码行数:32,代码来源:DraggerView.java

示例9: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override public void onSpringUpdate(Spring spring) {
  super.onSpringUpdate(spring);
  double currentValue = spring.getCurrentValue();
  ViewCompat.setTranslationX(prismView, (float) SpringUtil.mapValueFromRangeToRange(
      currentValue, 0, 1, activityHelper.getWidth(), 0));
  mainViewUpdate(currentValue);
}
 
开发者ID:ppamorim,项目名称:PrismView,代码行数:8,代码来源:PrismActivity.java

示例10: onSpringAtRestOut

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
private void onSpringAtRestOut(Spring spring) {
  if (hideEnabled) {
    if (spring.getCurrentValue() == 1) {
      showPrismView();
    } else {
      showMainView();
    }
  }
}
 
开发者ID:ppamorim,项目名称:PrismView,代码行数:10,代码来源:PrismActivity.java

示例11: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
public void onSpringUpdate(Spring spring) {
    float val = (float) spring.getCurrentValue();
    float minTranslate = SpringConfiguratorView.this.mRevealPx;
    SpringConfiguratorView.this.setTranslationY((val * (SpringConfiguratorView.this
            .mStashPx - minTranslate)) + minTranslate);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:7,代码来源:SpringConfiguratorView.java

示例12: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override
public void onSpringUpdate(Spring spring) {
    final double value = spring.getCurrentValue();
    calculateEffect(value);
}
 
开发者ID:LegendKe,项目名称:MyTravelingDiary,代码行数:6,代码来源:SwitchButton.java

示例13: onSpringUpdate

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
@Override
public void onSpringUpdate(Spring spring) {
	final double value = spring.getCurrentValue();
	calculateEffect(value);
}
 
开发者ID:xujunbin,项目名称:FloatWindow,代码行数:6,代码来源:ToggleButton.java

示例14: shouldClean

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
public boolean shouldClean(Spring spring) {
	// these are arbitrary values to keep the view from disappearing before it is
	// fully off the screen
	return spring.getCurrentValue() < mMin || spring.getCurrentValue() > mMax;
}
 
开发者ID:tumblr,项目名称:Backboard,代码行数:6,代码来源:ExplosionFragment.java

示例15: getYFromSpring

import com.facebook.rebound.Spring; //导入方法依赖的package包/类
private int getYFromSpring(Spring spring) {
    return centerY + (int) spring.getCurrentValue() - getMeasuredHeight() / 2;
}
 
开发者ID:flipkart-incubator,项目名称:springy-heads,代码行数:4,代码来源:ChatHeadCloseButton.java


注:本文中的com.facebook.rebound.Spring.getCurrentValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。