Skip to content

use ProximitySensor in Callscreen to blank screen when near to the ear. #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Antidote/CallBaseController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ class CallBaseController: UIViewController {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
super.viewDidLoad()
// HINT: turn on ProximitySensor to blank screen when near the ear
UIDevice.current.isProximityMonitoringEnabled = true
}

deinit {
// HINT: reset ProximitySensor when calling screen is closed
UIDevice.current.isProximityMonitoringEnabled = false
}

override func loadView() {
loadViewWithBackgroundColor(.clear)

Expand Down