Skip to content

Commit

Permalink
Merge branch 'add_gradient_all_colors' into r4.8-pre
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrim committed Aug 8, 2024
2 parents 334a119 + 87187d3 commit 1fcbcd1
Show file tree
Hide file tree
Showing 20 changed files with 939 additions and 525 deletions.
22 changes: 12 additions & 10 deletions OsmAnd.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions Sources/Controllers/Cells/Handlers/PaletteCollectionHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,30 @@ final class PaletteCollectionHandler: OABaseCollectionHandler {
override func sectionsCount() -> Int {
data.count
}

@objc func applyGradient(to imageView: UIImageView, with palette: PaletteColor) {
let gradientPoints = createGradientPoints(palette)
imageView.gradated(gradientPoints)
}

@objc func createDescriptionForPalette(palette: PaletteColor) -> String {
guard let gradientPalette = palette as? PaletteGradientColor else {
return "Invalid palette type"
}

let colorValues = gradientPalette.colorPalette.colorValues
var descriptionBuilder = ""
for (index, colorValue) in colorValues.enumerated() {
if index != 0 {
descriptionBuilder += ""
}

var formattedValue = "\(colorValue.val)"
descriptionBuilder += formattedValue
}

return descriptionBuilder
}

private func createGradientPoints(_ palette: PaletteColor) -> [GradientPoint] {
var gradientPoints = [GradientPoint]()
Expand Down
30 changes: 0 additions & 30 deletions Sources/Controllers/Cells/OAImageTextViewCell.h

This file was deleted.

92 changes: 0 additions & 92 deletions Sources/Controllers/Cells/OAImageTextViewCell.m

This file was deleted.

24 changes: 24 additions & 0 deletions Sources/Controllers/Cells/OATwoIconsButtonTableViewCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// OATwoIconsButtonTableViewCell.swift
// OsmAnd Maps
//
// Created by Dmitry Svetlichny on 05.08.2024.
// Copyright © 2024 OsmAnd. All rights reserved.
//

import Foundation

@objcMembers
final class OATwoIconsButtonTableViewCell: OAButtonTableViewCell {

@IBOutlet weak var secondLeftIconView: UIImageView!

func secondLeftIconVisibility(show: Bool) {
secondLeftIconView.isHidden = !show
updateMargins()
}

func shouldUpdateMarginsForVisibleSecondLeftIcon() -> Bool {
!secondLeftIconView.isHidden
}
}
91 changes: 0 additions & 91 deletions Sources/Controllers/Cells/Xibs/OAImageTextViewCell.xib

This file was deleted.

Loading

0 comments on commit 1fcbcd1

Please sign in to comment.