revamp of most screens complete, status bar still needs to be completed
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<div class="inner-app-container">
|
||||
<div *ngIf="!isConnected()">
|
||||
<br>You are not currently connected.
|
||||
<br><br>
|
||||
<div class="pure-material-button-contained" routerLink="/setup">Open Setup Instructions</div>
|
||||
</div>
|
||||
<div *ngIf="isConnected()">
|
||||
<div class="screen-description">Enable wifi mode to install apps wirelessly. You must be connected with USB to enable wifi mode.</div>
|
||||
|
||||
<div class="pure-material-button-contained spaced" (click)="connectWifi()">Connect</div>
|
||||
<div class="pure-material-button-contained spaced flat active" (click)="reset()">Reset</div>
|
||||
|
||||
<div class="divider divider-margin-top margin-bottom"></div>
|
||||
<div class="screen-description">After you connect you will see an arrow appear in the top left, at that point you can disconnect the usb cable.</div>
|
||||
|
||||
<div class="">
|
||||
<i class="material-icons large" [ngClass]="{'green-text':adbService.wifiEnabled}">
|
||||
wifi
|
||||
</i>
|
||||
</div>
|
||||
<div class="screen-description">Device IP: {{adbService.deviceIp}}</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WirelessConnectionComponent } from './wireless-connection.component';
|
||||
|
||||
describe('WirelessConnectionComponent', () => {
|
||||
let component: WirelessConnectionComponent;
|
||||
let fixture: ComponentFixture<WirelessConnectionComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [WirelessConnectionComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(WirelessConnectionComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AdbClientService, ConnectionStatus } from '../adb-client.service';
|
||||
import { AppService } from '../app.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-wireless-connection',
|
||||
templateUrl: './wireless-connection.component.html',
|
||||
styleUrls: ['./wireless-connection.component.scss'],
|
||||
})
|
||||
export class WirelessConnectionComponent implements OnInit {
|
||||
constructor(public adbService: AdbClientService, appService: AppService) {
|
||||
appService.webService.isWebviewOpen = false;
|
||||
appService.resetTop();
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
connectWifi() {
|
||||
this.adbService.deviceStatusMessage = 'Attempting wifi connection...';
|
||||
((this.adbService.isReady ? this.adbService.runAdbCommand('adb tcpip 5555') : Promise.resolve()) as any).then(() => {
|
||||
setTimeout(() => {
|
||||
this.adbService.runAdbCommand('adb connect ' + this.adbService.deviceIp + ':5555');
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.adbService.runAdbCommand('adb disconnect');
|
||||
}
|
||||
|
||||
isConnected() {
|
||||
const isConnected = this.adbService.deviceStatus === ConnectionStatus.CONNECTED;
|
||||
// if (isConnected && !this.isOpen) {
|
||||
// this.isOpen = true;
|
||||
// this.open('/sdcard/');
|
||||
// }
|
||||
return isConnected;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user