Skip to content

Updating the statusbar color resets the pagination indicator #38

@SandroMachado

Description

@SandroMachado

Hi @FuYaoDe,

I am trying to update the status bar color (in Android) to match background of each page of the onboard.

My render function looks like this:

  render() {
    return (
      <View>
      <StatusBar
        backgroundColor={shadeStatusBarColor(this.state.statusBarColor, -0.3)}
      />
      <AppIntro
        onDoneBtnClick={this.doneBtnHandle}
        onSkipBtnClick={this.onSkipBtnHandle}
        onSlideChange={this.onSlideChangeHandle}
        pageArray={this.state.pageArray}
      />
      </View>
    );
  }

On the slide change callback I have this:

onSlideChangeHandle = (index, total) => {
    this.setState({ statusBarColor: this.state.pageArray[index].backgroundColor, currentPage: index });
  }

Doing this, the color of the statusbar changes, but the pagination is reset to the first position.

baconmhc19qsandromachado09262016140353

I also tried to do this change directly in the library (I want to make a PR to add this feature to the library also), but the behaviour is the same, the page position is not persisted.

Do you have any tips to fix this?

Thanks for the great work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions