您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

styles.js 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. // @flow
  2. import { StyleSheet } from 'react-native';
  3. import { BoxModel, ColorPalette, createStyleSheet } from '../../../styles';
  4. const AVATAR_OPACITY = 0.4;
  5. const AVATAR_SIZE = 65;
  6. const HEADER_COLOR = ColorPalette.blue;
  7. // Header height is from Android guidelines. Also, this looks good.
  8. const HEADER_HEIGHT = 56;
  9. const OVERLAY_FONT_COLOR = 'rgba(255, 255, 255, 0.6)';
  10. const SECONDARY_ACTION_BUTTON_SIZE = 30;
  11. export const HEADER_PADDING = BoxModel.padding;
  12. export const STATUSBAR_COLOR = ColorPalette.blueHighlight;
  13. export const SIDEBAR_WIDTH = 250;
  14. export const UNDERLAY_COLOR = 'rgba(255, 255, 255, 0.2)';
  15. const HEADER_STYLES = {
  16. /**
  17. * Platform specific header button (e.g. back, menu, etc).
  18. */
  19. headerButton: {
  20. alignSelf: 'center',
  21. color: ColorPalette.white,
  22. fontSize: 26,
  23. paddingRight: 22
  24. },
  25. /**
  26. * Style of the header overlay to cover the unsafe areas.
  27. */
  28. headerOverlay: {
  29. backgroundColor: HEADER_COLOR
  30. },
  31. /**
  32. * Generic style for a label placed in the header.
  33. */
  34. headerText: {
  35. color: ColorPalette.white,
  36. fontSize: 20
  37. },
  38. /**
  39. * The top-level element of a page.
  40. */
  41. page: {
  42. ...StyleSheet.absoluteFillObject,
  43. alignItems: 'stretch',
  44. flex: 1,
  45. flexDirection: 'column',
  46. overflow: 'hidden'
  47. },
  48. /**
  49. * Base style of Header.
  50. */
  51. screenHeader: {
  52. alignItems: 'center',
  53. backgroundColor: HEADER_COLOR,
  54. flexDirection: 'row',
  55. height: HEADER_HEIGHT,
  56. justifyContent: 'flex-start',
  57. padding: HEADER_PADDING
  58. }
  59. };
  60. /**
  61. * Style classes of the PagedList-based components.
  62. */
  63. const PAGED_LIST_STYLES = {
  64. /**
  65. * Style of the page indicator (Android).
  66. */
  67. pageIndicator: {
  68. alignItems: 'center',
  69. flex: 1,
  70. flexDirection: 'column',
  71. justifyContent: 'center'
  72. },
  73. /**
  74. * Additional style for the active indicator icon (Android).
  75. */
  76. pageIndicatorActive: {
  77. color: ColorPalette.white
  78. },
  79. /**
  80. * Container for the page indicators (Android).
  81. */
  82. pageIndicatorContainer: {
  83. alignItems: 'stretch',
  84. backgroundColor: ColorPalette.blue,
  85. flexDirection: 'row',
  86. height: 56,
  87. justifyContent: 'center'
  88. },
  89. /**
  90. * Icon of the page indicator (Android).
  91. */
  92. pageIndicatorIcon: {
  93. color: ColorPalette.blueHighlight,
  94. fontSize: 24
  95. },
  96. /**
  97. * Label of the page indicator (Android).
  98. */
  99. pageIndicatorText: {
  100. color: ColorPalette.blueHighlight
  101. },
  102. /**
  103. * Top level style of the paged list.
  104. */
  105. pagedList: {
  106. flex: 1
  107. },
  108. /**
  109. * The paged list container View.
  110. */
  111. pagedListContainer: {
  112. flex: 1,
  113. flexDirection: 'column'
  114. },
  115. /**
  116. * Disabled style for the container.
  117. */
  118. pagedListContainerDisabled: {
  119. opacity: 0.2
  120. }
  121. };
  122. const SECTION_LIST_STYLES = {
  123. /**
  124. * The style of the actual avatar.
  125. */
  126. avatar: {
  127. alignItems: 'center',
  128. backgroundColor: `rgba(23, 160, 219, ${AVATAR_OPACITY})`,
  129. borderRadius: AVATAR_SIZE,
  130. height: AVATAR_SIZE,
  131. justifyContent: 'center',
  132. width: AVATAR_SIZE
  133. },
  134. /**
  135. * List of styles of the avatar of a remote meeting (not the default
  136. * server). The number of colors are limited because they should match
  137. * nicely.
  138. */
  139. avatarColor1: {
  140. backgroundColor: `rgba(232, 105, 156, ${AVATAR_OPACITY})`
  141. },
  142. avatarColor2: {
  143. backgroundColor: `rgba(255, 198, 115, ${AVATAR_OPACITY})`
  144. },
  145. avatarColor3: {
  146. backgroundColor: `rgba(128, 128, 255, ${AVATAR_OPACITY})`
  147. },
  148. avatarColor4: {
  149. backgroundColor: `rgba(105, 232, 194, ${AVATAR_OPACITY})`
  150. },
  151. avatarColor5: {
  152. backgroundColor: `rgba(234, 255, 128, ${AVATAR_OPACITY})`
  153. },
  154. /**
  155. * The style of the avatar container that makes the avatar rounded.
  156. */
  157. avatarContainer: {
  158. alignItems: 'center',
  159. flexDirection: 'row',
  160. justifyContent: 'space-around',
  161. padding: 5
  162. },
  163. /**
  164. * Simple {@code Text} content of the avatar (the actual initials).
  165. */
  166. avatarContent: {
  167. backgroundColor: 'rgba(0, 0, 0, 0)',
  168. color: OVERLAY_FONT_COLOR,
  169. fontSize: 32,
  170. fontWeight: '100',
  171. textAlign: 'center'
  172. },
  173. /**
  174. * The top level container style of the list.
  175. */
  176. container: {
  177. flex: 1
  178. },
  179. list: {
  180. flex: 1,
  181. flexDirection: 'column'
  182. },
  183. listItem: {
  184. alignItems: 'center',
  185. flex: 1,
  186. flexDirection: 'row',
  187. paddingVertical: 5
  188. },
  189. listItemDetails: {
  190. flex: 1,
  191. flexDirection: 'column',
  192. overflow: 'hidden',
  193. paddingHorizontal: 5
  194. },
  195. listItemText: {
  196. color: OVERLAY_FONT_COLOR,
  197. fontSize: 14
  198. },
  199. listItemTitle: {
  200. fontWeight: 'bold',
  201. fontSize: 16
  202. },
  203. listSection: {
  204. alignItems: 'center',
  205. backgroundColor: 'rgba(255, 255, 255, 0.2)',
  206. flex: 1,
  207. flexDirection: 'row',
  208. padding: 5
  209. },
  210. listSectionText: {
  211. color: OVERLAY_FONT_COLOR,
  212. fontSize: 14,
  213. fontWeight: 'normal'
  214. },
  215. pullToRefresh: {
  216. alignItems: 'center',
  217. flex: 1,
  218. flexDirection: 'column',
  219. justifyContent: 'center',
  220. padding: 20
  221. },
  222. pullToRefreshIcon: {
  223. backgroundColor: 'transparent',
  224. color: OVERLAY_FONT_COLOR,
  225. fontSize: 20
  226. },
  227. pullToRefreshText: {
  228. backgroundColor: 'transparent',
  229. color: OVERLAY_FONT_COLOR
  230. },
  231. secondaryActionContainer: {
  232. alignItems: 'center',
  233. backgroundColor: ColorPalette.blue,
  234. borderRadius: 3,
  235. height: SECONDARY_ACTION_BUTTON_SIZE,
  236. justifyContent: 'center',
  237. margin: BoxModel.margin * 0.5,
  238. marginRight: BoxModel.margin,
  239. width: SECONDARY_ACTION_BUTTON_SIZE
  240. },
  241. secondaryActionLabel: {
  242. color: ColorPalette.white
  243. },
  244. touchableView: {
  245. flexDirection: 'row'
  246. }
  247. };
  248. const SIDEBAR_STYLES = {
  249. /**
  250. * The topmost container of the side bar.
  251. */
  252. sideMenuContainer: {
  253. ...StyleSheet.absoluteFillObject
  254. },
  255. /**
  256. * The container of the actual content of the side menu.
  257. */
  258. sideMenuContent: {
  259. bottom: 0,
  260. left: -SIDEBAR_WIDTH,
  261. position: 'absolute',
  262. top: 0,
  263. width: SIDEBAR_WIDTH
  264. },
  265. /**
  266. * The opaque area that covers the rest of the screen, when the side bar is
  267. * open.
  268. */
  269. sideMenuShadow: {
  270. ...StyleSheet.absoluteFillObject,
  271. backgroundColor: 'rgba(0, 0, 0, 0.5)'
  272. }
  273. };
  274. /**
  275. * The styles of the generic React {@code Component}s implemented by the feature
  276. * base/react.
  277. */
  278. export default createStyleSheet({
  279. ...HEADER_STYLES,
  280. ...PAGED_LIST_STYLES,
  281. ...SECTION_LIST_STYLES,
  282. ...SIDEBAR_STYLES
  283. });