fix: edit state overlay views display when push profile scene issue
This commit is contained in:
parent
78a444f14b
commit
526f125cb2
|
@ -220,6 +220,9 @@ extension ProfileHeaderViewController {
|
||||||
super.viewDidAppear(animated)
|
super.viewDidAppear(animated)
|
||||||
|
|
||||||
viewModel.viewDidAppear.value = true
|
viewModel.viewDidAppear.value = true
|
||||||
|
|
||||||
|
// set display after view appear
|
||||||
|
profileHeaderView.setupAvatarOverlayViews()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidLayoutSubviews() {
|
override func viewDidLayoutSubviews() {
|
||||||
|
|
|
@ -144,7 +144,7 @@ extension ProfileHeaderViewModel {
|
||||||
return html?.text
|
return html?.text
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if profile chagned or not
|
// check if profile change or not
|
||||||
func isProfileInfoEdited() -> Bool {
|
func isProfileInfoEdited() -> Bool {
|
||||||
guard isEditing.value else { return false }
|
guard isEditing.value else { return false }
|
||||||
|
|
||||||
|
|
|
@ -74,9 +74,14 @@ final class ProfileHeaderView: UIView {
|
||||||
return imageView
|
return imageView
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
func setupAvatarOverlayViews() {
|
||||||
|
editAvatarBackgroundView.backgroundColor = UIColor.black.withAlphaComponent(0.6)
|
||||||
|
editAvatarButton.tintColor = .white
|
||||||
|
}
|
||||||
|
|
||||||
let editAvatarBackgroundView: UIView = {
|
let editAvatarBackgroundView: UIView = {
|
||||||
let view = UIView()
|
let view = UIView()
|
||||||
view.backgroundColor = UIColor.black.withAlphaComponent(0.6)
|
view.backgroundColor = .clear // set value after view appeared
|
||||||
view.layer.masksToBounds = true
|
view.layer.masksToBounds = true
|
||||||
view.layer.cornerCurve = .continuous
|
view.layer.cornerCurve = .continuous
|
||||||
view.layer.cornerRadius = ProfileHeaderView.avatarImageViewCornerRadius
|
view.layer.cornerRadius = ProfileHeaderView.avatarImageViewCornerRadius
|
||||||
|
@ -87,7 +92,7 @@ final class ProfileHeaderView: UIView {
|
||||||
let editAvatarButton: HighlightDimmableButton = {
|
let editAvatarButton: HighlightDimmableButton = {
|
||||||
let button = HighlightDimmableButton()
|
let button = HighlightDimmableButton()
|
||||||
button.setImage(UIImage(systemName: "photo", withConfiguration: UIImage.SymbolConfiguration(pointSize: 28)), for: .normal)
|
button.setImage(UIImage(systemName: "photo", withConfiguration: UIImage.SymbolConfiguration(pointSize: 28)), for: .normal)
|
||||||
button.tintColor = .white
|
button.tintColor = .clear
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ final class ProfileViewController: UIViewController, NeedsDependency, MediaPrevi
|
||||||
|
|
||||||
let refreshControl: UIRefreshControl = {
|
let refreshControl: UIRefreshControl = {
|
||||||
let refreshControl = UIRefreshControl()
|
let refreshControl = UIRefreshControl()
|
||||||
refreshControl.tintColor = .label
|
refreshControl.tintColor = .white
|
||||||
return refreshControl
|
return refreshControl
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue