react-native-navigation的迁移库

TopBar.js 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const Button = require('./Button');
  2. class TopBar {
  3. /**
  4. * @property {string} [title]
  5. * @property {string} [backgroundColor]
  6. * @property {string} [textColor]
  7. * @property {string} [buttonColor]
  8. * @property {number} [textFontSize]
  9. * @property {string} [textFontFamily]
  10. * @property {string} [testID]
  11. * @property {boolean} [hidden]
  12. * @property {boolean} [animateHide]
  13. * @property {boolean} [hideOnScroll]
  14. * @property {boolean} [transparent]
  15. * @property {boolean} [translucent]
  16. * @property {boolean} [blur]
  17. * @property {boolean} [noBorder]
  18. * @property {boolean} [largeTitle]
  19. * @property {boolean} [drawUnder]
  20. * @property {options:Button[]} [rightButtons]
  21. * @property {options:Button[]} [leftButtons]
  22. */
  23. constructor(options) {
  24. this.title = options.title;
  25. this.backgroundColor = options.backgroundColor;
  26. this.textColor = options.textColor;
  27. this.textFontSize = options.textFontSize;
  28. this.textFontFamily = options.textFontFamily;
  29. this.hidden = options.hidden;
  30. this.animateHide = options.animateHide;
  31. this.hideOnScroll = options.hideOnScroll;
  32. this.transparent = options.transparent;
  33. this.translucent = options.translucent;
  34. this.buttonColor = options.buttonColor;
  35. this.blur = options.blur;
  36. this.noBorder = options.noBorder;
  37. this.largeTitle = options.largeTitle;
  38. this.testID = options.testID;
  39. this.drawUnder = options.drawUnder;
  40. this.rightButtons = options.rightButtons && options.rightButtons.map((button) => new Button(button));
  41. this.leftButtons = options.leftButtons && options.leftButtons.map((button) => new Button(button));
  42. }
  43. }
  44. module.exports = TopBar;