MaskedViewIOS alternative for android? - javascript

I am trying to find or figure out a way to create https://facebook.github.io/react-native/docs/maskedviewios.html that supports Android, with the main goal to mask image with another image outline (think twitter logo put over any photo where contents are only shown within twitter logo) This works fine in iOS, but there are no components I found that do similar job on Android. How would one go about creating this?

Find a masked view built in Android (or build one) and the hook the native implementation to React Native.

In a lot of cases, you use ClipPath from react native svg (shipped by default with expo) to do the job. Such example can be found here:
https://snack.expo.io/#wcandillon/soundcloud-player

Related

Get touch pressure for Android using js react native

I would like to know please how to get touch pressure using react native, in other words, how much pressure the user puts with his finger when touching the screen. I know it's possible using Android for capacitive touchscreens, but how to do it using react native.
Thank you.
You can use Touchable Opacity , Touchable Highlight, Touchable Native Feedback like components..
You can refer this https://www.tutorialspoint.com/react_native/react_native_touches.htm
I don't think there is a build functionality like this on React Native
Most recent Api for handling touches (Pressable) can detect long press, but no how much pressure
https://reactnative.dev/docs/pressable
But if it's implemented natively in Android, you can use native code in React Native and implement it.

Snapshot of particular area of Screen using React Native

I am developing an application in React Native. One of its feature is I have to take a snapshot of particular area of screen ( Coordinates of the Screen is already Given). Is there any way to do this? I have been searching for this but couldn't found anything useful
You can try this one. Hope it sufficies your requirement
https://github.com/gre/react-native-view-shot

React-native Drag the edge of the element to change size

I wanted to create a screen in my mobile app (built using React-native), there I wanted to provide a feature in which user can drag the edge of the element (say for example, a box) to change its size.
Please check this link to understand requirement.
https://support.wix.com/en/article/resizing-an-element
Not able to find any support or any library / plugin where it is already done for react-native mobile app.
Can someone help me on this. Thanks in advance.
Note - Same this is available for React web app. (Link - https://www.npmjs.com/package/react-rnd)

How to create an Action-Sheet/Bottom-Sheet style drawer in React-Native?

I would like some guidance on how to create an action-sheet/bottom-sheet style drawer in React-Native so that I could use a single code base for both iOS and Android.
I've attempted to use the Animated Spring API. However, I'm not able to change to location of the Spring from the original location (while the drawer is closed), to the top location (while it is open). So that if the user doesn't complete the gesture, the menu goes back to its original location in either state, instead of the original position at the bottom.
Furthermore, many of the other answers to similar questions all recommend using their own or some other package on GitHub/NPM.
I'd like to make my own to keep dependencies small. I've also considered using React-Navigation but I can't seem to find anything that fits my use-case.
react-native-action-sheet is great if you're looking to get as close as possible to the native versions of Action Sheets.
https://github.com/expo/react-native-action-sheet

Color Filter For React Image Component

Is there any way to add a color filter in React Native Image component ?
I tried using tintColor as a prop - That works well for single color images.
But for Multi Color Images - I need a separate filter.
gl-react-native has all sorts of image effects that you can use in your app
https://github.com/ProjectSeptemberInc/gl-react-native
You can use
gl-react-native
But it has a limitation that it will not provide you an option to save the filtered image.
So my suggestion is to implement the filters in Native IOS and Android code and use native IOS and Android view in react native.
The solution is difficult but it works properly.

Categories

Resources