No Description

CAVideoBannerView.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /**
  2. * Created by Sean on 2018/5/9.
  3. */
  4. import {
  5. View,
  6. Text,
  7. StyleSheet,
  8. TouchableOpacity,
  9. TouchableWithoutFeedback,
  10. ScrollView,
  11. Image,
  12. Animated
  13. } from 'react-native'
  14. import React, {Component} from 'react'
  15. import PropTypes from 'prop-types';
  16. import {NavigationBarHeight, TabBarHeight, ScreenDimensions} from '../../../utils/DimensionsTools'
  17. import startsWith from 'lodash/startsWith';
  18. const BANNER_IMGS = [
  19. require('../../../resources/Play/Video/img_top.png'),
  20. ];
  21. export default class CAVideoBannerView extends Component {
  22. constructor(props) {
  23. super(props);
  24. }
  25. _onPress = () => {
  26. if (this.props.onBannerPress) {
  27. this.props.onBannerPress();
  28. }
  29. }
  30. render() {
  31. return(
  32. <View>
  33. <TouchableOpacity onPress={this._onPress}>
  34. <Image style={styles.bannerImageContainer}
  35. source={require('../../../resources/Play/Video/img_top.png')}
  36. resizeMode={'cover'}/>
  37. </TouchableOpacity>
  38. <CAVideobannerTitle />
  39. <View style={{width: ScreenDimensions.width, height:2.0, backgroundColor: '#efeff4', position: 'absolute', left: 0,
  40. bottom: 0}} />
  41. </View>
  42. );
  43. }
  44. }
  45. class CAVideobannerTitle extends Component {
  46. constructor(props) {
  47. super(props)
  48. }
  49. render() {
  50. return(
  51. <View style={styles.bannerTitleContainer}>
  52. <Text style={styles.title}>How (and why) Russia hacker the US election</Text>
  53. </View>
  54. );
  55. }
  56. }
  57. const styles = StyleSheet.create({
  58. View: {
  59. width: ScreenDimensions.width,
  60. height: 203,
  61. // backgroundColor: '#ffffff',
  62. backgroundColor: 'red',
  63. flexDirection: 'row',
  64. alignItems: 'center',
  65. justifyContent: 'space-between'
  66. },
  67. bannerImageContainer: {
  68. width: ScreenDimensions.width,
  69. height: 203
  70. },
  71. bannerTitleContainer: {
  72. height: 64,
  73. justifyContent: 'center'
  74. },
  75. title: {
  76. fontSize: 18,
  77. fontWeight: 'bold',
  78. color: "#000000",
  79. marginHorizontal: 12
  80. },
  81. container: {
  82. flex:1,
  83. flexDirection:'row',
  84. },
  85. circleContainer: {
  86. position:'absolute',
  87. left:0,
  88. top:120,
  89. },
  90. circle: {
  91. width:6,
  92. height:6,
  93. borderRadius:6,
  94. backgroundColor:'#f4797e',
  95. marginHorizontal:5,
  96. },
  97. circleSelected: {
  98. width:6,
  99. height:6,
  100. borderRadius:6,
  101. backgroundColor:'#ffffff',
  102. marginHorizontal:5,
  103. }
  104. })