From 29436f372c045d8bfaec1cb0e7a573f8f16da52c Mon Sep 17 00:00:00 2001 From: Nora Trapp Date: Wed, 23 Mar 2022 09:05:28 -0700 Subject: [PATCH] Fix camera button in dark theme --- .../Stories/StoriesViewController.swift | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Signal/src/ViewControllers/HomeView/Stories/StoriesViewController.swift b/Signal/src/ViewControllers/HomeView/Stories/StoriesViewController.swift index a3690eae62..5b4611de55 100644 --- a/Signal/src/ViewControllers/HomeView/Stories/StoriesViewController.swift +++ b/Signal/src/ViewControllers/HomeView/Stories/StoriesViewController.swift @@ -20,12 +20,6 @@ class StoriesViewController: OWSViewController { title = NSLocalizedString("STORIES_TITLE", comment: "Title for the stories view.") - let cameraButton = UIBarButtonItem(image: Theme.iconImage(.cameraButton), style: .plain, target: self, action: #selector(showCameraView)) - cameraButton.accessibilityLabel = NSLocalizedString("CAMERA_BUTTON_LABEL", comment: "Accessibility label for camera button.") - cameraButton.accessibilityHint = NSLocalizedString("CAMERA_BUTTON_HINT", comment: "Accessibility hint describing what you can do with the camera button") - - navigationItem.rightBarButtonItems = [cameraButton] - databaseStorage.appendDatabaseChangeDelegate(self) tableView.register(StoryCell.self, forCellReuseIdentifier: StoryCell.reuseIdentifier) @@ -34,6 +28,7 @@ class StoriesViewController: OWSViewController { tableView.estimatedRowHeight = 116 reloadStories() + updateNavigationBar() } private var timestampUpdateTimer: Timer? @@ -97,6 +92,16 @@ class StoriesViewController: OWSViewController { view.backgroundColor = Theme.secondaryBackgroundColor tableView.backgroundColor = Theme.secondaryBackgroundColor } + + updateNavigationBar() + } + + private func updateNavigationBar() { + let cameraButton = UIBarButtonItem(image: Theme.iconImage(.cameraButton), style: .plain, target: self, action: #selector(showCameraView)) + cameraButton.accessibilityLabel = NSLocalizedString("CAMERA_BUTTON_LABEL", comment: "Accessibility label for camera button.") + cameraButton.accessibilityHint = NSLocalizedString("CAMERA_BUTTON_HINT", comment: "Accessibility hint describing what you can do with the camera button") + + navigationItem.rightBarButtonItems = [cameraButton] } @objc