This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package galihlprakoso.com.solidprinciple; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| /** | |
| * | |
| * @author galihlarasprakoso | |
| */ | |
| interface PekerjaBangunan { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require('http'); | |
| const hostname = '127.0.0.1'; | |
| const port = 3000; | |
| const server = http.createServer((req, res) => { | |
| res.statusCode = 200; | |
| res.setHeader('Content-Type', 'text/plain'); | |
| res.end('Hello World\n'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { StyleSheet, Text, View } from 'react-native'; | |
| export default class App extends React.Component { | |
| render() { | |
| return ( | |
| <View style={styles.container}> | |
| <Text>Hello World!</Text> | |
| </View> | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Image source={pic} style={{width: 193, height: 110}}/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { StyleSheet, Text, View } from 'react-native'; | |
| //Custom Component bernama Pahlawaan | |
| class Pahlawan extends React.Component { | |
| render(){ | |
| return ( | |
| <View> | |
| {/* Menampilkan props 'nama' yang dikirimkan oleh Parentnya. */} | |
| <Text>{this.props.nama}</Text> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Pahlawan extends React.Component { | |
| state = { tampil:true };//Menginisialisasi state tampil=true sebagai nilai awal | |
| componentDidMount(){ | |
| setInterval(() => ( //Berfungsi untuk memanggil fungsi secara berulang-ulang | |
| this.setState({ tampil: !this.state.tampil })//Mengubah state menjadi nilai inversnya | |
| ), 1000);//Delay dalam miliseconds 1000ms = 1 detik. | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { StyleSheet, Text, View } from 'react-native'; | |
| //Custom Component bernama Pahlawaan | |
| class Pahlawan extends React.Component { | |
| state = { tampil:true };//Menginisialisasi state tampil=true sebagai nilai awal | |
| componentDidMount(){ | |
| setInterval(() => ( //Berfungsi untuk memanggil fungsi secara berulang-ulang |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const styles = StyleSheet.create({ | |
| container: { | |
| flex: 1, | |
| flexDirection:'row',// <-- 1 | |
| alignItems: 'center',// <-- 2 | |
| justifyContent: 'center',// <-- 3 | |
| backgroundColor: '#fff' | |
| }, | |
| namaPahlawan:{ | |
| color:'red', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| //Mengimport TextInput, FlatList, TouchableHighlight, KeyboardAvoidingView | |
| import { StyleSheet,Text, View, TextInput, | |
| FlatList, TouchableHighlight, KeyboardAvoidingView } from 'react-native'; | |
| class Pahlawan extends React.Component { | |
| //Hapus inisialisasi state dan kode untuk membuat teks tidak berkedip lagi | |
| render(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "ios": { | |
| "supportsTablet": true, | |
| "bundleIdentifier": "galihlprakoso.com.reactnativedasar" | |
| }, | |
| "android": { | |
| "package": "galihlprakoso.com.reactnativedasar" | |
| } |