Skip to content

Instantly share code, notes, and snippets.

Avatar

Erik Behrends behrends

View GitHub Profile
View AppDatabase.kt
package com.example.roomexample
import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
@Database(entities = [Person::class], version = 1)
abstract class AppDatabase : RoomDatabase() {
abstract fun personDao(): PersonDao
View OrderTextView
<TextView
android:id="@+id/order_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="8dp"
android:text="Order:"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
@behrends
behrends / workshop20181130.md
Last active Nov 30, 2018
React Native Workshop CAS 30.11.2018
View workshop20181130.md

Workshop zu React Native am CAS am 30.11.2018

Hier sind die relevanten Änderungen der einzelnen Schritte zu sehen.

10:05: neues Snack-Projekt

App.js

import React from 'react';
@behrends
behrends / App.js
Created Jul 4, 2018
14:10 - Zitat der Liste hinzufügen
View App.js
import React, { Component } from 'react';
import { Button, StyleSheet, View } from 'react-native';
import Quote from './js/components/Quote';
import NewQuote from './js/components/NewQuote';
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
@behrends
behrends / NewQuote.js
Created Jul 4, 2018
13:55 - Modal mit TextInputs
View NewQuote.js
import React, { Component } from 'react';
import { Modal, StyleSheet, Text, TextInput, View } from 'react-native';
export default class NewQuote extends Component {
render() {
return (
<Modal
visible={this.props.visible}
onRequestClose={this.props.onRequestClose}
>
@behrends
behrends / App.js
Created Jul 4, 2018
13:45 - Modal in Komponente NewQuote
View App.js
import React, { Component } from 'react';
import { Button, StyleSheet, View } from 'react-native';
import Quote from './js/components/Quote';
import NewQuote from './js/components/NewQuote';
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
View gist:f5037aa17e9323858046aa59155c49fd
import React, { Component } from 'react';
import { Button, Modal, StyleSheet, Text, View } from 'react-native';
import Quote from './js/components/Quote';
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
},
@behrends
behrends / Quote.js
Created Jul 4, 2018
13:20 - Quote mit Styling
View Quote.js
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class Quote extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.text}>{this.props.text}</Text>
<Text style={styles.author}>&mdash; {this.props.author}</Text>
</View>
@behrends
behrends / App.js
Created Jul 4, 2018
11:40 - Zitat als Komponente
View App.js
import React, { Component } from 'react';
import { Button, StyleSheet, View } from 'react-native';
import Quote from './js/components/Quote';
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
@behrends
behrends / Quote.js
Created Jul 4, 2018
11:30 - In js/components/
View Quote.js
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class Quote extends Component {
render() {
return <Text>Hallo!!!!!!!!!!!</Text>;
}
}
You can’t perform that action at this time.