-
close
-
Get Help
-
-
-
+
+
+
+
+
+
+ {{notification.isSuccess ? 'Success' : notification.isError ? 'Error' : ''}}
+
+
+
+
+
diff --git a/desktop-app/src/app/status-bar/status-bar.component.scss b/desktop-app/src/app/status-bar/status-bar.component.scss
index 6f4baaa..f8b78e0 100644
--- a/desktop-app/src/app/status-bar/status-bar.component.scss
+++ b/desktop-app/src/app/status-bar/status-bar.component.scss
@@ -7,9 +7,132 @@
left: 0;
color: white;
width: 100%;
- padding: 5px;
- padding-left: 10px;
+}
+.status-bar-inner{
+ padding: 10px;
+ padding-left: 15px;
+ padding-right: 80px;
}
.status-bar-warning {
background-color: #ff9800;
}
+.status{
+ background-color: #E51253;
+ position: fixed;
+ z-index: 9999;
+ bottom: -45px;
+ left: 0;
+ color: white;
+ width: 100%;
+ transition: bottom 350ms;
+}
+.status-open{
+ bottom: 0px;
+}
+
+
+
+
+
+
+
+
+$info-icon-background-color: rgba(114, 137, 218, 1);
+$success-icon-background-color: rgba(97, 185, 72, 1);
+$warning-icon-background-color: rgba(251, 176, 59, 1);
+$error-icon-background-color: rgba(229, 18, 83, 1);
+
+$toast-text-color: rgba(255, 255, 255, 1);
+
+$info-background-color: rgba(71, 98, 195, 1);
+$success-background-color: rgba(58, 137, 36, 1);
+$warning-background-color: rgba(211, 135, 15, 1);
+$error-background-color: rgba(155, 10, 54, 1);
+
+$info-shadow-color: rgba(114, 137, 218, 0.4);
+$success-shadow-color: rgba(97, 185, 72, 0.4);
+$warning-shadow-color: rgba(251, 176, 59, 0.4);
+$error-shadow-color: rgba(229, 18, 83, 0.4);
+
+
+.sq-toast {
+ position: fixed;
+ min-width: 6rem;
+ opacity: 0.9;
+ font-family: Roboto, sans-serif;
+ font-size: 12px;
+ font-style: normal;
+ font-weight: 400;
+ line-height: 14px;
+ letter-spacing: 0;
+ z-index: 9999;
+ text-align: right;
+}
+@media (max-width: 1024px)
+{
+ .sq-toast{
+ width: 90%;
+ }
+}
+
+.sq-toast--top-right {
+ bottom: -4px;
+ right: 0px;
+}
+
+.sq-toast__message {
+ display: inline-block;
+ color: $toast-text-color;
+ min-height: 42px;
+ margin-left: 1em;
+ margin-top: 1em;
+}
+
+.sq-toast__message--info {
+ background-color: $info-background-color;
+ box-shadow: 0 4px 10px $info-shadow-color;
+}
+.sq-toast__message--success {
+ background-color: $success-background-color;
+ box-shadow: 0 4px 10px $success-shadow-color;
+}
+.sq-toast__message--warning {
+ background-color: $warning-background-color;
+ box-shadow: 0 4px 10px $warning-shadow-color;
+}
+.sq-toast__message--error {
+ background-color: $error-background-color;
+ box-shadow: 0 4px 10px $error-shadow-color;
+}
+
+.sq-toast__message__icon-box {
+ width: 42px;
+ height: 42px;
+ float: left;
+}
+
+.sq-toast__message__text-box {
+ padding: 1.2em;
+ margin-left: 3em;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.sq-toast__message__icon-box--info {
+ background-color: $info-icon-background-color;
+}
+.sq-toast__message__icon-box--success {
+ background-color: $success-icon-background-color;
+}
+.sq-toast__message__icon-box--warning {
+ background-color: $warning-icon-background-color;
+}
+.sq-toast__message__icon-box--error {
+ background-color: $error-icon-background-color;
+}
+
+.sq-toast__message__icon-box__icon {
+ font-size: 2rem;
+ margin: .5rem;
+ text-align: center;
+}
diff --git a/desktop-app/src/app/status-bar/status-bar.component.ts b/desktop-app/src/app/status-bar/status-bar.component.ts
index 64072ca..45d05a2 100644
--- a/desktop-app/src/app/status-bar/status-bar.component.ts
+++ b/desktop-app/src/app/status-bar/status-bar.component.ts
@@ -1,18 +1,86 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { StatusBarService } from '../status-bar.service';
+import { animate, sequence, style, transition, trigger } from '@angular/animations';
+
+export enum StatusType {
+ INFO,
+ ERROR,
+ SUCCESS,
+}
+export class Notification {
+ type: StatusType;
+ message: string;
+ get isError() {
+ return this.type === StatusType.ERROR;
+ }
+ get isSuccess() {
+ return this.type === StatusType.SUCCESS;
+ }
+ get isInfo() {
+ return this.type === StatusType.INFO;
+ }
+}
@Component({
selector: 'app-status-bar',
templateUrl: './status-bar.component.html',
styleUrls: ['./status-bar.component.scss'],
+ animations: [
+ trigger('anim', [
+ transition(':leave', [
+ style({
+ height: '*',
+ opacity: '1',
+ transform: 'translateX(0)',
+ }),
+ sequence([
+ animate(
+ '.1s ease',
+ style({
+ height: '*',
+ opacity: '.2',
+ transform: 'translateX(20px)',
+ })
+ ),
+ animate('.1s ease', style({ height: '0', opacity: 0, transform: 'translateX(20px)' })),
+ ]),
+ ]),
+ transition(':enter', [
+ style({ height: '0', opacity: '0', transform: 'translateX(20px)' }),
+ sequence([
+ animate(
+ '.35s ease',
+ style({
+ height: '*',
+ opacity: 1,
+ transform: 'translateX(0)',
+ })
+ ),
+ ]),
+ ]),
+ ]),
+ ],
})
export class StatusBarComponent implements OnInit {
- isWarning: boolean;
- isActive: boolean;
- showDiscord: boolean;
- statusMessage: string;
- @Output() getHelp = new EventEmitter();
- constructor(public statusService: StatusBarService) {}
+ isActive = false;
+ private timeout;
+ notification: Notification = new Notification();
+ constructor(public statusService: StatusBarService) {
+ statusService.setStatusComponent(this);
+ }
ngOnInit() {}
+
+ showStatus(message: string, isError?: boolean, isInfo?: boolean) {
+ clearTimeout(this.timeout);
+ this.notification.message = message;
+ this.notification.type = isError ? StatusType.ERROR : isInfo ? StatusType.INFO : StatusType.SUCCESS;
+ this.isActive = true;
+ this.timeout = setTimeout(
+ () => {
+ this.isActive = false;
+ },
+ this.notification.isError ? 7500 : 3500
+ );
+ }
}
diff --git a/desktop-app/src/app/stream-options/stream-options.component.ts b/desktop-app/src/app/stream-options/stream-options.component.ts
index fc4f434..11fbaad 100644
--- a/desktop-app/src/app/stream-options/stream-options.component.ts
+++ b/desktop-app/src/app/stream-options/stream-options.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { AppService } from '../app.service';
import { AdbClientService } from '../adb-client.service';
+import { StatusBarService } from '../status-bar.service';
@Component({
selector: 'app-stream-options',
@@ -19,7 +20,7 @@ export class StreamOptionsComponent implements OnInit {
device: '',
};
osPlatform: string;
- constructor(public appService: AppService, private adbService: AdbClientService) {
+ constructor(public appService: AppService, private adbService: AdbClientService, private statusService: StatusBarService) {
appService.webService.isWebviewOpen = false;
appService.resetTop();
this.osPlatform = this.appService.os.platform();
@@ -29,8 +30,9 @@ export class StreamOptionsComponent implements OnInit {
runscrcpy() {
this.scrcpy_options.device = this.adbService.deviceSerial;
- this.appService.runScrCpy(this.scrcpy_options);
- // .then(() => this.statusService.showStatus('Stream closed.'))
- // .catch(e => this.statusService.showStatus('ScrCpy Error: ' + JSON.stringify(e), true));
+ this.appService
+ .runScrCpy(this.scrcpy_options)
+ .then(() => this.statusService.showStatus('Stream closed.'))
+ .catch(e => this.statusService.showStatus('ScrCpy Error: ' + JSON.stringify(e), true));
}
}
diff --git a/desktop-app/src/app/wireless-connection/wireless-connection.component.ts b/desktop-app/src/app/wireless-connection/wireless-connection.component.ts
index 6b70ac6..93f8fc3 100644
--- a/desktop-app/src/app/wireless-connection/wireless-connection.component.ts
+++ b/desktop-app/src/app/wireless-connection/wireless-connection.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { AdbClientService, ConnectionStatus } from '../adb-client.service';
import { AppService } from '../app.service';
+import { StatusBarService } from '../status-bar.service';
@Component({
selector: 'app-wireless-connection',
@@ -8,7 +9,7 @@ import { AppService } from '../app.service';
styleUrls: ['./wireless-connection.component.scss'],
})
export class WirelessConnectionComponent implements OnInit {
- constructor(public adbService: AdbClientService, appService: AppService) {
+ constructor(public adbService: AdbClientService, appService: AppService, private statusService: StatusBarService) {
appService.webService.isWebviewOpen = false;
appService.resetTop();
}
@@ -16,7 +17,9 @@ export class WirelessConnectionComponent implements OnInit {
ngOnInit() {}
connectWifi() {
- this.adbService.deviceStatusMessage = 'Attempting wifi connection...';
+ let status = 'Attempting wifi connection...';
+ this.statusService.showStatus(status, false, true);
+ this.adbService.deviceStatusMessage = status;
((this.adbService.isReady ? this.adbService.runAdbCommand('adb tcpip 5555') : Promise.resolve()) as any).then(() => {
setTimeout(() => {
this.adbService.runAdbCommand('adb connect ' + this.adbService.deviceIp + ':5555');
@@ -26,6 +29,7 @@ export class WirelessConnectionComponent implements OnInit {
reset() {
this.adbService.runAdbCommand('adb disconnect');
+ this.statusService.showStatus('Resetting ADB connection...', false, true);
}
isConnected() {
diff --git a/desktop-app/src/styles.scss b/desktop-app/src/styles.scss
index 6dc0426..a810e53 100644
--- a/desktop-app/src/styles.scss
+++ b/desktop-app/src/styles.scss
@@ -818,3 +818,24 @@ input[type=checkbox]:not(:disabled).tabbed:focus ~ .lever::before {
background-color: #afafaf;
border-color: #8f8f8f;
}
+
+$switch-bg-color: #E51253 !default;
+$switch-checked-lever-bg: desaturate(lighten($switch-bg-color, 25%), 25%) !default;
+
+.switch label input[type=checkbox] {
+ opacity: 0;
+ width: 0;
+ height: 0;
+
+ &:checked + .lever {
+ background-color: $switch-checked-lever-bg!important;
+
+ &:before, &:after {
+ left: 18px;
+ }
+
+ &:after {
+ background-color: $switch-bg-color!important;
+ }
+ }
+}