Skip to content

Instantly share code, notes, and snippets.

View rocksinghajay's full-sized avatar

Ajay singh rocksinghajay

View GitHub Profile
import React from 'react'
import Router from './Router'
class App extends React.Component {
render() {
return (
<Router />
)
}
package com.splashscreenreactnative;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.splashscreenreactnative">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:statusBarColor">@color/white</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white">#fff</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@color/blue"/>
<item
android:width="200dp"
android:height="200dp"
android:drawable="@mipmap/icon"
import React, { Component } from 'react'
import {
View,
WebView,
ActivityIndicator
} from 'react-native'
import axios from 'axios'
export default class Paypal extends Component {
axios.post('https://api.sandbox.paypal.com/v1/oauth2/token', { grant_type: 'client_credentials' },
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': ` ` // Your Authorization Value
}
}
)
.then(response => {
console.log(response.data.access_token)