com.facebook.rebound.BaseSpringSystem Java Examples

The following examples show how to use com.facebook.rebound.BaseSpringSystem. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: YOLOComboView.java    From RxComboDetector with MIT License 6 votes vote down vote up
public YOLOComboView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    BaseSpringSystem springSystem = SpringSystem.create();
    mComboSpring = springSystem.createSpring();
    mComboSpring.setSpringConfig(SpringConfig.fromOrigamiTensionAndFriction(600, 9));

    mYOLOLogo = new ImageView(context);
    FrameLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT);
    mYOLOLogo.setLayoutParams(params);
    mYOLOLogo.setImageResource(R.drawable.ic_yolo);
    addView(mYOLOLogo);

    mComboText = new TextView(context);
    params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.RIGHT);
    params.rightMargin = 30;
    mComboText.setLayoutParams(params);
    mComboText.setTextColor(context.getResources().getColor(android.R.color.holo_red_light));
    mComboText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
    addView(mComboText);

    mSpringListener = new ComboSpringListener(mComboText);
    setAlpha(0);
}
 
Example #2
Source File: CountdownAnimationTextView.java    From AndroidPlayground with MIT License 4 votes vote down vote up
public CountdownAnimationTextView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    BaseSpringSystem springSystem = SpringSystem.create();
    mCountdownSpring = springSystem.createSpring();
    mCountdownSpring.setSpringConfig(SpringConfig.fromOrigamiTensionAndFriction(600, 9));
}