Giter VIP home page Giter VIP logo

intellidev1991 / react-native-image-slider-box Goto Github PK

View Code? Open in Web Editor NEW
263.0 4.0 97.0 1.16 MB

A simple and fully customizable React Native component that implements an Image Slider UI.

License: MIT License

JavaScript 24.59% Java 17.22% Ruby 18.22% Objective-C 27.41% Starlark 12.57%
react-native react-components react-native-image react-native-image-slider react-native-image-slider-box react-native-library react-native-component

react-native-image-slider-box's Issues

Cant slide between photos on IOS

<SliderBox images={imageList} circleLoop sliderBoxHeight={200} ImageComponentStyle={{ borderBottomLeftRadius: 6, borderBottomRightRadius: 6 }} imageLoadingColor="#90A456" dotColor="#22A4AE" inactiveDotColor="#90A4AE" />

Hi, I can't slide between two photos on IOS, Android works just fine. I don't want autoplay props so I need to slide between photos. Maybe some additional props are required to enable this?

calling getNode() is no longer necessary

Is this a bug report, a feature request, or a question?
Bug

Is the bug reproducible in a production environment (not a debug one)?
Yes

Environment
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-snap-carousel": 3.8.4

Target Platform:
Android (9.0)

Bug:
Warning : Calling 'getNode()' on the ref an Animated Component is no longer necessary.

Crashing on release

When I have more than one image it's working perfectly on debug mode , but when I tried to generate a signed apk , it crashed when I have more than one image in the box.
I am using the latest version of the library.

my code is so simple :
state={
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
ads:[ "https://source.unsplash.com/1024x768/?nature",
"https://source.unsplash.com/1024x768/?water",
"https://source.unsplash.com/1024x768/?girl",]
}
render(){
return(<SliderBox resizeMode="cover" images={this.state.ads}
parentWidth={this.state.width} sliderBoxHeight={60} paginationBoxStyle={{opacity: 0}}
/>);
}_

Sometimes Images Are not Loading

Screenshot_1

hi, really thanks for the component. working perfectly for me but some times images are not loading showing loading indicator like the image shown. my code is as follows.

<SliderBox
images={this.state.photos}
sliderBoxHeight={500}
dotColor="#FFEE58"
inactiveDotColor="#90A4AE"
paginationBoxVerticalPadding={20}
circleLoop
autoplay
resizeMethod={'resize'}
resizeMode={'contain'}
ImageComponentStyle={{ borderRadius: 15, width: '100%' }}
/>

when i browse the link i am able to view the image. please help. thanks

version : "react-native-image-slider-box": "^1.0.12"

images prop Should support Immutable types

images prop should support Immutable types.

Currently, the List Immutable type (such as Immutable.List) has to be converted to javascript objects using the .toJSON() function.

circleloop has error

when use circleloop console log show this error.
VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc. {"contentLength": 5760, "dt": 2091, "prevDt": 1034}

Autoplay Time

Hello,

How can i set time for the AutoPlay ?

Thanks

adjusting autoplay interval

Hi, is there any way to increase the autoplay interval? its currently about 2500ms i guess and i think its a bit quick.

Know current image index

Is there any way to know the current image index? I want to load a new screen if a user tries to slide the last image of the gallery.

Image show blank when reducing items amount in images array

Hi,
I need to show slider images through call api to get images array. I'm facing a bug when reload page and api recall to get images array. Images don't show (blank) when reducing items amount in images array (array change)

how to fix this problem ?

Dots not being displayed

Hello, I just installed and tried this component.

While it has everything that we need for this project, it just missing dots
Below is my code.

import React, { useState, useEffect } from "react";
import { FlatList, View, StyleSheet,Dimensions } from "react-native";
import firestore from "@react-native-firebase/firestore";
import { useSelector, shallowEqual, useDispatch } from "react-redux";
import { theme } from "../../utils/theme";
import {
  emailValidator,
  passwordValidator,
  firstNameValidator,
  lastNameValidator
} from "../../utils/utils";
import styles from "../../utils/styles";
import {
  Surface,
  Text,
  TextInput,
  ActivityIndicator,
  Button
} from "react-native-paper";
import { SliderBox } from "react-native-image-slider-box";
const deviceWidth = Dimensions.get("window").width;
const deviceHeight = Dimensions.get("window").height;

