mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Show new avatar image as soon as it has been chosen.
Also, lighten the editing overlay effect on the header and avatar images.
This commit is contained in:
parent
48be2e2f8f
commit
eb2b874ab5
@ -116,7 +116,9 @@ extension ProfileHeaderView.ViewModel {
|
||||
)
|
||||
.sink { avatarImageURL, avatarImageEditing, isEditing, _ in
|
||||
view.avatarButton.avatarImageView.image = avatarImageEditing
|
||||
view.avatarButton.avatarImageView.configure(with: (!isEditing || avatarImageEditing == nil) ? avatarImageURL : nil)
|
||||
if !isEditing || avatarImageEditing == nil {
|
||||
view.avatarButton.avatarImageView.configure(with: avatarImageURL)
|
||||
}
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
// blur for blocking & blockingBy
|
||||
|
@ -32,8 +32,8 @@ final class ProfileHeaderView: UIView {
|
||||
static let friendshipActionButtonSize = CGSize(width: 108, height: 34)
|
||||
static let bannerImageViewPlaceholderColor = UIColor.systemGray
|
||||
|
||||
static let bannerImageViewOverlayViewBackgroundNormalColor = UIColor.black.withAlphaComponent(0.5)
|
||||
static let bannerImageViewOverlayViewBackgroundEditingColor = UIColor.black.withAlphaComponent(0.8)
|
||||
static let bannerImageViewOverlayViewBackgroundNormalColor = UIColor.black.withAlphaComponent(0.1)
|
||||
static let bannerImageViewOverlayViewBackgroundEditingColor = UIColor.black.withAlphaComponent(0.2)
|
||||
|
||||
weak var delegate: ProfileHeaderViewDelegate?
|
||||
var disposeBag = Set<AnyCancellable>()
|
||||
@ -99,7 +99,7 @@ final class ProfileHeaderView: UIView {
|
||||
func setupImageOverlayViews() {
|
||||
editBannerButton.tintColor = .white
|
||||
|
||||
editAvatarBackgroundView.backgroundColor = UIColor.black.withAlphaComponent(0.6)
|
||||
editAvatarBackgroundView.backgroundColor = UIColor.black.withAlphaComponent(0.2)
|
||||
editAvatarButtonOverlayIndicatorView.tintColor = .white
|
||||
}
|
||||
|
||||
|
@ -599,6 +599,9 @@ extension ProfileViewController {
|
||||
let newBannerImage: UIImage?
|
||||
let newAvatarImage: UIImage?
|
||||
|
||||
profileHeaderViewController?.viewModel.isUpdating = true
|
||||
defer { profileHeaderViewController?.viewModel.isUpdating = false }
|
||||
|
||||
if case let .local(image) = headerDetails.bannerImage {
|
||||
if image.size.width <= ProfileHeaderViewModel.bannerImageMaxSizeInPixel.width {
|
||||
newBannerImage = image
|
||||
|
Loading…
x
Reference in New Issue
Block a user