fix(rn,filmstrip) simplify thumbnail height calculations

This commit is contained in:
Saúl Ibarra Corretgé 2021-03-18 12:44:52 +01:00 committed by Saúl Ibarra Corretgé
parent 57ecdff9eb
commit fc27300132
3 changed files with 16 additions and 5 deletions

View File

@ -241,6 +241,8 @@ class TileView extends Component<Props> {
aspectRatio: TILE_ASPECT_RATIO, aspectRatio: TILE_ASPECT_RATIO,
flex: 0, flex: 0,
height: this._getTileDimensions().height, height: this._getTileDimensions().height,
maxHeight: null,
maxWidth: null,
width: null width: null
}; };

View File

@ -2,7 +2,7 @@
import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme'; import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
import { ColorPalette } from '../../../base/styles'; import { ColorPalette } from '../../../base/styles';
import { FILMSTRIP_SIZE } from '../../constants'; import { SMALL_THUMBNAIL_SIZE } from '../../constants';
/** /**
* Size for the Avatar. * Size for the Avatar.
@ -33,7 +33,7 @@ export default {
flexDirection: 'row', flexDirection: 'row',
flexGrow: 0, flexGrow: 0,
justifyContent: 'flex-end', justifyContent: 'flex-end',
height: FILMSTRIP_SIZE marginBottom: 5
}, },
/** /**
@ -88,12 +88,14 @@ export default {
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: 1, borderWidth: 1,
flex: 1, flex: 1,
height: 80, height: SMALL_THUMBNAIL_SIZE,
justifyContent: 'center', justifyContent: 'center',
margin: 2, margin: 2,
maxHeight: SMALL_THUMBNAIL_SIZE,
maxWidth: SMALL_THUMBNAIL_SIZE,
overflow: 'hidden', overflow: 'hidden',
position: 'relative', position: 'relative',
width: 80 width: SMALL_THUMBNAIL_SIZE
}, },
/** /**

View File

@ -1,9 +1,16 @@
// @flow // @flow
import { BoxModel } from '../base/styles';
/**
* The size (height and width) of the small (not tile view) thumbnails.
*/
export const SMALL_THUMBNAIL_SIZE = 80;
/** /**
* The height of the filmstrip in narrow aspect ratio, or width in wide. * The height of the filmstrip in narrow aspect ratio, or width in wide.
*/ */
export const FILMSTRIP_SIZE = 90; export const FILMSTRIP_SIZE = SMALL_THUMBNAIL_SIZE + BoxModel.margin;
/** /**
* The aspect ratio of a tile in tile view. * The aspect ratio of a tile in tile view.