Skip to content
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

Secondary text getting cropped after updating to 0.7.1 from 0.6.6 #129

Open
amodkanthe opened this issue May 13, 2020 · 4 comments
Open

Comments

@amodkanthe
Copy link

amodkanthe commented May 13, 2020

Observed secondary title is getting cropped after updating to 0.7.1

Following is my code

` func addCoachMarks()
{

let indexPaths = appHomeTableView.indexPathsForVisibleRows
var coachMarks = [MaterialShowcase]()
for index in indexPaths ?? [] {
if let homeCell = appHomeTableView.cellForRow(at: index) as? HomeFlightTableViewCell {
    let showCaseAirportCode = createCoachMarks(primaryText: AppLocalString.COACH_CHANGE_AIRPORT_PRIMARY, secondaryText: AppLocalString.COACH_CHANGE_AIRPORT_SCONDARY)
    showCaseAirportCode.setTargetView(view: homeCell.airportCountryNameLbl)
    showCaseAirportCode.targetHolderRadius = (homeCell.airportNameStackView.frame.width / 2) + (homeCell.airportCodeView.frame.width / 2)
    coachMarks.append(showCaseAirportCode)
    let showCaseTrackFlight = createCoachMarks(primaryText: AppLocalString.COACH_TRACK_FLIGHT_PRIMARY, secondaryText: AppLocalString.COACH_TRACK_FLIGHT_SCONDARY)
    showCaseTrackFlight.setTargetView(view: homeCell.trackFlightStackView)
    showCaseTrackFlight.targetHolderRadius = homeCell.trackFlightBtn.frame.width / 2
    coachMarks.append(showCaseTrackFlight)
}
else if let cellExplore = appHomeTableView.cellForRow(at: index) as? SmallIconsTableViewCell  {
    let showCaseFacilities = createCoachMarks(primaryText: AppLocalString.COACH_EXPLORE_PRIMARY, secondaryText: AppLocalString.COACH_EXPLORE_SCONDARY)
    showCaseFacilities.setTargetView(tableView: appHomeTableView, section: index.section, row: index.row)
    coachMarks.append(showCaseFacilities)
}
}
if tabBarController?.tabBar.items?.count ?? 0 > 1 {
let showcaseTabbar = createCoachMarks(primaryText: AppLocalString.COACH_BOTTOMBAR_PRIMARY, secondaryText: AppLocalString.COACH_BOTTOMBAR_SECONDARY)
showcaseTabbar.setTargetView(tabBar: tabBarController?.tabBar ?? UITabBar(), itemIndex: 1)
coachMarks.append(showcaseTabbar)
}
for coachMark in coachMarks {
coachMark.backgroundPromptColor = UIColor.hexStringToUIColor(hex: AppStrings.accentColor)
sequence.temp(coachMark)
}
sequence.setKey(key: "App_Home_Coach").start()
}`

`
func createCoachMarks(primaryText : String , secondaryText : String) -> MaterialShowcase
{
let showcase = MaterialShowcase()
showcase.delegate = self
showcase.primaryText = primaryText
showcase.secondaryText = secondaryText
showcase.aniRippleColor = .white
showcase.targetHolderColor = .none
showcase.primaryTextFont = FontStyle.ProximaNovaSemibold(size: 16)
showcase.secondaryTextFont = FontStyle.ProximaNovaRegular(size: 14)
//showcase.alpha = 0.95
//showcase.backgroundColor = .deam
showcase.backgroundPromptColor = UIColor.hexStringToUIColor(hex: AppStrings.accentColor)
return showcase
}

    func showCaseDidDismiss(showcase: MaterialShowcase, didTapTarget: Bool)
    {
        sequence.showCaseWillDismis()
    }`

Following screen shots for before and after

For 0.6.6

Screenshot 2020-05-13 at 1 24 38 PM

For 0.7.1
Screenshot 2020-05-13 at 1 20 32 PM

For 0.6.6
Screenshot 2020-05-13 at 1 23 25 PM

For 0.7.1
Screenshot 2020-05-13 at 1 21 31 PM

@quangctkm9207
Copy link
Collaborator

quangctkm9207 commented May 25, 2020

I would like to recommend you to set the background to .fullscreen in the case your text is long.
How do you think about this?
showcase.backgroundViewType = .full // default is .circle

@amodkanthe
Copy link
Author

Don't want to switch full screen this looks much better it was working fine in previous version so rolled back to 0.6.6

@quangctkm9207
Copy link
Collaborator

I am sorry for my late support. I don't have much time to keep updating this library recently.

@quangctkm9207
Copy link
Collaborator

Please use the latest version 0.7.2 and adjust the 'showcase.backgroundRadius' to find the best fit for each case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants