Git Product home page Git Product logo

react-native-floating-action's People

Contributors

airhorns avatar alpha0010 avatar araujobarret avatar bell-steven avatar caiangums avatar costagolub avatar dependabot[bot] avatar dopey2 avatar edferreira avatar eumar-8 avatar faogustavo avatar gthrm avatar helderberto avatar keithhackbarth avatar kulyk avatar misaelriojasftf avatar ospsuite avatar ovarunendra avatar peterkuiper avatar ramprakashreddy avatar santomegonzalo avatar staltz avatar tyson90 avatar wongjiahau 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  avatar  avatar  avatar  avatar

react-native-floating-action's Issues

Does not work in expo client

The expo app displays with the following message

"This project uses SDK v27.0.0, but this Expo Client requires at least v33.0.0"

FAB Shadow above button

I was using this component in a test project some days ago, and the FAB looked just like the examples. However, when I started a new project yesterday, the button shadow, that should be under the button, is being rendered above it. The code for both projects is the same, just the colors are different.

Then:
Screenshot_20190929-122254

<FloatingAction
    color="#efefef" overlayColor="rgba(0,0,0,0)"
    onPressMain={() => this.scan(2000)}
    floatingIcon={<Icon color="black" name="bluetooth-searching" />}
/>

Now:
Screenshot_20190929-122235

<FloatingAction
    color="#006aff" overlayColor="rgba(0,0,0,0)"
    onPressMain={() => this.scan(2000)}
    floatingIcon={<Icon color="white" name="bluetooth-searching" />}
/>

Is it a problem with React Native version? The test project used version 0.60.5, this project used 0.61.1.

On pressing the Action Floating button , it gives a blue color, although button is black

<FloatingAction actions={actions} color={"#000"} onPressItem={ (name) => { if(name== 'Logout'){ this.logout() } else if(name== 'ABC'){ Actions.ABC() } else if (name == 'DEF'){ Actions.DEF() } else if(name == 'XYZ'){ this.XYZ({ fromDashBoard: "fromDashBoard" }) } } } />

It gives me a Blue colored shadow for a while,  as i press the action button. I don't want that , kindly help

FAB Action Text margin not working on iPad Mini 4

Expected text label for FAB Actions, works fine on most devices.

FAB-proper-text-spacing

Experiencing the below case on iPad Mini.

FAB-text-spacing-issues-ipad-Mini-4

Unsure what could be causing it, but the padding or margin on the text appears to be breaking for actions.

checkPropTypes

Will be removed by React 16

