Skip to content

Commit

Permalink
Change icon and splash. Add loading service
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasJordi committed Oct 26, 2021
1 parent f889b1a commit 16a6de5
Show file tree
Hide file tree
Showing 77 changed files with 128 additions and 11 deletions.
Binary file modified .github/readme/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-land-hdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-land-mdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-land-xhdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-land-xxhdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-land-xxxhdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-port-hdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-port-mdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-port-xhdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-port-xxhdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-port-xxxhdpi/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Binary file modified resources/android/icon-background.png
Binary file modified resources/android/icon-foreground.png
Binary file modified resources/android/icon/drawable-hdpi-icon.png
Binary file modified resources/android/icon/drawable-ldpi-icon.png
Binary file modified resources/android/icon/drawable-mdpi-icon.png
Binary file modified resources/android/icon/drawable-xhdpi-icon.png
Binary file modified resources/android/icon/drawable-xxhdpi-icon.png
Binary file modified resources/android/icon/drawable-xxxhdpi-icon.png
Binary file modified resources/android/icon/hdpi-background.png
Binary file modified resources/android/icon/hdpi-foreground.png
Binary file modified resources/android/icon/ldpi-background.png
Binary file modified resources/android/icon/ldpi-foreground.png
Binary file modified resources/android/icon/mdpi-background.png
Binary file modified resources/android/icon/mdpi-foreground.png
Binary file modified resources/android/icon/xhdpi-background.png
Binary file modified resources/android/icon/xhdpi-foreground.png
Binary file modified resources/android/icon/xxhdpi-background.png
Binary file modified resources/android/icon/xxhdpi-foreground.png
Binary file modified resources/android/icon/xxxhdpi-background.png
Binary file modified resources/android/icon/xxxhdpi-foreground.png
Binary file modified resources/android/splash/drawable-land-hdpi-screen.png
Binary file modified resources/android/splash/drawable-land-ldpi-screen.png
Binary file modified resources/android/splash/drawable-land-mdpi-screen.png
Binary file modified resources/android/splash/drawable-land-xhdpi-screen.png
Binary file modified resources/android/splash/drawable-land-xxhdpi-screen.png
Binary file modified resources/android/splash/drawable-land-xxxhdpi-screen.png
Binary file modified resources/android/splash/drawable-port-hdpi-screen.png
Binary file modified resources/android/splash/drawable-port-ldpi-screen.png
Binary file modified resources/android/splash/drawable-port-mdpi-screen.png
Binary file modified resources/android/splash/drawable-port-xhdpi-screen.png
Binary file modified resources/android/splash/drawable-port-xxhdpi-screen.png
Binary file modified resources/android/splash/drawable-port-xxxhdpi-screen.png
Binary file modified resources/assets/adapt.xcf
Binary file not shown.
Binary file modified resources/assets/splash.xcf
Binary file not shown.
Binary file modified resources/icon.png
Binary file modified resources/splash.png
2 changes: 1 addition & 1 deletion src/app/modals/reader/reader.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


<ion-content (click)="setShowBar()">
<app-loading-spinner-component *ngIf="loading"></app-loading-spinner-component>

<ion-list #leitor (click)="setShowBar()">
<ion-item (click)="setShowBar()" *ngFor="let item of data;index as i;">{{item.conteudo}}</ion-item>

Expand Down
6 changes: 4 additions & 2 deletions src/app/modals/reader/reader.page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AfterViewInit, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
import { Gesture, GestureController, ModalController } from '@ionic/angular';
import { StatusBar, Style } from '@capacitor/status-bar';
import { LoadingService } from 'src/app/services/loading.service';

