This file contains 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, {Component} from "react"; | |
import {Animated, Dimensions, Platform, Text, TouchableOpacity, View} from "react-native"; | |
import {Body, Header, List, ListItem as Item, ScrollableTab, Tab, TabHeading, Tabs, Title} from "native-base"; | |
import LinearGradient from "react-native-linear-gradient"; | |
const {width: SCREEN_WIDTH} = Dimensions.get("window"); | |
const IMAGE_HEIGHT = 250; | |
const HEADER_HEIGHT = Platform.OS === "ios" ? 64 : 50; | |
const SCROLL_HEIGHT = IMAGE_HEIGHT - HEADER_HEIGHT; | |
const THEME_COLOR = "rgba(85,186,255, 1)"; |
This file contains 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
export const diffClamp = function( | |
a: Animated.Value<number>, | |
min: number, | |
max: number, | |
): AnimatedDiffClamp { | |
return new AnimatedDiffClamp(a, min, max); | |
}; | |
class AnimatedDiffClamp { | |
constructor(a: Animated.Value<number>, min: number, max: number) { |
This file contains 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
public class GeoLocationModule extends ReactContextBaseJavaModule { | |
public GeoLocationModule(ReactApplicationContext reactContext) { | |
super(reactContext); | |
BroadcastReceiver geoLocationReceiver = new BroadcastReceiver() { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
Location message = intent.getParcelableExtra("message"); | |
GeoLocationModule.this.sendEvent(message); | |
} | |
}; |
This file contains 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
public class AlarmService extends HeadlessJsTaskService { | |
static long lastActive = 0; | |
@Override | |
protected @Nullable | |
HeadlessJsTaskConfig getTaskConfig(Intent intent) { | |
long current = System.currentTimeMillis(); | |
if ((current - lastActive) >= 30 * 1000) { | |
lastActive = current; | |
return new HeadlessJsTaskConfig( |
This file contains 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
public class Alarm extends BroadcastReceiver { | |
@Override | |
public void onReceive(final Context context, Intent intent) { | |
final Intent service = new Intent(context, AlarmService.class); | |
HeadlessJsTaskService.acquireWakeLockNow(context); | |
UiThreadUtil.runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
context.startService(service); |
This file contains 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, { Component } from 'react' | |
import { Animated, Dimensions, Image, StyleSheet, View } from 'react-native' | |
import MapView from 'react-native-maps' | |
import LinearGradient from 'react-native-linear-gradient' | |
import { Body, Card, CardItem, Header, Left, Text, Thumbnail, Title } from 'native-base' | |
import ContentComponent from './ContentComponent' | |
const {height: screenHeight, width: screenWidth} = Dimensions.get('window') | |
export default class MyApp extends Component { |
This file contains 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, {Component} from "react"; | |
import {Animated, Dimensions, Easing, PanResponder, StyleSheet, View} from "react-native"; | |
import {Card} from "./Card"; | |
const {width: screenWidth, height: screenHeight} = Dimensions.get("window"); | |
export class Sliding extends Component { | |
bottomPadding = 10; | |
data = new Array(20).fill({ | |
name: "John Smith", |
This file contains 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
public class GeoLocationService extends Service { | |
public static final String FOREGROUND = "com.app_name.location.FOREGROUND"; | |
private static int GEOLOCATION_NOTIFICATION_ID = 12345689; | |
LocationManager locationManager = null; | |
LocationListener locationListener = new LocationListener() { | |
@Override | |
public void onLocationChanged(Location location) { | |
GeoLocationService.this.sendMessage(location); | |
} |
NewerOlder