export default function RetailScreen() {

  const [images, setImages] = useState([]);
  useEffect(() => {
    setImages([
      "https://source.unsplash.com/1024x768/?nature",
      "https://source.unsplash.com/1024x768/?water",
      "https://source.unsplash.com/1024x768/?girl",
      "https://source.unsplash.com/1024x768/?tree", 
    ])

  }, []);


  return (
    <Surface style={styles.containerHome}>
      <View style={styles.flex1}>
        <SliderBox images={images}
          // onCurrentImagePressed={index => console.warn(`image ${index} pressed`)}
          // currentImageEmitter={index => console.warn(`current pos is: ${index}`)}
          sliderBoxHeight={deviceHeight/3}
          dotColor="red"
          inactiveDotColor="blue"
          dotStyle={{
            width: 15,
            height: 15,
            borderRadius: 15,
            marginHorizontal: 10,
            padding: 0,
            margin: 0
          }} />

      </View>
    </Surface>
  );
}

Let me know if you find any issue? .Thanks

Remove dynamically images

Hi

As seen on title i would like to remove dynamically images from slide, when i choose one image and remove it all images gone, i used index variable and put it in state to get current index, and just slice the item in array:
setState({ images: this.state.images.splice(i, 1) })

some changes need in react native 0.62.1

Calling getNode() on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release. FlatList

UI

I see dot is slower than image

can't set marginStart and marginEnd for the container

 <View
              styles={{
                marginTop: 20,
                marginLeft: 10,
                marginEnd: 10,
                alignItems: 'center',
                flexDirection: 'row',
                justifyContent: 'center',
              }}>
              <SliderBox
                images={this.state.images}
                sliderBoxHeight={200}
                parentWidth={Dimensions.get('window').width - 20}
           
    
              />
            </View>

There is no margin start

Disabling the scale effect

Can we disable the scaling effect when image is changing?

I want it slide horizontally without scaling..

ResizeMode

Hi!

Is there a way to use the resizeMode props for Images?

VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.

I am experiencing this issue with the sliderbox.I am only loading 6 images.

full warning message.
VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc. Object {
"contentLength": 6283.63623046875,
"dt": 2370,
"prevDt": 509,
}

Remove Gradient Image

hi, im using this library and my package already installed react native linear gradient, and result this view.

image

Code

    <KeyboardAvoidingView behavior='position'>
      <Text>TestSliderScreen</Text>
      <SliderBox images={this.state.images} />
    </KeyboardAvoidingView>
 </ScrollView>

how to remove gradient over image ?

Position

Hi!
is it possible to assign a position to the slide? for example if I put position={2}, I have the second image that appears

Cutom Footer

Is there a way to render our own footer instead of rendering dots? something like 2/5 instead of dots.

disableOnPress: Invalid prop `onPress` of type `boolean` supplied to `TouchableHighlight`, expected `function`

Hello,

I use a prop disableOnPress and meet the warning below. Please help me fix it.

Warning: Failed prop type: Invalid prop `onPress` of type `boolean` supplied to `TouchableHighlight`, expected `function`.
- node_modules/prop-types/checkPropTypes.js:20:20 in printWarning
- node_modules/prop-types/checkPropTypes.js:83:12 in checkPropTypes
- node_modules/react/cjs/react.development.js:1501:19 in validatePropTypes
- node_modules/react/cjs/react.development.js:1590:22 in createElementWithValidation
- node_modules/react-native-image-slider-box/dist/SliderBox.js:58:7 in _renderItem
- node_modules/react-native-image-slider-box/dist/SliderBox.js:130:47 in renderItem
- node_modules/react-native-snap-carousel/src/carousel/Carousel.js:1224:29 in _renderItem

get position ?

I've never seen a fonskion called getPosition. how to get a position without clicking?

Adjust spacing between dots

Is there a way to define the space between each dot. I am scaling the size of my dost with respect ti number of images. when count is large (more than 10) dost are so small to fit in the screen but spacing between them is ridiculous.

It would be nice if i can set the horizontal spacing between dots.

autoplay On memory leaking?

I tried to test the autoplay with circleLoop and I saw the memory usage becomes like following image.

Then I off the autoplay and it is linear. Would be nice if you can take a look :D

Btw, thanks for the great library.

Screenshot 2020-02-15 at 6 38 07 PM

Calling `getNode()` on the ref of an Animated component is no longer necessary.

I am using this package in "react-native": "0.62.2", which brings up that warning. Below is the complete warning

Calling getNode() on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release. Personally i think it's something to do with Reanimated being included by default now.

Screenshot

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.