Skip to content

Instantly share code, notes, and snippets.

@bioyeneye
Last active April 29, 2019 21:02
Show Gist options
  • Save bioyeneye/1d04535445e569d0e324b7f3488f8b72 to your computer and use it in GitHub Desktop.
Save bioyeneye/1d04535445e569d0e324b7f3488f8b72 to your computer and use it in GitHub Desktop.
import {App, Config, Loading, LoadingOptions, Platform} from "ionic-angular";
import {AccentColor} from "./constant-variables";
import {StatusBar} from "@ionic-native/status-bar";
export class GreenAccentController {
constructor(public platform: Platform,
public statusBar: StatusBar,) {
platform.ready().then(() => {
if (this.platform.is('android')) {
this.statusBar.overlaysWebView(false);
this.statusBar.styleLightContent();
this.statusBar.backgroundColorByHexString(AccentColor.GREEN_ACCENT);
}
})
}
}
export class RedAccentController {
constructor(public platform: Platform,
public statusBar: StatusBar,) {
platform.ready().then(() => {
if (this.platform.is('android')) {
this.statusBar.overlaysWebView(false);
this.statusBar.styleLightContent();
this.statusBar.backgroundColorByHexString(AccentColor.RED_ACCENT);
}
})
}
}
@IonicPage()
@Component({
selector: 'page-login',
templateUrl: 'login.html',
})
export class LoginPage extends GreenAccentController {
constructor(public platform: Platform,
public statusBar: StatusBar,
) {
super(platform, statusBar);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment