Skip to content

Commit

Permalink
upload from media library
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCarstens committed Nov 10, 2018
1 parent 74df8b4 commit 66dcf2c
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 2 deletions.
Binary file modified resources/android/icon/drawable-hdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-ldpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-mdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-xhdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-xxhdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-xxxhdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-land-hdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-land-ldpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-land-mdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-land-xhdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-land-xxhdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-land-xxxhdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-port-hdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-port-ldpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-port-mdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-port-xhdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-port-xxhdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/splash/drawable-port-xxxhdpi-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 51 additions & 2 deletions src/pages/feed/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ CheckNumberVisits(){

if (this.force_contribute==1){
if (this.student_must_contribute==0){
this.popup.ForceContribute();
this.popup.ForceContribute();
}}

else if (this.askpost_lurkers=="1"){
Expand Down Expand Up @@ -454,8 +454,57 @@ PostSure(){

addPhoto() {

this.launchCamera();
const actionSheet = this.actionSheetCtrl.create({
title: 'Adding a Photo',
buttons: [
{
text: 'Use Camera',
role: 'destructive',
handler: () => {
this.launchCamera();
console.log('Camera clicked');
}
},{
text: 'Load from Library',
handler: () => {
//this.takePicture(this.camera.PictureSourceType.PHOTOLIBRARY);
this.openLibrary();
console.log('Library clicked');
}
},{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actionSheet.present();
}

openLibrary() {
let options: CameraOptions = {
quality: 100,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.PNG,
mediaType: this.camera.MediaType.PICTURE,
correctOrientation: true,
targetHeight: 512,
targetWidth: 512,
allowEdit: true
}

this.camera.getPicture(options).then((base64Image) => {
console.log(base64Image);

this.image = "data:image/png;base64," + base64Image;


}).catch((err) => {
console.log(err)
})
}

launchCamera() {
Expand Down

0 comments on commit 66dcf2c

Please sign in to comment.