Fix update bug with work items and activities. Fix placement of item in AR view

This commit is contained in:
John Lyon-Smith
2018-05-01 09:44:23 -07:00
parent edb078b38a
commit 0dce0b5858
11 changed files with 126 additions and 89 deletions

View File

@@ -94,8 +94,7 @@ export class BoundPhotoPanel extends Component {
handleLayout(e) {
if (!this.state.photoSize) {
const { layout } = e.nativeEvent
const { screenWidth, screenHeight } = getScreenPortraitDimensions()
const ratio = screenWidth / screenHeight
const ratio = 3 / 4
const width = (layout.width - photoSpacing) / 2
const height = width / ratio
@@ -106,9 +105,8 @@ export class BoundPhotoPanel extends Component {
render() {
const { photoSize, value: assetIds } = this.state
const renderPhoto = (index, size, paddingRight) => {
const renderPhoto = (index) => {
const assetId = assetIds[index]
const { photoSize } = this.state
if (assetId) {
console.log(api.makeImageUrl(assetId))
@@ -118,9 +116,8 @@ export class BoundPhotoPanel extends Component {
<TouchableOpacity
key={assetId || "blank" + index.toString()}
style={{
width: size.width,
height: size.height,
paddingRight,
width: photoSize.width,
height: photoSize.height,
borderWidth: 2,
borderColor: "gray",
borderRadius: 4,
@@ -157,14 +154,14 @@ export class BoundPhotoPanel extends Component {
</Text>
{photoSize && (
<View style={styles.photoRow}>
{renderPhoto(0, photoSize, photoSpacing)}
{renderPhoto(1, photoSize)}
{renderPhoto(0)}
{renderPhoto(1)}
</View>
)}
{photoSize && (
<View style={styles.photoRow}>
{renderPhoto(2, photoSize, photoSpacing)}
{renderPhoto(3, photoSize)}
{renderPhoto(2)}
{renderPhoto(3)}
</View>
)}
</View>