Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Android, the status bar theme changes to light when the popover is active #33

Open
nualoy opened this issue Oct 24, 2018 · 1 comment

Comments

@nualoy
Copy link

nualoy commented Oct 24, 2018

RN: 0.55.4

Code:

// (...)

export class InfoPopover extends PureComponent<Props> {
  static defaultProps = {
    style: {},
  };
  static styles = StyleSheet.create({
    infoButton: {
      paddingLeft: 6,
      color: colors.ink,
    },
    popoverContent: {
      padding: 12,
      backgroundColor: colors.ink,
      borderRadius: 4,
      width: 230,
      shadowOpacity: 0.25,
      shadowRadius: 4,
      shadowOffset: {
        width: 0,
        height: 0,
      },
      elevation: 2,
    },
    popoverText: {
      color: colors.white,
    },
    popoverArrow: {
      display: 'none',
      borderTopColor: 'transparent',
    },
    popoverBackground: {
      backgroundColor: 'transparent',
    },
  });

  render() {
    const { message, style } = this.props;
    const { styles } = InfoPopover;
    return (
      <PopoverController>
        {({ openPopover, closePopover, popoverVisible, setPopoverAnchor, popoverAnchorRect }) => ([
          <View key="button" style={style}>
            <TouchableWithoutFeedback
              hitSlop={{ top: 1, bottom: 1, left: 1, right: 1 }}
              ref={setPopoverAnchor}
              onPress={openPopover}
            >
              <Header style={styles.infoButton}>
                {popoverVisible ? TextIcons.InfoInverted : TextIcons.Info}
              </Header>
            </TouchableWithoutFeedback>
          </View>,
          <Popover
            key="popover"
            contentStyle={styles.popoverContent}
            arrowStyle={styles.popoverArrow}
            backgroundStyle={styles.popoverBackground}
            placement="left"
            visible={popoverVisible}
            onClose={closePopover}
            fromRect={popoverAnchorRect}
            easing={() => Easing.inOut(Easing.quad)}
          >
            <Subtitle style={styles.popoverText}>{message}</Subtitle>
          </Popover>,
        ])}
      </PopoverController>
    );
  }
}
@feruzm
Copy link

feruzm commented Jan 29, 2020

found solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants