How to use the expo-haptics.ImpactFeedbackStyle function in expo-haptics

To help you get started, we’ve selected a few expo-haptics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Flaque / quirk / src / articles / MarkdownArticle.tsx View on Github external
onNext = () => {
    haptic.impact(Haptic.ImpactFeedbackStyle.Light);

    // Title screen => Article Screen
    if (this.state.index === -1) {
      setTimeout(() => this.setState({ articleTopBarPose: "visible" }), 100);
    }

    // Article screen => Finish
    if (this.state.index >= this.props.pages.length - 1) {
      haptic.notification(Haptic.NotificationFeedbackType.Success);
      this.props.onFinish();
      return;
    }

    this.setState(prevState => {
      if (prevState.index + 1 >= this.props.pages.length) {
        return prevState;
github Flaque / quirk / src / main / FinishedScreen.tsx View on Github external
onRepeat = async () => {
    haptic.impact(Haptic.ImpactFeedbackStyle.Heavy);
    userRepeatedThought();
    const thought = newThought();
    thought.automaticThought = this.state.thought.automaticThought;
    this.props.navigation.navigate(AUTOMATIC_THOUGHT_SCREEN, {
      thought,
    });
  };
github Flaque / quirk / src / main / DistortionScreen.tsx View on Github external
onFinish = async () => {
    haptic.impact(Haptic.ImpactFeedbackStyle.Light);
    const thought = await saveThought(this.state.thought);
    this.props.navigation.push(FINISHED_SCREEN, {
      thought,
    });
  };
github Flaque / quirk / src / main / AutomaticThoughtScreen.tsx View on Github external
onNext = async () => {
    haptic.impact(Haptic.ImpactFeedbackStyle.Light);
    stats.thoughtRecorded();
    const thought = await saveThought(this.state.thought);
    this.props.navigation.push(DISTORTION_SCREEN, {
      thought,
    });
  };
github Flaque / quirk / src / main / survey / SurveyScreen.tsx View on Github external
onFinish = async () => {
    haptic.impact(Haptic.ImpactFeedbackStyle.Light);
  };
github Flaque / quirk / src / main / ChallengeScreen.tsx View on Github external
onFinish = async () => {
    haptic.impact(Haptic.ImpactFeedbackStyle.Light);
    const thought = await saveThought(this.state.thought);
    this.props.navigation.push(FINISHED_SCREEN, {
      thought,
    });
  };
github Flaque / quirk / src / lock / LockScreen.tsx View on Github external
onBackspace = () => {
    haptic.impact(Haptic.ImpactFeedbackStyle.Medium);
    this.setState(prevState => {
      if (prevState.code.length === 0) {
        return prevState;
      }
      return {
        ...prevState,
        code: prevState.code.substring(0, prevState.code.length - 1),
      };
    });
  };
github Flaque / quirk / src / main / FinishedScreen.tsx View on Github external
onDelete = async () => {
    const uuid = this.state.thought.uuid;
    await deleteThought(uuid);
    this.onNext();
    haptic.impact(Haptic.ImpactFeedbackStyle.Heavy);
  };

expo-haptics

Provides access to the system's haptics engine on iOS and vibration effects on Android.

MIT
Latest version published 1 month ago

Package Health Score

92 / 100
Full package analysis