My package.json dependencies
"dependencies": {
"expo": "^18.0.3",
"react": "16.0.0-alpha.12",
"react-native": "^0.45.1",
"react-native-floating-action": "^1.1.0",
"react-navigation": "^1.0.0-beta.11"
}
`

See below
img_3225
img_3226

Position

Congratulations on your work and thank you very much for making it available.
I use react-native-material-bottom-navigation and the tab is superimposed on the button. How do I position him further up? I do not want him to override Tab, but rather stay a little above it.

How to change main button icon

First of all, congratulations and thank you for this excellent job!
Is it possible to change the icon of the main button?
If yes, how ?

Overwrite position for main button

I'd be great to be able to overwrite the bottom, for all positions, and left / right values for right and left positioning using props. Do you think it's a good idea? I can do a PR if you want.

overlay doesn't cover tab navigation

When using react-navigation to render a bottom tab, it isn't covered by the overlay in the floating action button. Is there any way around this?

distanceToEdge is not working for different pages.

I have used distanceToEdge props, to show the icon in every page in every position, but it's not working, I put that in main APP page
Here is my code,

floatingIconEdge = () => {
// floating icon showing edges for different screens
const { currentScreen } = this.state
Reactotron.log({ currentScreen: currentScreen });
switch (currentScreen) {
case 'ShopScreen':
return { vertical: 0, horizontal: 0 }
case 'StoreHome':
return { vertical: 10, horizontal: 10 }
default:
return { vertical: 40, horizontal: 40 }
}
}
<FloatingAction
actions={actions}
floatingIcon={<Icon name={'ios-help-circle-outline'} style={{ fontSize: 30, color: '#ffffff' }} />}
onPressItem={name => {
Reactotron.error({ name });
NavigationService.navigate('ChatRoom')
}}
distanceToEdge={this.floatingIconEdge()}
color={'#2cb673'}
visible={this.floatingIconVisible()}
/>

Change FloatingAction's Size

Hello, can i change the FloatingAction button's size? I tried to change the "floatingIcon" props, but it only changed the icon, not the size

Button doesn't have elevation

The FAB is covered (i.e. not shown) when there are other components with an elevation on the same screen that take up the same space that it does. I tried adding elevation to PropTypes and elevation to the shadow properties, but it hasn't worked.

Disable animation

Is it possible to stop the rotation animation of the button when it is pressed? I just need the button itself.

Can not use inside scrollview

Hi,

This is good component but i guess we can not use inside scrollview. When i put inside the scrollview fab button shows in the end of container. I expected that fab must stay spesific location.

Unable to tap the button when position is absolute [Android]

Hello, first of all thank you for this library ๐Ÿ‘

I had encountered a problem when wrapping a view with position absolute. The action button doesn't seem to trigger any click.

I am still fairly new to React Native, so if I had misunderstood any usage parts please let me know, thanks!

This issue is on Android. iOS is working fine.

Example code:

    <View style={ {position: 'absolute', top: 80, left: 80} }>
      <FloatingAction />
    </View>

React Native: 0.60.5
Device: Tried physical/emulator, Pixel XL API 29

How to reset isActive state ?

Hi,
I am trying to redirect to another screen in certain conditions when tapping on main button. This happens, however when navigating back to the screen is showing the inactive backdrop. User has to tap on the screen to make it active. Until then the state remained at false. How do I set the state to false programatically so that screen remains active after I navigate away ?

visible prop not working in initial render - always set to `true`

This code does not work as expected. The button is always visible in the first render.

Works as expected when updating the state and making the someArray an empty array.

     ...
      <FloatingAction
        overrideWithAction
        actions={FABactions}
        visible={this.state.someArray.length > 0}
        onPressItem={() => console.log('FAB pressed')}
        buttonColor="#6699CC"
      />

trying to set the visible prop to false also display the FAB...

This code below works as expected in first render. (but lacks the awesome entrance animation)

{this.state.someArray.length > 0 && (
          <FloatingAction
            overrideWithAction
            actions={FABactions}
            onPressItem={() => console.log('FAB pressed')}
            buttonColor="#6699CC"
          />
        )
}

Interest in contributing with this project

Hello Gonzalo, how are you?

I am using this library and I have to thank you, this is an awesome library, the best that I found for React Native.

I am currently modifying it to use on my project, and I was thinking which those mods can be useful to this project.

Because of the size of lodash library, I am removing it from the lib, and I am enabling the some styles of FloatingActionItems, like width, height, padding, margin, even in the centered Items.
And of course, I am respecting the patterns keeping it like a high order component itself.

If this sounds interesting to your project, I would be glad to contribute with this project.

Ps.: these changes aren't done yet
Cheers.

Action button giving ripple drawable error on android API 19. KITKAT

Hello, the floating action button is giving error in andorid API <21. full error as follows:

Error while updating property 'nativeBackgroundAndroid' of a view managed by: RCTView

null

Ripple drawable is not available on android API <21
updateViewProp
ViewManagersPropertyCache.java:95
setProperty
ViewManagerPropertyUpdater.java:129
.
.
.

Action Button not showing up on Android, working fine on iOS

I am using Floating Action Button version 1.13.0. It's working find on iOS but doesnt even show up on Android, I even tried changing layouts and also tried out variants of relative and absolute position but no luck...

          <View style={{justifyContent:'flex-end'}}>
            <FloatingAction
              ref={(component)=>{this.floatingAtionMenu=component}}
              actions={this.state.actions}
              showBackground={false}
              color={Values.Colors.COLOR_PRIMARY}
              overlayColor={Values.Colors.COLOR_PRIMARY}
              onPressItem={(name)=>{
                console.log(`Selected Fab Action: ${name}`)
              }}
              />
            </View>

Some information about versions I am using...

React Native

"react-native": "0.52.0",
"react-native-floating-action": "^1.13.0"

Android

compileSdkVersion   = 27
targetSdkVersion    = 27
minSdkVersion       = 16
buildToolsVersion   = "27.0.3"
supportLibVersion   = "27.0.2"
googlePlayServicesVersion = "15.0.1"

Some Screenshots
iOS
simulator screen shot - iphone 6 - 2018-10-17 at 14 47 23

Android
screenshot_1539769759

floating main close icon

First of all it is really great. I was looking for this kind of fabs finally i got.
I want to change main floating icons.

I used floatingIcon props to change. icon is changed as expected but i need close icon when user click on floating button.

can anyone help me ?

[Feature Request] On main button state changed callback

First of all, thank you for publishing your great module. It perfectly matches my needs and is customize-able enough for more advanced scenarios as well.

One feature that will make it even better is for the component to accept a callback function which will be triggered every time the state of the main button changes (open/closed). My use-case is that I want to change the main button's background colour when it's active. There is an onPressMain callback, but I cannot detect when the user closes the overlay and thus I cannot change the colour to the default one.

latest version seems broken

error โ–ถ๏ธŽ Failed to compile.
error โ–ถ๏ธŽ [ '/Users/vsts/agent/2.155.1/work/1/s/common/temp/node_modules/.onedrive.pkgs.visualstudio.com/react-native-floating-action/1.19.0/[email protected][email protected]/node_modules/react-native-floating-action/src/FloatingAction.js\nModule build failed (from /Users/vsts/agent/2.155.1/work/1/s/common/temp/node_modules/.onedrive.pkgs.visualstudio.com/babel-loader/8.0.6/[email protected]/node_modules/babel-loader/lib/index.js):\nSyntaxError: /Users/vsts/agent/2.155.1/work/1/s/common/temp/node_modules/.onedrive.pkgs.visualstudio.com/react-native-floating-action/1.19.0/[email protected][email protected]/node_modules/react-native-floating-action/src/FloatingAction.js: Unexpected token, expected "," (134:10)\n\n 132 | buttonSize +\n 133 | this.distanceToVerticalEdge\n> 134 | actionsPaddingTopBottom +\n | ^\n 135 | height -\n 136 | (isIphoneX() ? 40 : 0),\n 137 | duration:

Question on your TODO

I'm interested in contributing and was wondering what you meant by crazy animations? Is there anything I can do to help this repo?

Thanks.

FloatingAction button shadow

Even if we are providing the custom component for The Floating Button, the shadow is still visible.

image

Code:

<FloatingAction
  distanceToEdge={30}
  actions={actions}
  floatingIcon={<View style={{ height: 50, width: 50, backgroundColor: 'yellow', borderRadius: 50 }} />}
  color="transparent"
  actionsPaddingTopBottom={0}
  showBackground={false}
  onOpen={this.handleOpen}
  onClose={this.handleClose}
  onPressItem={this.handlePressItem}
/>

Wrong ripple color

version: 1.10.1

Looks like shadeColor function supports only #00879d color format.

It causes weird ripple effect with wrong color in case of FloatingAction color is set in other formats.
It would be nice to have support of other color formats for example: rgba(0,135,157,1) or #888.
Or some note about it in readme at FloatingAction's color prop.

shadeColor('rgba(0,135,157,1)', -30);
// returns that color #ff0700

I suggest to use this lib for color shading:
https://github.com/Qix-/color

How to apply to createMaterialTopTabNavigator ?

Hi,

I'm trying to put the FAB over a TopTapNavigator created using createMaterialTopTabNavigator method.
My idea is that the button floats over any tab (not changing with tab content)

Do you have an example of how to do that ? That would be great !

Thanks

Expo example is broken.

While trying to open the expo example in its latest android app, it shows the following error:
"This experience uses SDK v27.0.0, but this Expo client requires at least v33.0.0".

I can see a branch #update-expo-example. I am willing to make a pull request. Where do I start?

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.