Skip to content

Commit

Permalink
zoom on feed pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCarstens committed Nov 11, 2018
1 parent 66dcf2c commit 7ed488f
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 10 deletions.
1 change: 1 addition & 0 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<allow-navigation href="http://10.0.0.4:8100" />
<plugin name="cordova-plugin-app-version" spec="^0.1.9" />
<plugin name="cordova-plugin-firebase" spec="^1.1.4" />
<plugin name="com-sarriaroman-photoviewer" spec="^1.1.18" />
<engine name="android" spec="7.1.0" />
<engine name="browser" spec="5.0.4" />
<engine name="ios" spec="4.5.5" />
Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
"@ionic-native/camera": "^4.7.0",
"@ionic-native/core": "4.7.0",
"@ionic-native/firebase": "^4.12.2",
"@ionic-native/photo-viewer": "^4.17.0",
"@ionic-native/splash-screen": "4.7.0",
"@ionic-native/status-bar": "4.7.0",
"@ionic/storage": "^2.2.0",
"angularfire2": "^5.0.1",
"com-sarriaroman-photoviewer": "^1.1.18",
"cordova-android": "7.1.0",
"cordova-browser": "5.0.4",
"cordova-ios": "4.5.5",
Expand Down Expand Up @@ -67,7 +69,8 @@
"cordova-plugin-firebase": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-app-version": {},
"cordova-plugin-camera": {}
"cordova-plugin-camera": {},
"com-sarriaroman-photoviewer": {}
},
"platforms": [
"android",
Expand Down
23 changes: 17 additions & 6 deletions src/app/app.firebaseconfig.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
//using the Implemented Database
//export var config = {
// apiKey: "AIzaSyC_FMJcswceJB7ZYlzaRwKW1ij7kn8K6w4",
// authDomain: "myapp-93470.firebaseapp.com",
// databaseURL: "https://myapp-93470.firebaseio.com",
// projectId: "myapp-93470",
// storageBucket: "myapp-93470.appspot.com",
// messagingSenderId: "412208839835"
// };

//using the Test Database
export var config = {
apiKey: "AIzaSyC_FMJcswceJB7ZYlzaRwKW1ij7kn8K6w4",
authDomain: "myapp-93470.firebaseapp.com",
databaseURL: "https://myapp-93470.firebaseio.com",
projectId: "myapp-93470",
storageBucket: "myapp-93470.appspot.com",
messagingSenderId: "412208839835"
apiKey: "AIzaSyAQD8TaZnXghoRbTE-7_b9LWBK4g3T6hUQ",
authDomain: "dynamics1app.firebaseapp.com",
databaseURL: "https://dynamics1app.firebaseio.com",
projectId: "dynamics1app",
storageBucket: "dynamics1app.appspot.com",
messagingSenderId: "365540790494"
};
3 changes: 3 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import { PopoverController } from 'ionic-angular';
import { Autosize } from '../components/autosize';
import { PopupsProvider } from '../providers/popups/popups';

import { PhotoViewer } from '@ionic-native/photo-viewer';

firebase.initializeApp(config);
firebase.firestore().settings({
timestampsInSnapshots: true
Expand Down Expand Up @@ -72,6 +74,7 @@ firebase.firestore().settings({
AngularFireAuth,
AppVersion,
PopoverController,
PhotoViewer,
//ConfigurePage,
// NavController,
{provide: ErrorHandler, useClass: IonicErrorHandler},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/feed/feed.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{{ post.data().text }}
</ion-item>

<img [src]="post.data().image" *ngIf="post.data().image">
<img [src]="post.data().image" *ngIf="post.data().image" (click)="ViewPhoto(post.data().image)">

<ion-row class="bottom-bar">
<!--LIKES REMOVED.
Expand Down
11 changes: 9 additions & 2 deletions src/pages/feed/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { CommentsPage } from '../comments/comments';
import { CodesignPage } from '../codesign/codesign';
import { Firebase } from '@ionic-native/firebase';
import { PopupsProvider } from '../../providers/popups/popups';
import { PhotoViewer } from '@ionic-native/photo-viewer';

//import * as admin from 'firebase-admin';
//import { UserProvider } from '../../providers/user/user';
Expand Down Expand Up @@ -50,7 +51,8 @@ export class FeedPage {
private alertCtrl: AlertController,
private modalCtrl: ModalController,
private firebaseCordova: Firebase,
public popup: PopupsProvider
public popup: PopupsProvider,
private photoViewer: PhotoViewer
//public userservice: UserProvider,
) {

Expand Down Expand Up @@ -451,6 +453,11 @@ PostSure(){
}


ViewPhoto(url: string) {
//this.image =
this.photoViewer.show(url, '', {share: true});
}


addPhoto() {

Expand Down Expand Up @@ -548,7 +555,7 @@ PostSure(){
uploadTask.on("state_changed", (taskSnapshot: any) => {
console.log(taskSnapshot)
let percentage = taskSnapshot.bytesTransferred / taskSnapshot.totalBytes * 100;
loading.setContent("Uploaded " + percentage + "% ...")
loading.setContent("Uploaded " + percentage + "%...")

}, (error) => {
console.log(error)
Expand Down

0 comments on commit 7ed488f

Please sign in to comment.