No Description

CAVideoListRow.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. export default class CAVideoListRow extends Component {
  18. constructor(props) {
  19. super(props)
  20. }
  21. render() {
  22. return(
  23. <View style={styles.rowContainer}>
  24. <CAVideoListItem title={'How to Write the Alphabet in the D\"nealian Style\"'}
  25. image={require('../../../resources/Play/Video/img_1.png')}
  26. viewCount={77}
  27. commentCount={643}/>
  28. <CAVideoListItem title={'How to Use \"To Have\"'}
  29. image={require('../../../resources/Play/Video/img_2.png')}
  30. viewCount={789}
  31. commentCount={996}/>
  32. </View>
  33. );
  34. }
  35. }
  36. class CAVideoListItem extends Component {
  37. constructor(props) {
  38. super(props)
  39. }
  40. render() {
  41. return(
  42. <View style={styles.itemContainer}>
  43. <Image style={styles.itemImage} resizeMode={'contain'} source={this.props.image}/>
  44. <View style={styles.itemTitleContainer}>
  45. <Text style={styles.itemTitle} numberOfLines={2} multiline={true}>
  46. {this.props.title}
  47. </Text>
  48. </View>
  49. <View style={styles.itemBottomContainer}>
  50. <Image style={styles.itemBottomImage} resizeMode={'contain'} source={require('../../../resources/Play/Video/view.png')}/>
  51. <Text style={styles.itemBottomTitle}>{this.props.viewCount}</Text>
  52. <Image style={[styles.itemBottomImage, {marginLeft: 27}]} resizeMode={'contain'} source={require('../../../resources/Play/Video/mess.png')}/>
  53. <Text style={styles.itemBottomTitle}>{this.props.commentCount}</Text>
  54. </View>
  55. </View>
  56. );
  57. }
  58. }
  59. const styles = StyleSheet.create({
  60. rowContainer: {
  61. flex: 1,
  62. flexDirection: 'row',
  63. width: ScreenDimensions.width,
  64. height: 160,
  65. },
  66. itemContainer: {
  67. flex: 1,
  68. },
  69. itemImage: {
  70. marginLeft: 9,
  71. marginTop: 16,
  72. width: (ScreenDimensions.width - 30) / 2,
  73. height: (ScreenDimensions.width - 30) / 2 * (93/165)
  74. },
  75. itemTitleContainer: {
  76. marginTop: 7,
  77. marginLeft: 9,
  78. },
  79. itemTitle: {
  80. fontSize: 11,
  81. width: (ScreenDimensions.width - 30) / 2,
  82. },
  83. itemBottomContainer: {
  84. flexDirection: 'row',
  85. alignItems: 'center',
  86. marginLeft: 11,
  87. },
  88. itemBottomImage: {
  89. height: 9,
  90. width: 14,
  91. justifyContent: 'center'
  92. },
  93. itemBottomTitle: {
  94. marginLeft: 3,
  95. fontSize: 10,
  96. color: "#aaaaaa",
  97. }
  98. })