You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2020. It is now read-only.
Would you explain to me how to understand these params by your sample app
// On each update of the spring value, we adjust the scale of the image view to match the// springs new value. We use the SpringUtil linear interpolation function mapValueFromRangeToRange// to translate the spring's 0 to 1 scale to a 100% to 50% scale range and apply that to the View// with setScaleX/Y. Note that rendering is an implementation detail of the application and not// Rebound itself. If you need Gingerbread compatibility consider using NineOldAndroids to update// your view properties in a backwards compatible manner.floatmappedValue = (float) SpringUtil.mapValueFromRangeToRange(spring.getCurrentValue(), 0, 1, 1, 0.5);
At the end, I would like to apply the spring's 0 to 1 to 400dp to 100 dp in the layout height. Please let me know how to apply it into SpringUtil.mapValueFromRangeToRange(spring.getCurrentValue(), 0, 1, 1, 0.5);. Thank you so much.
The text was updated successfully, but these errors were encountered:
If you have the dimension values (400dp, 100dp) in an xml somewhere, you can use: int px = context.getResources().getDimensionPixelSize(<res-id>);
to convert the dp value to pixels. Otherwise, there are a number of ways to do a direct conversion, one of which is: int px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, <size_in_dp>, context.getResources().getDisplayMetrics());
Would you explain to me how to understand these params by your sample app
At the end, I would like to apply the spring's 0 to 1 to 400dp to 100 dp in the layout height. Please let me know how to apply it into
SpringUtil.mapValueFromRangeToRange(spring.getCurrentValue(), 0, 1, 1, 0.5);
. Thank you so much.The text was updated successfully, but these errors were encountered: