Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions app/pages/gallery/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@


<ion-content>
<ion-grid>
<ion-row *ngFor="let row of grid">
<ion-col width-50 *ngFor="let file_uri of row">
<img src="{{file_uri}}" />
</ion-col>
</ion-row>
</ion-grid>

</ion-content>
28 changes: 3 additions & 25 deletions app/pages/gallery/gallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,10 @@ import { NavController, NavParams } from 'ionic-angular';
})
export class GalleryPage {

private images: Array<string>;
private grid: Array<Array<string>>;

constructor(private _navCtrl: NavController, private _navParams: NavParams) {
this.images = this._navParams.get('images');
this.grid = Array(Math.ceil(this.images.length/2));
}

ionViewLoaded() {

let rowNum = 0;

for (let i = 0; i < this.images.length; i+=2) {

this.grid[rowNum] = Array(2);
images: Array<string>;

if (this.images[i]) {
this.grid[rowNum][0] = this.images[i]
}
if (this.images[i+1]) {
this.grid[rowNum][1] = this.images[i+1]
}

rowNum++;
}

constructor(public navCtrl: NavController, public navParams: NavParams) {
this.images = this.navParams.get('images');
}

}
26 changes: 13 additions & 13 deletions app/pages/home/home.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.gallery-button {
top: 50%;
transform: translateY(-50%);
position: absolute !important;
margin:0 auto;
width:100%;
top: 50%;
transform: translateY(-50%);
position: absolute !important;
margin:0 auto;
width:100%;
}

ion-icon[name="images"] {
border: #FFFFFF 2px solid;
border-radius: 50%;
background-color: #2155AA;
font-size: 35px;
padding: 15px;
ion-icon[name="images"] {
border: #FFFFFF 2px solid;
border-radius: 50%;
background-color: #2155AA;
font-size: 35px;
padding: 15px;
}

p {
font-size: 20px;
font-size: 20px;
}

6 changes: 3 additions & 3 deletions app/pages/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {GalleryPage} from '../gallery/gallery';

export class HomePage {

constructor(private _navCtrl: NavController) {
constructor(public navCtrl: NavController) {

}

private openGallery (): void {
public openGallery (): void {
let options = {
maximumImagesCount: 8,
width: 500,
Expand All @@ -22,7 +22,7 @@ export class HomePage {
}

ImagePicker.getPictures(options).then(
file_uris => this._navCtrl.push(GalleryPage, {images: file_uris}),
file_uris => this.navCtrl.push(GalleryPage, {images: file_uris}),
err => console.log('uh oh')
);
}
Expand Down