本文整理汇总了Java中com.facebook.rebound.OrigamiValueConverter类的典型用法代码示例。如果您正苦于以下问题:Java OrigamiValueConverter类的具体用法?Java OrigamiValueConverter怎么用?Java OrigamiValueConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OrigamiValueConverter类属于com.facebook.rebound包,在下文中一共展示了OrigamiValueConverter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onProgressChanged
import com.facebook.rebound.OrigamiValueConverter; //导入依赖的package包/类
public void onProgressChanged(SeekBar seekBar, int val, boolean b) {
if (seekBar == SpringConfiguratorView.this.mTensionSeekBar) {
float scaledTension = ((((float) val) * SpringConfiguratorView.MAX_TENSION) /
100000.0f) + 0.0f;
SpringConfiguratorView.this.mSelectedSpringConfig.tension = OrigamiValueConverter
.tensionFromOrigamiValue((double) scaledTension);
SpringConfiguratorView.this.mTensionLabel.setText("T:" + SpringConfiguratorView
.DECIMAL_FORMAT.format((double) scaledTension));
}
if (seekBar == SpringConfiguratorView.this.mFrictionSeekBar) {
float scaledFriction = ((((float) val) * 50.0f) / 100000.0f) + 0.0f;
SpringConfiguratorView.this.mSelectedSpringConfig.friction =
OrigamiValueConverter.frictionFromOrigamiValue((double) scaledFriction);
SpringConfiguratorView.this.mFrictionLabel.setText("F:" + SpringConfiguratorView
.DECIMAL_FORMAT.format((double) scaledFriction));
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:SpringConfiguratorView.java
示例2: onProgressChanged
import com.facebook.rebound.OrigamiValueConverter; //导入依赖的package包/类
@Override
public void onProgressChanged(SeekBar seekBar, int val, boolean b) {
float tensionRange = MAX_TENSION - MIN_TENSION;
float frictionRange = MAX_FRICTION - MIN_FRICTION;
if (seekBar == mTensionSeekBar) {
float scaledTension = ((val) * tensionRange) / MAX_SEEKBAR_VAL + MIN_TENSION;
mSelectedSpringConfig.tension =
OrigamiValueConverter.tensionFromOrigamiValue(scaledTension);
String roundedTensionLabel = DECIMAL_FORMAT.format(scaledTension);
mTensionLabel.setText("T:" + roundedTensionLabel);
}
if (seekBar == mFrictionSeekBar) {
float scaledFriction = ((val) * frictionRange) / MAX_SEEKBAR_VAL + MIN_FRICTION;
mSelectedSpringConfig.friction =
OrigamiValueConverter.frictionFromOrigamiValue(scaledFriction);
String roundedFrictionLabel = DECIMAL_FORMAT.format(scaledFriction);
mFrictionLabel.setText("F:" + roundedFrictionLabel);
}
}
开发者ID:xujunbin,项目名称:FloatWindow,代码行数:22,代码来源:SpringConfiguratorView.java
示例3: updateSeekBarsForSpringConfig
import com.facebook.rebound.OrigamiValueConverter; //导入依赖的package包/类
private void updateSeekBarsForSpringConfig(SpringConfig springConfig) {
int scaledTension = Math.round(((((float) OrigamiValueConverter.origamiValueFromTension
(springConfig.tension)) - 0.0f) * 100000.0f) / MAX_TENSION);
int scaledFriction = Math.round(((((float) OrigamiValueConverter.origamiValueFromFriction
(springConfig.friction)) - 0.0f) * 100000.0f) / 50.0f);
this.mTensionSeekBar.setProgress(scaledTension);
this.mFrictionSeekBar.setProgress(scaledFriction);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:SpringConfiguratorView.java
示例4: updateSeekBarsForSpringConfig
import com.facebook.rebound.OrigamiValueConverter; //导入依赖的package包/类
/**
* update the position of the seekbars based on the spring value;
* @param springConfig current editing spring
*/
private void updateSeekBarsForSpringConfig(SpringConfig springConfig) {
float tension = (float) OrigamiValueConverter.origamiValueFromTension(springConfig.tension);
float tensionRange = MAX_TENSION - MIN_TENSION;
int scaledTension = Math.round(((tension - MIN_TENSION) * MAX_SEEKBAR_VAL) / tensionRange);
float friction = (float) OrigamiValueConverter.origamiValueFromFriction(springConfig.friction);
float frictionRange = MAX_FRICTION - MIN_FRICTION;
int scaledFriction = Math.round(((friction - MIN_FRICTION) * MAX_SEEKBAR_VAL) / frictionRange);
mTensionSeekBar.setProgress(scaledTension);
mFrictionSeekBar.setProgress(scaledFriction);
}
开发者ID:xujunbin,项目名称:FloatWindow,代码行数:17,代码来源:SpringConfiguratorView.java
注:本文中的com.facebook.rebound.OrigamiValueConverter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论