react-native-navigation的迁移库

CollapseAmount.java 800B

1234567891011121314151617181920212223242526272829303132333435
  1. package com.reactnativenavigation.views.collapsingToolbar;
  2. public class CollapseAmount {
  3. final static CollapseAmount None = new CollapseAmount();
  4. private CollapseAmount() {}
  5. private Float amount;
  6. private CollapseCalculator.Direction direction;
  7. CollapseAmount(float amount) {
  8. this.amount = amount;
  9. }
  10. public CollapseAmount(CollapseCalculator.Direction direction) {
  11. this.direction = direction;
  12. }
  13. boolean canCollapse() {
  14. return amount != null || this != None;
  15. }
  16. public boolean collapseToTop() {
  17. return direction == CollapseCalculator.Direction.Up;
  18. }
  19. public boolean collapseToBottom() {
  20. return direction == CollapseCalculator.Direction.Down;
  21. }
  22. public float get() {
  23. return amount;
  24. }
  25. }