Skip to content

Instantly share code, notes, and snippets.

View Drzaln's full-sized avatar
:octocat:
Building Mobile Apps

Doddy Rizal Novianto Drzaln

:octocat:
Building Mobile Apps
  • Tangerang, Indonesia.
View GitHub Profile
@Drzaln
Drzaln / custom-font-RN.md
Last active January 15, 2023 09:24
Cara tambah custom font di React Native

UPDATE, MULAI RN 0.69 MANUAL LINKING SUDAH DIREMOVE (npx react-native link menjadi npx react-native-asset)

  1. Masukkan Font keadalam direktori src/assets/fonts
  2. buat file react-native.config.js di direktori root lalu isi dengan
module.exports = {
    assets: ['./src/assets/fonts/'] 
}
@Drzaln
Drzaln / React Native - Disable force night mode.md
Last active January 31, 2021 11:38
Mematikan force dark mode di react native, khususnya MIUI 12

Tambahkan kode berikut di dalam <styles> tag pada file styles.xml

<item name="android:forceDarkAllowed">false</item>

sehingga file styles.xml menjadi seperti ini

<resources>
 
import { withNavigationFocus } from 'react-navigation';
const FocusAwareStatusBar = withNavigationFocus(({ isFocused, ...rest }) =>
isFocused ? <StatusBar {...rest} /> : null,
);
<FocusAwareStatusBar
translucent
backgroundColor="transparent"
barStyle="dark-content"
@Drzaln
Drzaln / main.dart
Last active July 26, 2021 00:32
main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@Drzaln
Drzaln / INTUNE WRAP.md
Last active April 18, 2022 07:56
Step sign app wrap intune.md

BUILD

cd android/ && ./gradlew assembleRelease && cd ..

WRAP

wrap with INTUNE

@Drzaln
Drzaln / file.md
Created September 30, 2022 13:53
Change location of close tab button to left on vscode

add this line to user setting "workbench.editor.tabCloseButton": "left",

@Drzaln
Drzaln / rn_run_iphone.md
Last active January 23, 2023 03:04
Run react native apps directly to iPhone
  1. Enable Developer Mode in Settings -> Privacy & Security
  2. install ios-deploy globally using npm install -g ios-deploy
  3. run xcrun xctrace list devices to list all devices
  4. run npx react-native run-ios --device "phone name"
@Drzaln
Drzaln / round_corner.md
Created March 2, 2023 02:23
Rounded corner for outer element
@Drzaln
Drzaln / PulseBadge.tsx
Created May 16, 2024 08:42
Pulse badge component
import React, {useRef, useEffect} from 'react';
import {View, StyleSheet} from 'react-native';
import Animated, {
useSharedValue,
useAnimatedStyle,
withTiming,
withRepeat,
Easing,
withDelay,
} from 'react-native-reanimated';
@Drzaln
Drzaln / AnimateBorderView.tsx
Created May 16, 2024 08:49
Animate border view
import React from 'react';
import {View, StyleSheet, Pressable, LayoutChangeEvent} from 'react-native';
import Animated, {
useSharedValue,
useAnimatedStyle,
withRepeat,
withTiming,
Easing,
} from 'react-native-reanimated';
import LinearGradient from 'react-native-linear-gradient';