Skip to content

Instantly share code, notes, and snippets.

View legobyte's full-sized avatar

Legobytes legobyte

  • Legobyte
  • Istanbul
View GitHub Profile
@Karthik-B-06
Karthik-B-06 / App.tsx
Created January 14, 2022 07:59
Stack Navigation in React Native with Typescript
import * as React from "react";
import { View, Text, Button } from "react-native";
import { NavigationContainer, useNavigation } from "@react-navigation/native";
import { createNativeStackNavigator, NativeStackScreenProps } from "@react-navigation/native-stack";
export type RootStackParamList = {
Home: undefined;
Settings: undefined;
Profile: undefined;
};
@legobyte
legobyte / AndroidSnippets.kt
Last active October 8, 2020 09:10
Android code snippets in Kotlin
// Make EditText clickable not editable
fun makeEditTextClickable(et:EditText){
et.isFocusableInTouchMode = false
et.isLongClickable = false
}
// extract activity from a given context
fun requireActivity(context: Context): Activity {
if (context is Activity) {
return context