@Component({
selector: 'app-reader',
Expand All @@ -17,7 +18,8 @@ export class ReaderPage implements AfterViewInit {
loading=true
constructor(
private gestureCtrl: GestureController,
private modalController: ModalController
private modalController: ModalController,
public loadingService: LoadingService
) { }
start=0
end=0
Expand Down Expand Up @@ -51,7 +53,7 @@ export class ReaderPage implements AfterViewInit {

})
this.data=this.source.readNovel(this.chapter.link)
setTimeout(()=>this.loading=false,2000)
this.loadingService.presentLoading(this.data)
gesture.enable();
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/novel-page/novel-page.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<p>Adicionar a Biblioteca</p>
</ion-buttons>
</div>
<app-loading-spinner-component *ngIf="loading"></app-loading-spinner-component>


<ion-list >
<ion-item *ngFor="let item of chapters;index as i;" (click)="openReader(item)" class="ion-activatable ripple-parent">
Expand Down
21 changes: 19 additions & 2 deletions src/app/pages/novel-page/novel-page.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ModalController, NavController } from '@ionic/angular';
import { ReaderPage } from 'src/app/modals/reader/reader.page';
import { LoadingService } from 'src/app/services/loading.service';

@Component({
selector: 'app-novel-page',
Expand All @@ -18,11 +19,26 @@ export class NovelPagePage implements OnInit {
public modalController: ModalController,
private route: ActivatedRoute,
private router: Router,
public nav: NavController
public nav: NavController,
public loadingService: LoadingService
) { }
addLibrary(){
this.library=!this.library
}
testLoading(data){
if(data.length>0){
this.loading=false

}else{
setTimeout(()=>{
if(data.length>0){
this.loading=false

}
},2000)
}

}

async openReader(item) {
const modal = await this.modalController.create({
Expand All @@ -44,7 +60,8 @@ export class NovelPagePage implements OnInit {
let caminho=this.router.getCurrentNavigation().extras.state.item.caminho
this.chapters=this.router.getCurrentNavigation().extras.state.source.getChapters(caminho)
this.source=this.router.getCurrentNavigation().extras.state.source
setTimeout(()=>this.loading=false,2000)

this.loadingService.presentLoading(this.chapters)
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/novels-page/novels-page.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div #item style="height: 60px;">

</div>
<app-loading-spinner-component *ngIf="loading"></app-loading-spinner-component>


<ion-list class="listNovels" #content>

Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/novels-page/novels-page.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ ion-card {
ion-img{
width: 100%;
border-radius: 100px;
}
}
27 changes: 24 additions & 3 deletions src/app/pages/novels-page/novels-page.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { NavController } from '@ionic/angular';
import { NovelDTO } from 'src/app/models/novel.dto';
import { LoadingService } from 'src/app/services/loading.service';

@Component({
selector: 'app-novels-page',
Expand All @@ -18,7 +19,8 @@ export class NovelsPagePage implements OnInit {
constructor(
private route: ActivatedRoute,
private router: Router,
public nav: NavController
public nav: NavController,
public loadingService: LoadingService
) {


Expand All @@ -37,6 +39,23 @@ export class NovelsPagePage implements OnInit {


}
testLoading(data){
if(data.length>0){
this.loading=false

}else{
setTimeout(()=>{
if(data.length>0){
this.loading=false

}
},2000)
}

}




ngOnInit() {

Expand All @@ -46,8 +65,10 @@ export class NovelsPagePage implements OnInit {
if (this.router.getCurrentNavigation().extras.state) {
this.scan = this.router.getCurrentNavigation().extras.state.scan.nome;
this.source=this.router.getCurrentNavigation().extras.state.scan.source
this.obras=this.router.getCurrentNavigation().extras.state.scan.source.getAllNovels()
setTimeout(()=>this.loading=false,2000)
this.obras=this.router.getCurrentNavigation().extras.state.scan.source.getAllNovels()

this.loadingService.presentLoading(this.obras)



}
Expand Down
16 changes: 16 additions & 0 deletions src/app/services/loading.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';

import { LoadingService } from './loading.service';

describe('LoadingService', () => {
let service: LoadingService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(LoadingService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
});
61 changes: 61 additions & 0 deletions src/app/services/loading.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { Injectable } from '@angular/core';
import { LoadingController } from '@ionic/angular';

@Injectable({
providedIn: 'root'
})
export class LoadingService {

constructor(public loadingController: LoadingController) { }

async presentLoading(data) {
const loading = await this.loadingController.create({
cssClass: 'my-custom-class',
message: 'Please wait...',

});
await loading.present();

if(data.length>0){
await loading.dismiss();
}else{
setTimeout(async()=>{
if(data.length>0){
await loading.dismiss();
}else{
setTimeout(async()=>{
if(data.length>0){
await loading.dismiss();
}else{
setTimeout(async()=>{
if(data.length>0){
await loading.dismiss();
}else{
setTimeout(async()=>{

await loading.dismiss();

},2000)
}
},2000)
}
},2000)
}
},2000)
}
}
testLoading(data){
if(data.length>0){


}else{
setTimeout(()=>{
if(data.length>0){


}
},2000)
}

}
}

0 comments on commit 16a6de5

Please sign in to comment.