Skip to content

Instantly share code, notes, and snippets.

View vaibhavgehani's full-sized avatar

Vaibhav Gehani vaibhavgehani

View GitHub Profile
Name Type Default Description
DATA_URL number 0 Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible
FILE_URI number 1 Return file uri (content://media/external/images/media/2 for Android)
NATIVE_URI number 2 Return native uri (eg. asset-library://... for iOS)
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 4 in line 1.
Name,Type,Default Description
JPEG,number,0,Return JPEG encoded image
PNG,number,1,Return PNG encoded image
Name Type Default Description
JPEG number 0 Return JPEG encoded image
PNG number 1 Return PNG encoded image
Name Type Default Description
PICTURE number 0 Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
VIDEO number 1 Allow selection of video only RETURNS URL
ALLMEDIA number 2 Allow selection from all media types
Name,Type,Default,Description
PHOTOLIBRARY,number,0,Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android)
CAMERA,number,1,Take picture from camera
SAVEDPHOTOALBUM,number,2,Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android)
Name Type Default Description
PHOTOLIBRARY number 0 Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android)
CAMERA number 1 Take picture from camera
SAVEDPHOTOALBUM number 2 Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android)
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
import React from 'react';
import ExploreContainer from '../components/ExploreContainer';
import './Home.css';
const Home: React.FC = () => {
return (
<IonPage>
<IonHeader>
<IonToolbar>
<ion-list>
<ion-item lines="full">
<ion-icon slot="start" name="moon"></ion-icon>
<ion-label>
Toggle Dark Theme
</ion-label>
<ion-toggle (ionChange)="onChange($event)" [(ngModel)]="checked" id="themeToggle" slot="end"></ion-toggle>
</ion-item>
</ion-list>
<ion-list>
<ion-item lines="full">
<ion-icon slot="start" name="moon"></ion-icon>
<ion-label>
Toggle Dark Theme
</ion-label>
<ion-toggle (ionChange)="onChange($event)" id="themeToggle" slot="end"></ion-toggle>
</ion-item>
</ion-list>
onChange(event) {
let darkMode = window.matchMedia("(prefers-color-scheme: dark)");
darkMode.addListener(this.colorTest);
if(event.detail.checked){
document.body.setAttribute('data-theme', 'dark');
}
else{
document.body.setAttribute('data-theme', 'light');
}
}