React-native: MaskedView support for Android

Created on 3 Jun 2018  路  5Comments  路  Source: facebook/react-native

For Discussion

I've worked on view demonstrated below today, very pleasant experience while using MaskedViewIOS
In essence it masks Orc graphic with that dark cloud / smoky mask. On android however, I was not able to find anything similar from community and after 3h of trying to create a native component bridge for this, I came nowhere close :/

Hence I wanted to start this discussion, shall we make MaskedView more general and support it for Android as well, or are there some limitations that don't allow this (hence only IOS implementation at the moment?)

screen shot 2018-06-03 at 14 55 47

Android Locked Discussion

Most helpful comment

React Native Core Team should make MaskedView more general and support it for Android as well. This would be great to have MaskedView for Android :+1:

All 5 comments

This would be great to have for Android!

React Native Core Team should make MaskedView more general and support it for Android as well. This would be great to have MaskedView for Android :+1:

Yes! MaskedView is much needed on Android as well.

To achieve similar effect on Android you can use my react-native-image-filter-kit package:

import { Image } from 'react-native'
import { DstATopComposition } from 'react-native-image-filter-kit'

const style = { width: 320, height: 320 }

const masked = (
  <DstATopComposition
    dstImage={
      <Image
        style={style}
        source={{ uri: 'https://i.ytimg.com/vi/_ebwvrrBfUc/hqdefault.jpg' }}
      />
    }
    srcImage={
      <Image
        style={style}
        source={{ uri: 'https://pluspng.com/img-png/download-smoke-effect-png-images-transparent-gallery-advertisement-advertisement-336.png' }}
      />
    }
  />
)

android

Text mask example

This issue has been moved to react-native-community/react-native-masked-view#3.

Was this page helpful?
0 / 5 - 0 ratings