Bug report
(Check the step you've followed - put an x character between the square brackets ([]).)
Yes
Android (Emulator)
Not tested on release mode
Environment:
React: 16.8.6
React native: 0.60.4
react-native-snap-carousel: 3.8.1
Target Platform:
Android (9.0)
It should decrease the opacity of the whole card, not only border

The borders (with shadow) of the not active cards have different opacity. It looks bad
<Carousel
layout={'default'}
data={[{title: 'test', id: 1}, {title: "test 2", id: 2}, {title: "test 3", id: 3}]}
renderItem={this._renderItem}
sliderWidth={width}
itemWidth={itemWidth}
/>
const {height, width} = Dimensions.get('window');
const horizontalMargin = 10;
const slideWidth = 200;
const itemWidth = slideWidth + horizontalMargin * 2;
const itemHeight = 200;
const styles = {
slide: {
width: itemWidth,
height: itemHeight,
paddingHorizontal: horizontalMargin,
marginVertical: 10
// other styles for the item container
},
slideInnerContainer: {
width: slideWidth,
backgroundColor: 'white',
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 3,
},
shadowOpacity: 0.27,
shadowRadius: 10,
elevation: 6,
borderRadius: 10,
height: 100,
padding: 10
// other styles for the inner container
}
};
Just use the above code for the Carousel. I have nothing else on the screen. The Carousel is wrapped with a
This has nothing to do with the plugin and is a well known React native bug. TL;DR: Android acts like it applies an overflow: hidden rule to every single view.
You can either add a wrapper with the necessary padding around the view with the shadow or try this trick.
@bd-arc im not sure if this is related to the overflow. I have no absolute positioning of any item inside the slider. Also the plugin you recommended did state that after RN 0.57 this should not be a problem (i have 0.60.4).
I tried adding the wrapper with padding and also installing the plugin and wrapping the slider view with it but the result is the same.

I see. The bad news is this still has to do with the Android rendering engine and not with the plugin. When you use an elevation and some opacity, bad things usually happen...
I'm pretty sure everything is fine when you set inactiveSlideOpacity to 1, isn't it?
wow how did I miss that?! I added inactiveSlideOpacity={1} and now its ok. I don't mind losing the opacity to the inactive slide. Thank you!
Most helpful comment
I see. The bad news is this still has to do with the Android rendering engine and not with the plugin. When you use an elevation and some opacity, bad things usually happen...
I'm pretty sure everything is fine when you set
inactiveSlideOpacityto1, isn't it?