Coder Social home page Coder Social logo

chrisfisher / react-native-directed-scrollview Goto Github PK

View Code? Open in Web Editor NEW
149.0 3.0 67.0 7.6 MB

UNMAINTAINED- see below. A natively implemented scrollview component which lets you specify different scroll directions for child content.

License: MIT License

JavaScript 20.30% Objective-C 26.75% Ruby 1.57% Java 47.60% Python 3.78%
react-native scrollview direction native scroll react javascript reactnative horizontal vertical

react-native-directed-scrollview's Introduction

UNMAINTAINED

This library is no longer actively maintained and is not guaranteed to work with the latest version of React Native. Feel free to fork the repo and/or adapt the code.

react-native-directed-scrollview

demo

A natively implemented scrollview component which lets you specify different scroll directions for child content.

The iOS implementation extends the default UIScrollView component, whereas the Android implementation is custom and aims to provide some limited parity with the iOS api.

The following props are supported:

Prop Default Description
scrollEnabled true When false, the view cannot be scrolled via touch interaction.
pinchGestureEnabled true When true, ScrollView allows use of pinch gestures to zoom in and out.
minimumZoomScale 1.0 How far the content can zoom out.
maximumZoomScale 1.0 How far the content can zoom in.
bounces true Whether content bounces at the limits when scrolling.
bouncesZoom true Whether content bounces at the limits when zooming.
alwaysBounceHorizontal false When bounces is enabled, content will bounce horizontally even if the content is smaller than the bounds of the scroll view.
alwaysBounceVertical false When bounces is enabled, content will bounce vertically even if the content is smaller than the bounds of the scroll view..
ios showsVerticalScrollIndicator true Whether vertical scroll bars are visible.
ios showsHorizontalScrollIndicator true Whether horizontal scroll bars are visible.

The following methods are supported:

Method Example Description
scrollTo scrollTo({x: 100, y: 100, animated: true}) Scrolls to a given x and y offset.

Installation

  • npm install react-native-directed-scrollview --save
  • react-native link (or rnpm link)

Usage

To work properly this component requires that a fixed-size content container be specified through the contentContainerStyle prop.

import ScrollView, { ScrollViewChild } from 'react-native-directed-scrollview';
...

