-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Does this support Android? #97
Comments
It should work on both platforms, without any additional setup. On android there is a cropped shadow bug, but other than that it should work just like on iOS.Can you share some code? |
I am basically using the example in the repo: |
I was able to get the fabs to show up on android by adding a height to the view but it does not position itself above the other view above it in the code. |
exactly. this component needs to be placed in the root of your app :) |
@mastermoo Sorry for digging this old issue, i have the same problem, ios is working fine, on android it wont work on debug nor release (signed or not). I have actionbutton inside a View and it's down at the bottom of the code. |
Same issue on my end has anyone gotten this working? |
I got it working on Android after moving it closer the root of my app, right beneath the AppNavigator. I thought I would be ok putting it at the root of View in the StackNavigator, but that was not the case for some reason. Using the example from the import { addNavigationHelpers } from 'react-navigation';
const AppNavigator = StackNavigator(AppRouteConfigs);
const initialState = AppNavigator.router.getStateForAction(AppNavigator.router.getActionForPathAndParams('Login'));
const navReducer = (state = initialState, action) => {
const nextState = AppNavigator.router.getStateForAction(action, state);
// Simply return the original `state` if `nextState` is null or undefined.
return nextState || state;
};
const appReducer = combineReducers({
nav: navReducer,
...
});
class App extends React.Component {
render() {
return (
<AppNavigator navigation={addNavigationHelpers({
dispatch: this.props.dispatch,
state: this.props.nav,
})} />
);
}
}
const mapStateToProps = (state) => ({
nav: state.nav
});
const AppWithNavigationState = connect(mapStateToProps)(App);
const store = createStore(appReducer);
class Root extends React.Component {
render() {
return (
<Provider store={store}>
<AppWithNavigationState />
</Provider>
);
}
} becomes: (abridged) class App extends React.Component {
render() {
return (
<View style={{display: 'flex', flex: 1}}>
<AppNavigator navigation={addNavigationHelpers({
dispatch: this.props.dispatch,
state: this.props.nav,
})} />
<MyActionButton />
</View>
);
}
} where const MyActionButton = (props) =>
<ActionButton
...some props
>
{ props.actionItems.map((x, i) =>
<ActionButton.Item
index={i}
buttonColor={x.color}
title={x.title}
onPress={() => props.dispatch({ type: 'ACTION_BUTTON_PRESSED', payload: x.action })}
>
<Icon name={x.iconName} size={20} color={x.iconColor} />
</ActionButton.Item>
)}
</ActionButton> |
Does this support Android? I don't see any documentation on additional support/setup for Android. I saw that it is supposed to support iOS and Android but I cannot see the Action button when I am testing on Android but it does show up on iOS. Am I missing some additional Android setup.
The text was updated successfully, but these errors were encountered: