-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(statusbar): implement overlay and background color in iOS
- Loading branch information
1 parent
4fa3245
commit 93d32dd
Showing
12 changed files
with
423 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.capacitorjs.plugins.statusbar; | ||
|
||
import com.getcapacitor.util.WebColor; | ||
|
||
public class StatusBarConfig { | ||
private boolean overlaysWebView = true; | ||
private Integer backgroundColor = WebColor.parseColor("#000000"); | ||
private String style = "DEFAULT"; | ||
|
||
public boolean isOverlaysWebView() { | ||
return overlaysWebView; | ||
} | ||
|
||
public void setOverlaysWebView(boolean overlaysWebView) { | ||
this.overlaysWebView = overlaysWebView; | ||
} | ||
|
||
public Integer getBackgroundColor() { | ||
return backgroundColor; | ||
} | ||
|
||
public void setBackgroundColor(Integer backgroundColor) { | ||
this.backgroundColor = backgroundColor; | ||
} | ||
|
||
public String getStyle() { | ||
return style; | ||
} | ||
|
||
public void setStyle(String style) { | ||
this.style = style; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
status-bar/ios/Sources/StatusBarPlugin/CAPBridgeViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Capacitor | ||
|
||
extension CAPBridgeViewController { | ||
|
||
open override func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
NotificationCenter.default.post(Notification(name: .capacitorViewDidAppear)) | ||
} | ||
|
||
open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { | ||
super.viewWillTransition(to: size, with: coordinator) | ||
NotificationCenter.default.post(Notification(name: .capacitorViewWillTransition)) | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
status-bar/ios/Sources/StatusBarPlugin/CAPNotifications.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Capacitor | ||
|
||
extension Notification.Name { | ||
public static let capacitorViewDidAppear = Notification.Name(rawValue: "CapacitorViewDidAppear") | ||
public static let capacitorViewWillTransition = Notification.Name(rawValue: "CapacitorViewWillTransition") | ||
} |
Oops, something went wrong.