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
/* | |
* Copyright (c) 2016. Emmanuel Gutierrez Hernandez | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
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 { Text } from 'react-native' | |
import FlatList from 'react-native/Libraries/Lists/FlatList' | |
import dataList from './dataList' | |
export default class ListViewToFlatList extends React.Component { | |
renderItem ({ item, index }) { | |
return <Text>{item}</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
mkdir -p node_modules/react-native/Libraries/Lists/ && \ | |
for file in 'FlatList' 'MetroListView' 'SectionList' 'VirtualizedList' 'VirtualizedSectionList' 'ViewabilityHelper' 'VirtualizeUtils'; \ | |
do curl https://raw.githubusercontent.com/facebook/react-native/master/Libraries/Lists/${file}.js > node_modules/react-native/Libraries/Lists/${file}.js; \ | |
done |
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
mkdir -p node_modules/react-native/Libraries/Lists/ && \ | |
for file in 'FlatList' 'MetroListView' 'SectionList' 'VirtualizedList' 'VirtualizedSectionList' 'ViewabilityHelper' 'VirtualizeUtils'; \ | |
do curl https://raw.githubusercontent.com/facebook/react-native/master/Libraries/Lists/${file}.js > node_modules/react-native/Libraries/Lists/${file}.js; \ | |
done |
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
/*These functions are for to generate points uniformly, randomly, and independently | |
within a circle of radius r around a location (x0, y0), | |
*/ | |
function latAndlonGenerator (radius) { | |
const RADIUS_IN_METERS = 70000 | |
let r = RADIUS_IN_METERS / 111300, // Convert meters in degrees (111,300 meters = a degree.) | |
y0 = 40.416775, // Central point where to generate more coordinates, inside a circle | |
x0 = -3.70379, // In this case, Madrid. | |
u = Math.random(), | |
v = Math.random(), |
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
[ | |
"Homer J. Simpson", | |
"Marge Simpson (née Bouvier)", | |
"Bart Simpson", | |
"Lisa Simpson", | |
"Maggie Simpson", | |
"Grandpa Abe Simpson", | |
"Patty Bouvier", | |
"Selma Bouvier", | |
"Mona Simpson", |
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
private void goToActivity(View view, Activity fromActivity, | |
final Class<? extends Activity> toActivity) { | |
Intent i = new Intent(fromActivity, toActivity); | |
Bundle bundle; | |
if (Build.VERSION.SDK_INT >= 23) { | |
bundle = ActivityOptions.makeClipRevealAnimation(view, 0, 0, view.getWidth(), | |
view.getHeight()).toBundle(); | |
} else { | |
bundle = ActivityOptions.makeScaleUpAnimation(view, 0, 0, view.getWidth(), | |
view.getHeight()).toBundle(); |
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 android.content.Context; | |
import android.os.Build; | |
import android.view.View; | |
import android.view.animation.AnimationUtils; | |
public class SimpleViewAnimation { | |
public static final int SLOW_ANIM = 1900; | |
public static final int FAST_ANIM = 800; | |
public static final int DELAY_ANIM_DEFAULT = 500; |
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 ExmpleFragment : Fragment(), View.OnClickListener { | |
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? { | |
val view: View = inflater!!.inflate(R.layout.fragment, container, false) | |
val btn: Button = view.find(R.id.button2) | |
btn.setOnClickListener(this) | |
return 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
?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<dimen name="material_text_button">14sp</dimen> | |
<dimen name="material_text_menu">14sp</dimen> | |
<dimen name="material_text_caption">12sp</dimen> | |
<dimen name="material_text_body1">14sp</dimen> | |
<dimen name="material_text_body2">13sp</dimen> | |
<dimen name="material_text_subhead">16sp</dimen> | |
<dimen name="material_text_title">20sp</dimen> | |
<dimen name="material_text_headline">24sp</dimen> |
OlderNewer