Skip to content

Instantly share code, notes, and snippets.

View HristoEftimov's full-sized avatar

Hristo Eftimov HristoEftimov

View GitHub Profile
@HristoEftimov
HristoEftimov / getStateForAction.js
Last active February 25, 2018 21:40
React Native and ReactNavigation: Disable Android's hardware back button for specific screen
const defaultGetStateForAction = AppNavigator.router.getStateForAction;
AppNavigator.router.getStateForAction = (action, state) => {
const screen = state ? state.routes[state.index] : null;
const tab = screen && screen.routes ? screen.routes[screen.index] : null;
const tabScreen = tab && tab.routes ? tab.routes[tab.index] : null;
if (
action.type === NavigationActions.BACK &&
tab && tab.routeName === 'EventsTab' &&
@HristoEftimov
HristoEftimov / NativeScript_Bottom_Nav_templ.jsx
Last active May 19, 2017 07:20
NativeScript: scrollable application with a fixed bottom navigation with nice icon buttons
<ActionBar title="All cocktails"></ActionBar>
<GridLayout rows="*,60">
<ScrollView row="0">
<WrapLayout orientation="horizontal">
<GridLayout *ngFor="let item of data" width="50%" height="150">
<Image
src="~/images/{{ item.imageURL }}"
stretch="aspectFill"
row="1"
></Image>