All Projects β†’ sieuhuflit β†’ react-native-swipe-close-image

sieuhuflit / react-native-swipe-close-image

Licence: other
A React native swipe to close image

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-swipe-close-image

drag-to-close
Android library that provides a view group which allows to finish an activity by dragging a view.
Stars: ✭ 69 (+283.33%)
Mutual labels:  swipe, close
nativescript-swipe-layout
πŸŽ†
Stars: ✭ 21 (+16.67%)
Mutual labels:  swipe
Spstorkcontroller
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
Stars: ✭ 2,494 (+13755.56%)
Mutual labels:  swipe
RNSlidingButton
React Native Button component which support Slide event to perform action.
Stars: ✭ 19 (+5.56%)
Mutual labels:  swipe
Fusuma
Multitouch gestures with libinput driver on Linux
Stars: ✭ 2,870 (+15844.44%)
Mutual labels:  swipe
iron-swipeable-pages
[Polymer 1.x] Element that enables switching between different pages by swiping gesture.
Stars: ✭ 51 (+183.33%)
Mutual labels:  swipe
Pageable
Create full page scrolling web pages. No jQuery.
Stars: ✭ 199 (+1005.56%)
Mutual labels:  swipe
react-swipe-component
Swipe bindings for react
Stars: ✭ 48 (+166.67%)
Mutual labels:  swipe
react-native-segment-control
Swipeable SegmentedControl component for React Native apps
Stars: ✭ 21 (+16.67%)
Mutual labels:  swipe
Recordview
A Simple Audio Recorder View with "hold to Record Button" and "Swipe to Cancel " Like WhatsApp
Stars: ✭ 253 (+1305.56%)
Mutual labels:  swipe
Swiped Events
Adds `swiped` events to the DOM in 0.7k of pure JavaScript
Stars: ✭ 249 (+1283.33%)
Mutual labels:  swipe
React Native Swiper Flatlist
πŸ‘† Swiper component implemented with FlatList using Hooks & Typescript + strict automation tests with Detox
Stars: ✭ 217 (+1105.56%)
Mutual labels:  swipe
MetalRecyclerPagerView
RecyclerView implementation for Android which makes it look and feel like ViewPager with item margins support (mutliple views effect).
Stars: ✭ 26 (+44.44%)
Mutual labels:  swipe
Slip
Slip.js β€” UI library for manipulating lists via swipe and drag gestures
Stars: ✭ 2,421 (+13350%)
Mutual labels:  swipe
sqlclosecheck
Linter that confirms that DB rows and stats are closed properly.
Stars: ✭ 21 (+16.67%)
Mutual labels:  close
Smart Recycler Adapter
Small, smart and generic adapter for recycler view with easy and advanced data to ViewHolder binding.
Stars: ✭ 197 (+994.44%)
Mutual labels:  swipe
kikder-dating-swipe-app
❀️ Kik App, you know? πŸ’‘ Kikderβ„’ is a dating webapp that integrates the Kik, uses the HorOrNot game and the Tinder swipe. The F.A.S.T. Game Approach! The web app uses a custom lightweight MVC framework.
Stars: ✭ 21 (+16.67%)
Mutual labels:  swipe
Swipycell
Easy to use UITableViewCell implementing swiping to trigger actions.
Stars: ✭ 230 (+1177.78%)
Mutual labels:  swipe
swipeablerecyclerview
SwipeableRecyclerView provides a wrapper class SwipeItemTouchHelperCallback which can be used to add Dragging capability to your RecyclerView items. You can make use of DataBinding to bind it via XML.
Stars: ✭ 16 (-11.11%)
Mutual labels:  swipe
vue-product-carousel
Simple product carousel with hot image replacement, Zoom and Swipe mode
Stars: ✭ 37 (+105.56%)
Mutual labels:  swipe

React native swipe close image

A swipe close full screen image for Android and iOS

Installation

npm install react-native-swipe-close-image --save

Using

  • Create SwipeCloseImage in render() with imageSource is the source of image (Can be local or remote url link)
import SwipeCloseImage from 'react-native-swipe-close-image';
...
render() {
...
<SwipeCloseImage
  ref={c => (this.swipeToCloseRef = c)}
  imageSource={this.state.imageSource}
/>
...
}
  • Then when want to open the image
...
this.swipeToCloseRef.onOpen(this.imageRef);
...

Code

import SwipeCloseImage from 'react-native-swipe-close-image';

export default class App extends Component {
  onPressImage = () => {
    this.swipeToCloseRef.onOpen(this.imageRef);
    this.setState({
      imageSource:
        'https://facebook.github.io/react-native/docs/assets/favicon.png'
    });
  };

  render() {
    return (
      <View style={styles.container}>
        <TouchableWithoutFeedback onPress={this.onPressImage}>
          <Image
            ref={c => {
              this.imageRef = c;
            }}
            source={{
              uri:
                'https://facebook.github.io/react-native/docs/assets/favicon.png'
            }}
            resizeMode="contain"
            style={styles.imageStyle}
          />
        </TouchableWithoutFeedback>
        <SwipeCloseImage
          ref={c => (this.swipeToCloseRef = c)}
          imageSource={this.state.imageSource}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center'
  },
  imageStyle: {
    width: 250,
    height: 200
  }
});

Example

Props

Prop Default Type Description
imageSource required string,number Link of the source url (Can be local or remote link)
onOpen required function Function to open the image
resizeMode Contain string Resize mode for the image
backdropColor rgba(0,0,0,0.75) string Backdrop color
durationAnim 250 number Milisecond animation
distanceDismiss SCREEN_HEIGHT / 5 number Distance to auto dismiss close image

Author

Sieu Thai – [email protected]

https://github.com/sieuhuflit

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].