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

styles.js 6.7KB

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