[ios] Added animation to metrics switching in settings

This commit is contained in:
Igor Khmurets 2014-08-01 11:21:30 +03:00 committed by Alex Zolotarev
parent 64b07cb6dd
commit 4feb95e755

View file

@ -134,10 +134,7 @@ typedef NS_ENUM(NSUInteger, Section)
Settings::Units unitsForIndex(NSInteger index)
{
if (index == 0)
return Settings::Metric;
else
return Settings::Foot;
return index == 0 ? Settings::Metric : Settings::Foot;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
@ -146,7 +143,7 @@ Settings::Units unitsForIndex(NSInteger index)
{
Settings::Units units = unitsForIndex(indexPath.row);
Settings::Set("Units", units);
[tableView reloadSections:[NSIndexSet indexSetWithIndex:SectionMetrics] withRowAnimation:UITableViewRowAnimationNone];
[tableView reloadSections:[NSIndexSet indexSetWithIndex:SectionMetrics] withRowAnimation:UITableViewRowAnimationFade];
[[MapsAppDelegate theApp].m_mapViewController setupMeasurementSystem];
}
else if (indexPath.section == SectionAbout)