export default class Example extends Component {
  render() {
    return (
      <ScrollView
        bounces={true}
        bouncesZoom={true}
        maximumZoomScale={2.0}
        minimumZoomScale={0.5}
        showsHorizontalScrollIndicator={false}
        showsVerticalScrollIndicator={false}
        contentContainerStyle={styles.contentContainer}
        style={styles.container}
      >
        <ScrollViewChild scrollDirection={'both'}>
          // multi-directional scrolling content here...
        </ScrollViewChild>
        <ScrollViewChild scrollDirection={'vertical'}>
          // vertically scrolling content here...
        </ScrollViewChild>
        <ScrollViewChild scrollDirection={'horizontal'}>
          // horizontally scrolling content here...
        </ScrollViewChild>
      </ScrollView>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  contentContainer: {
    height: 1000,
    width: 1000,
  },
})

See the example project for more detail.

react-native-directed-scrollview's People

Contributors

aidurber avatar chrisfisher avatar kevinsperrine avatar lecler-i avatar michaeldanieltom avatar noitidart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-directed-scrollview's Issues

Build error - Could not find method implementation()

Hi there,
In latest package I am getting the error pasted below when doing react-native run-android.

I suspect it's because of using implementation in your android/build.gradle, which I think is gradle 3+ only. And default react-native ships with gradle 2.

dependencies {
    implementation 'com.facebook.react:react-native:+'
}
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Mercurius\Documents\GitHub\trustedplatform_android\node_modules\react-native-directed-scrollview\android\build.gradle' line: 22

* What went wrong:
A problem occurred evaluating project ':react-native-directed-scrollview'.
> Could not find method implementation() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

How to get current Scale?

Currently when changing zoom and try to call scrollTo() we will get the invalid scroll position on Android and IOS

Issue when linking via cocoapods

First of all thanks to everyone involved in building this great component!

When running react-native link react-native-directed-scrollview with CocoaPods setup I ran into the following error: "Invariant Violation: requireNativeComponent: “DirectedScrollViewChild” was not found in the UIManager". I saw in the Pods Xcode Project that this lib was missing.
I got around it by simply deleting the "ios/Pods" file and running react-native link react-native-directed-scrollview again, so it would link it directly in the main Xcodeproj rather than via the pod file. After that i restored my Podfile. However I'm not exactly sure what's the issue when react-native link uses the pod file. (I did run `pod install and also tried multiple times deleting node_modules, Pods, Podfile.lock, DerivedData)
I'm mostly writing this in case anyone runs into the same issue so they know how to work around :)

Not work on android

Dear,

I test your examples, it is not work on android.

Could you tell me how to resolve it?

Thanks

Android doesn't work again

Hey, I have built an app using this library. on ios works just fine. but when tried it on android galaxy s10 it does not scroll.
zoom still works.
Is there a fix for that?

Thank you for the great work!

onScroll and other callbacks are not called

Hey guys,
I'm having trouble getting some of the scrollview callbacks to trigger like onMomentumScrollEnd and onScroll. These callbacks do not seem to be called on the underlying NativeScrollView component either. Anyone have any idea what's going on? I'm using RN-0.48.0 on iOS 11.

Thanks for making this great component!

Differing view sizes on orientation change

I'm using your directed scroll view in my app and I have a different layout on portrait than I have on landscape.

Portrait is a 2x3 grid of views (1024x1536px) and landscape is a 3x2 grid of views (1536x1024px)

I am configuring the directed scrollview like this:

<ScrollView
  bounces={true}
  bouncesZoom={true}
  maximumZoomScale={2.0}
  minimumZoomScale={this.state.fitScale}
   showsHorizontalScrollIndicator={true}
   showsVerticalScrollIndicator={true}
   style={styles.container}
   contentContainerStyle={[{
     width: this.state.containerWidth,
     height: this.state.containerHeight,
   }]}>
     <ScrollViewChild scrollDirection={'both'}>
       {this.state.isPortrait ? this._renderPortrait() : this._renderLandscape()}
     </ScrollViewChild>
</ScrollView>

Where this.state.containerWidth and ...Height are dynamically changed depending on orientation.

I am finding that the transition doesn't seem to work very well - the scrollview gets offset and its not possible to pan or zoom to get it back into view.

Accessing view manager configs directly off UIManager via UIManager['DirectedScrollView'] is no longer supported

I'm getting the following warning trying to use reac-native-directed-scrollview, and the ScrollView doesn't allow me to scroll
screenshot_20190204_211806
screenshot_20190204_211943

My code:

import React from 'react';
import {
  View,
} from 'react-native';

import ScrollView, { ScrollViewChild } from 'react-native-directed-scrollview';

export default class Grid extends React.Component {

  render() {
    return (
      <ScrollView
        bounces={true}>
        
        <ScrollViewChild scrollDirection={'both'}>
          <View style={{ flexDirection: 'row' }}>
            <View style={{ width: '50%', aspectRatio: 1 }}>
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
            </View>

            <View style={{ width: '50%', aspectRatio: 1 }}>
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
            </View>

            <View style={{ width: '50%', aspectRatio: 1 }}>
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
              <View style={{ marginTop: '2%', width: '10%', aspectRatio: 1, backgroundColor: '#aaffaa' }} />
            </View>

          </View>
        </ScrollViewChild>
      </ScrollView>
    )
  }
}

Environment:

  "dependencies": {
    "react": "16.6.3",
    "react-native": "0.58.3",
    "react-native-gesture-handler": "^1.0.15",
    "react-native-navigation": "^2.8.0",
    "react-native-paper": "^2.7.0",
    "react-native-vector-icons": "^6.2.0",
    "react-native-directed-scrollview": "^2.0.0",
    "react-navigation": "^3.0.9",
    "react-navigation-material-bottom-tabs": "^1.0.0"
  },
  "devDependencies": {
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "24.0.0",
    "jest": "24.0.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.6.3"
  },

ios doesn't work either

error:Violation: requireNativeComponent: "DirectedScrollViewChild" was not found in the UIManager.

ı did the linking process (react-native link react-native-directed-scrollview) not working and
added manuel ios/PodFile (
pod 'react-native-directed-scrollview', :path => '../node_modules/react-native-directed-scrollview/react-native-directed-scrollview.podspec')

changed package version ^1.3.7" or "2.0.0"
deleted node_modules folder and ios/pods uploaded again
not working.

node version : v10.14.2
react-native-directed-scrollview version version : ^1.3.7" or "2.0.0"
react-native version : 0.62.2

Getting com.facebook.react.bridge.NativeArgumentsParseException

I have used scrollview given in sample app and when I run it on android it throwing below error:

com.facebook.react.bridge.NativeArgumentsParseException: TypeError: expected dynamic type double', but had type null' (constructing arguments for UIManager.dispatchViewManagerCommand at argument index 1)

"react": "^16.2.0",
"react-native": "^0.49.5",
"react-native-directed-scrollview": "^1.3.6",

Can anyone help me out.. please.!!

Increase Performance by Using VirtualizedLists

Fantastic library. Exactly what I was looking for. Love the feature and example of row and column labels.
However, I stumble across the same problem when I tried to implement it on my own using RN . It's quite slow when rendering a lot of entries. I'm talking about 300 items per row and 300 columns -> 90.000 items.
I stumbled across which uses which needs a renderItem method to render only Items which are visible. It seems like a good idea. Is this somehow incoperatable into this library in order to make it render faster for huge amounts of items?
Specifying exact dimensions of each items is not an issue.

Keep up the good work!

Content size not responding to changes in contentContainerSize on iOS with RN 52.2

Hey guys,
Whenever contentContainerSize changes, the native scrollview's content size stays the same.
I think it might have to do with this commit which fixed some bugs, but may have introduced others.

Additionally, when the ScrollView is first mounted, the content seems to be placed correctly, but quickly animates out of the field of view.

Thanks for any help, and great library!

Directed scrollView doesn't work correctly on Android.

How to use directedScrollView on Android?
I tried it on Android platform but have received broken view.

videomp4.mp4

IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.7199119
Visual Studio: Not Found
Languages:
Java: 1.8.0_211
npmPackages:
@react-native-community/cli: Not Found
react: ^17.0.1 => 17.0.2
react-native: 0.64.0 => 0.64.0
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

Build error on android

After installation when I try to build and run on android device I see:

...
:react-native-directed-scrollview:processReleaseResources
:react-native-directed-scrollview:generateReleaseSources
:react-native-directed-scrollview:incrementalReleaseJavaCompilationSafeguard
:react-native-directed-scrollview:compileReleaseJavaWithJavac
:react-native-directed-scrollview:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/home/default/projects/react-native/AwesomeProject/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollView.java:161: error: no suitable method found for emitScrollEvent(DirectedScrollView)
    ReactScrollViewHelper.emitScrollEvent(this);
                         ^
    method ReactScrollViewHelper.emitScrollEvent(ViewGroup,float,float) is not applicable
      (actual and formal argument lists differ in length)
    method ReactScrollViewHelper.emitScrollEvent(ViewGroup,ScrollEventType) is not applicable
      (actual and formal argument lists differ in length)
    method ReactScrollViewHelper.emitScrollEvent(ViewGroup,ScrollEventType,float,float) is not applicable
      (actual and formal argument lists differ in length)
/home/default/projects/react-native/AwesomeProject/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollView.java:166: error: method emitScrollEndDragEvent in class ReactScrollViewHelper cannot be applied to given types;
      ReactScrollViewHelper.emitScrollEndDragEvent(this);
                           ^
  required: ViewGroup,float,float
  found: DirectedScrollView
  reason: actual and formal argument lists differ in length
/home/default/projects/react-native/AwesomeProject/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollViewPackage.java:20: error: method does not override or implement a method from a supertype
  @Override
  ^
Note: /home/default/projects/react-native/AwesomeProject/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
:react-native-directed-scrollview:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.
...

My environment:

         "dependencies": {
		"react": "16.0.0-alpha.12",
		"react-native": "0.47.1",
		"react-native-directed-scrollview": "1.2.1"
	},
	"devDependencies": {
		"babel-jest": "20.0.3",
		"babel-preset-react-native": "2.1.0",
		"jest": "20.0.4",
		"react-test-renderer": "16.0.0-alpha.12"
	}


node -v
v7.4.0

Any ideas what is wrong?

Android: Could not find method implementation()

In version 1.3.7, I get the error:
A problem occurred evaluating project ':react-native-directed-scrollview'. Could not find method implementation() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

TouchableHighlight's onPress overly sensitive within a ScrollViewChild (android)

I noticed that the onPress forTouchableHighlight is overly sensitive within a ScrollViewChild as I scroll around the content view area.

If the TouchableHighlight is within a regular react-native ScrollView, it's not sensitive like this.

In the documentation for onPress (https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#onpress) it says that it's "Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock)."

Is it maybe not being cancelled properly because it's within a ScrollViewChild?

Error compileDebugJavaWithJavac FAILED on Android

First of all, I really loved your component, it's exactly what I was looking for.

But I'm a bit noob with React Native, and following the installation instructions and trying to compile on my physical Android device, the process is interrupted and throws the following error:

> Task :react-native-directed-scrollview:compileDebugJavaWithJavac FAILED
/Users/jorgeverdugo/Projects/mi-utem/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollViewManager.java:68: error: method getJSEventName in enum ScrollEventType cannot be applied to given types;
        .put(ScrollEventType.MOMENTUM_END.getJSEventName(), MapBuilder.of("registrationName", "onMomentumScrollEnd"))
                                         ^
  required: ScrollEventType
  found: no arguments
  reason: actual and formal argument lists differ in length
/Users/jorgeverdugo/Projects/mi-utem/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollViewManager.java:67: error: method getJSEventName in enum ScrollEventType cannot be applied to given types;
        .put(ScrollEventType.MOMENTUM_BEGIN.getJSEventName(), MapBuilder.of("registrationName", "onMomentumScrollBegin"))
                                           ^
  required: ScrollEventType
  found: no arguments
  reason: actual and formal argument lists differ in length
/Users/jorgeverdugo/Projects/mi-utem/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollViewManager.java:66: error: method getJSEventName in enum ScrollEventType cannot be applied to given types;
        .put(ScrollEventType.END_DRAG.getJSEventName(), MapBuilder.of("registrationName", "onScrollEndDrag"))
                                     ^
  required: ScrollEventType
  found: no arguments
  reason: actual and formal argument lists differ in length
/Users/jorgeverdugo/Projects/mi-utem/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollViewManager.java:65: error: method getJSEventName in enum ScrollEventType cannot be applied to given types;
        .put(ScrollEventType.BEGIN_DRAG.getJSEventName(), MapBuilder.of("registrationName", "onScrollBeginDrag"))
                                       ^
  required: ScrollEventType
  found: no arguments
  reason: actual and formal argument lists differ in length
/Users/jorgeverdugo/Projects/mi-utem/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollViewManager.java:64: error: method getJSEventName in enum ScrollEventType cannot be applied to given types;
        .put(ScrollEventType.SCROLL.getJSEventName(), MapBuilder.of("registrationName", "onScroll"))
                                   ^
  required: ScrollEventType
  found: no arguments
  reason: actual and formal argument lists differ in length
Note: /Users/jorgeverdugo/Projects/mi-utem/node_modules/react-native-directed-scrollview/android/src/main/java/com/rnds/DirectedScrollViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-directed-scrollview:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

I have no idea what to do, so I would appreciate if you could help me

Parameter for adjusting scroll start?

Thanks for a great module :)

Right now, the scrollview immediately scrolls on touch, thus "stealing" the touch event for the any buttons/Touchable components that might be in it.

Would it be possible to add a sort of minimum touch movement before the scroll happens? As it is now, when I try to click on a button, I have to be extremely careful not to move my finger, otherwise the button doesn't receive the event.

On scrolling screen freezes in iOS. (Xcode "Thread 1: signal SIGABRT" exception)

I'm using this module in my app. Module works fine for Android but I've an issue with iOS.

Issue is the screen freezes whenever I try to scroll the view. Xcode throws an error Thread 1: signal SIGABRT exception. Help me figure it out.

Module version: "react-native-directed-scrollview": "^1.3.1"
React Native version: "react-native": "^0.51.0"

Let me know if any extra details are required.

Share my xcode logs here.

2018-01-11 16:31:04.900278+0530 BViewApp[32291:1015594] -[RCTView shouldScrollVertically]: unrecognized selector sent to instance 0x7fb08b4e4770
2018-01-11 16:31:04.906010+0530 BViewApp[32291:1015594] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RCTView shouldScrollVertically]: unrecognized selector sent to instance 0x7fb08b4e4770'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000010fa3812b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x000000010dbedf41 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010fab9024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   UIKit                               0x00000001124cef51 -[UIResponder doesNotRecognizeSelector:] + 295
	4   CoreFoundation                      0x000000010f9baf78 ___forwarding___ + 1432
	5   CoreFoundation                      0x000000010f9ba958 _CF_forwarding_prep_0 + 120
	6   BViewApp                            0x000000010ce57975 -[DirectedScrollView scrollViewDidScroll:] + 501
	7   UIKit                               0x0000000112394e2f -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 68
	8   UIKit                               0x000000011237ae87 -[UIScrollView setContentOffset:] + 493
	9   BViewApp                            0x000000010cc6a1a7 -[RCTCustomScrollView setContentOffset:] + 503
	10  UIKit                               0x0000000112380bc6 -[UIScrollView _updatePanGesture] + 2387
	11  UIKit                               0x000000011289c273 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 57
	12  UIKit                               0x00000001128a528a _UIGestureRecognizerSendTargetActions + 333
	13  UIKit                               0x00000001128a29ba _UIGestureRecognizerSendActions + 307
	14  UIKit                               0x00000001128a1c26 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1002
	15  UIKit                               0x000000011288699c _UIGestureEnvironmentUpdate + 1329
	16  UIKit                               0x000000011288641f -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 484
	17  UIKit                               0x00000001128854cb -[UIGestureEnvironment _updateGesturesForEvent:window:] + 288
	18  UIKit                               0x0000000112313f14 -[UIWindow sendEvent:] + 4102
	19  UIKit                               0x00000001122b7365 -[UIApplication sendEvent:] + 352
	20  UIKit                               0x0000000112c03a1d __dispatchPreprocessedEventFromEventQueue + 2809
	21  UIKit                               0x0000000112c06672 __handleEventQueueInternal + 5957
	22  CoreFoundation                      0x000000010f9db101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	23  CoreFoundation                      0x000000010fa7af71 __CFRunLoopDoSource0 + 81
	24  CoreFoundation                      0x000000010f9bfa19 __CFRunLoopDoSources0 + 185
	25  CoreFoundation                      0x000000010f9befff __CFRunLoopRun + 1279
	26  CoreFoundation                      0x000000010f9be889 CFRunLoopRunSpecific + 409
	27  GraphicsServices                    0x00000001165f69c6 GSEventRunModal + 62
	28  UIKit                               0x000000011229b5d6 UIApplicationMain + 159
	29  BViewApp                            0x000000010cbaa04f main + 111
	30  libdyld.dylib                       0x000000011456ed81 start + 1
	31  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Invalid single quote in podspec

When running pod install it fails with the following:

[!] Failed to load 'react-native-directed-scrollview' podspec: 
[!] Invalid `react-native-directed-scrollview.podspec` file: syntax error, unexpected tCONSTANT, expecting keyword_end
  s.dependency 'React'
                     ^
/Users/andrewdurber/code/testapp/node_modules/react-native-directed-scrollview/react-native-directed-scrollview.podspec:21: unterminated string meets end of file
/Users/andrewdurber/code/testapp/node_modules/react-native-directed-scrollview/react-native-directed-scrollview.podspec:21: syntax error, unexpected end-of-input, expecting keyword_end.

Which was caused by the single quote being: instead of '

Already got a PR setup and ready to go #26

Zoom event

Hello !

First, thanks for all the work, this little lib of yours is awesome !
It fits perfectly my needs, i just have one or two little features missing and it would be awesome... I don't know if you want to give it a look ?

onZoom event

Give a onZoom callback on props, that will be called on zoom with the actual scalefactor.
That would be pretty awesome to... add details to the grid the more we zoom in for example.

DirectedScrollViewChild : disableZoom props

Simple and straightForward... be able to not apply the zoon on a DirectedScrollViewChild (in case of the fix header for example)

I know, i can't really ask you to add features like that... I tried myself and i know only a bit about java and i didnt even manage to get anything working... (not even speaking about android)

I know it should not be that hard to implement too, so if someone have a little bit of spare time... would really appreciate <3

Android - Type Error. Error happened once ScrollView rendered

Versions:
"react-native": "0.53.3"
"react": "16.2.0"
"react-native-directed-scrollview": "1.3.6"

Code:
2018-03-12 11 20 36

Works Perfect on iOS but shows type error on android:
TypeError: expected dynamic type double, but had type null constructing arguments for UiManager.dispatchViewManagerCommand at argument index 1

29132993_10204634004805715_5150280560932814848_o

Please help me :(

Know when cell is pressed?

Hi,

Thanks for creating this component, it's very handy.

Is there a way of knowing when a cell is pressed? I wrap my cells in a <TouchableOpacity> but onPress is never called. Do you perhaps consume the onPress event in ScrollView or ScrollViewChild? Was hoping I could send an onPress attribute and have a method called when a cell is pressed.

class GridContent extends Component {
...
renderCell(cell) {
  return (
    <TouchableOpacity
      onPress = {() => { console.log('onPress') }}
      key = {cell.id}
      style = {styles.cellContainer}
    >
      <Text>{cell.id}</Text>
    </TouchableOpacity>
  )
}
...

Thank you.

The specified child already has a parent

Sometimes I get this error: "The specified child already has a parent. You must call removeView() on the child's parent first."

I don't remember getting this error before using this library. Is it related to this library?

android_emulator_-_nexus_5x_api_25_x86_5554

setting up initialScale

Hi Chris,

Thank you for this great extension.

Is it possible to set initial scale somehow? I want content be zoomed out/in while rendering

How to use with expo.io?

I used exp init to create a new project. I did npm install --save of this library. In App.js I import ScrollView and ScrollViewChild. I use exp start to run the App, and the Expo client on my phone to view it.
I get the error:
Warning: Native component for "DirectedScrollView" does not exist
and similar error for ScrollViewChild.
How can I resolve this?
Thanks.

Build issue

I had the following error

Execution failed for task ':react-native-directed-scrollview:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  Output:  /Users/obsidianart/HDD/GIT/imagzle/node_modules/react-native-directed-scrollview/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  /Users/obsidianart/HDD/GIT/imagzle/node_modules/react-native-directed-scrollview/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  /Users/obsidianart/HDD/GIT/imagzle/node_modules/react-native-directed-scrollview/android/build/intermediates/res/merged/release/values/values.xml:957: error: resource android:attr/fontVariationSettings not found.
  /Users/obsidianart/HDD/GIT/imagzle/node_modules/react-native-directed-scrollview/android/build/intermediates/res/merged/release/values/values.xml:958: error: resource android:attr/ttcIndex not found.
  error: failed linking references.
  
  Command: /Users/obsidianart/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/24fc49a54beeb394af9f7efc15d0a12c/aapt2-3.2.1-4818971-osx/aapt2 link -I\
          /Users/obsidianart/Library/Android/sdk/platforms/android-26/android.jar\
          --manifest\
          /Users/obsidianart/HDD/GIT/imagzle/node_modules/react-native-directed-scrollview/android/build/intermediates/aapt_friendly_merged_manifests/release/processReleaseManifest/aapt/AndroidManifest.xml\
          -o\
          /var/folders/zv/9q28yy151370p5m_h1nmzx5r0000gn/T/aapt-2196059786566862826-out\

and I was using build 27.0.3 (now I'm on 28).
I don't know what causes the error but I'm writing what fixed it for the next person:

  • open build.gradle inside the node_modules folder in this package
  • replace with the following at the top
android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

Since currently I'm not in a CI with this project I can change directly the package but if someone with more knowledge than me can explain how else it can be fixed I would really appreciate

Does not scroll if the RN version is 0.52

I checked the example, which works very well. However I wanted to include in my project, which is based on 0.52, and on iOS it does not scroll. On Android it works perfectly.

Work on latest RN?

Hi,

Did anyone make this work on latest RN 0.71.X?
Any alternatives to diagonal scrolling?

Thanks!

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.