Giter Club home page Giter Club logo

react-native-smart-tip's Introduction

Anurag's github stats

Skills

  • Main: React, Vue , React-Native, Android.
  • Second: Flutter, Node.
  • Learn new knowledge and share new knowledge.

react-native-smart-tip's People

Contributors

a-kylin avatar mochixuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-native-smart-tip's Issues

关于 Toast 显示在 Modal 上方

image

这个解决方法和我在 native-base 的 issue 里看到的类似,链接如下:
GeekyAnts/NativeBase#985

但是有些应用场景貌似不太适用,比如一个 Page 包含一个 Modal,需要满足既能够在页面显示 Toast 又能在 Modal 显示时 Toast 能显示在 Modal 上方。

麻烦您看一下(^▽^)

[0.65.x] Deprecated Dimensions event listeners

Since react-native 0.65.x handling listeners has changed, here's a patch-package file to temp fix only ToastView.js:

diff --git a/node_modules/react-native-smart-tip/toast/ToastView.js b/node_modules/react-native-smart-tip/toast/ToastView.js
index 348e3a4..27f36e7 100644
--- a/node_modules/react-native-smart-tip/toast/ToastView.js
+++ b/node_modules/react-native-smart-tip/toast/ToastView.js
@@ -25,7 +25,7 @@ export default class ToastView extends Component{
         }
 
         // React after 17
-        Dimensions.addEventListener('change', this.onWindowChange);
+       this.dimensionsSubscription = Dimensions.addEventListener('change', this.onWindowChange);
     }
 
     componentDidMount() {
@@ -37,7 +37,7 @@ export default class ToastView extends Component{
             this.liftCycleAnimated.stop()
             this.liftCycleAnimated = undefined
         }
-        Dimensions.removeEventListener('change', this.onWindowChange);
+        this.dimensionsSubscription?.remove();
     }
 
     render() {


@mochixuan for backwards compatibility you could add:

import React from 'react';
const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersion');


constructor(props) {
    super(props);

    const { width, height } = Dimensions.get("window");

    this.state = {
      deviceWidth: width,
      deviceHeight: height,
      animatedValue1: new Animated.Value(0),
      animatedValue2: new Animated.Value(0.2)
    };

    // React after 17
    if (v >= 65) {
      this.dimensionsSubscription = Dimensions.addEventListener(
        "change",
        this.onWindowChange
      );
    } else {
      Dimensions.addEventListener("change", this.onWindowChange);
    }
  }

  componentWillUnmount() {
    if (this.liftCycleAnimated) {
      this.liftCycleAnimated.stop();
      this.liftCycleAnimated = undefined;
    }

    const v = parseInt(
      ReactNativeVersion.version.major + ReactNativeVersion.version.minor,
      10
    );

    if (v >= 65) {
      this.dimensionsSubscription?.remove();
    } else {
      Dimensions.removeEventListener("change", this.onWindowChange);
    }
  }


not tested ^^, just a suggestion, this should apply to all Views, not only ToastView 😄

WSnackBar close suggestion

I would like to leave it as a suggestion: An option to slide to close in SnackBar mode, or to click on the component and close.

The suggestion was to close it, invoking the .hide() method, but it could be a customizable action property as well.

Yes, I know you have a similar option, but it is using text. The ideal would be one executed from the interaction of any area of ​​the component. Using only WSnackBar.show().

点击没有反应

image
大佬,您好。我是直接把您的demo里的拿过来,但是没有效果也。是我少了什么吗,打过断点,Toast确实有这个对象,引用到了。但是就是没有tip弹出。

怎么集成全局Toast

老大,想把你插件里的Toast集成到全局

123123213123

全局Loading我集成好了,好像直接用你写的Toast不行

请问 WModal 有没有关闭的 api?

const load1 = WModal.show({
        data: '加载中',
        textColor: '#fff',
        backgroundColor: '#444444',
        position: WModal.position.CENTER,
        icon: <ActivityIndicator color="#fff" size={'large'} />,
});
console.log(load1);// undefined 这里是 undefined

show 了以后不知道怎么关闭.

WToast in android can not show backgroundColor

"react": "16.9.0",
"react-native": "0.61.0",

WToast.show({
            data: msg,
            textColor: '#ffffff',
            backgroundColor: '#000000',
            duration: 2, // 1.SHORT 2.LONG
            position: WToast.position.CENTER, // 1.TOP 2.CENTER 3.BOTTOM
        });

inEasing not working for android

inEasing not working in android (debug) not tested in APK

data: "", textColor: "#ffffff", backgroundColor: error ? "#ff490b" : CONST.APP_COLOR, duration: WToast.duration.LONG, position: WToast.position.BOTTOM, isShowShadow: false, inEasing: Easing.ease,

有个警告错误

Animated: useNativeDriver was not specified. This is a required option and must be explicitly set to true or false
in SnackView (at SnackBar.js:25)

最新的0.62版本。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.