Skip to content

[ActivityIndicator][Android] Indicator stays hidden if initialized as animating={false} #9023

@kulmajaba

Description

@kulmajaba

Originally discovered on http://stackoverflow.com/questions/38579665/reactnative-activityindicator-not-showing-when-animating-property-initiate-false

If ActivityIndicator is initialized with animating={false}, the Indicator will stay hidden even when changing animating to true. When initialized as animating the changes behave as expected.

Tested on Android emulator and Device, running Android 6.0 and 6.0.1. Also tested on iOS device which works as expected. Testing done with Windows 8.1.

'use strict'

import React, { Component } from 'react';
import {
    AppRegistry,
    Text,
    View,
    TouchableHighlight,
    ActivityIndicator
} from 'react-native';

class SampleApp extends Component {
    constructor() {
        super();

    this.state = {
            show: false
        };
    }

    render() {
        return (
            <View>
                <TouchableHighlight onPress={ () => this.setState({show: false}) } >
                    <Text>HIDE</Text>
                </TouchableHighlight>

                <TouchableHighlight onPress={ () => {this.setState({show: true}) } >
                    <Text>SHOW</Text>
                </TouchableHighlight>

                <ActivityIndicator animating={this.state.show} size="large"/>
            </View>
        );
    }
}

AppRegistry.registerComponent('SampleApp', () => SampleApp);

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugHelp Wanted :octocat:Issues ideal for external contributors.Platform: AndroidAndroid applications.Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions