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

Remove java interface convention #2997

Merged
merged 21 commits into from
Dec 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b312bc9
Renamed `IMarker` to `Marker`
jjatie Nov 13, 2017
b52eb4a
Renamed `IAxisValueFormatter` to `AxisValueFormatter`
jjatie Nov 13, 2017
66ececa
Renamed `IFillFormatter` to `FillFormatter`
jjatie Nov 13, 2017
f821d7f
Renamed `IValueFormatter` to `ValueFormatter`
jjatie Nov 13, 2017
592aa60
Renamed `IHighlighter` to `Highlighter`
jjatie Nov 13, 2017
daf65bb
Renamed `I*DataSet` to `*DataSetProtocol` to follow Swift API guidelines
jjatie Nov 14, 2017
ce9c594
Fixed naming of `LineRadarChartDataSetProtocol` and `RadarChartDataSe…
jjatie Nov 14, 2017
a39ba52
Renamed "Interfaces" to "DataProviders" for clarity
jjatie Nov 14, 2017
d80635a
Updated Demos to for new type naming
jjatie Nov 14, 2017
a332890
Merge branch 'master' into remove-java-interface-convention
jjatie Nov 15, 2017
5951d4f
Merge remote-tracking branch 'upstream/master' into remove-java-inter…
jjatie Nov 15, 2017
a061035
Pulled latest master
jjatie Nov 15, 2017
10fa015
Merge remote-tracking branch 'origin/remove-java-interface-convention…
jjatie Nov 15, 2017
2c121be
pulled latest master
jjatie Nov 15, 2017
ef5c609
Merge branch 'master' into remove-java-interface-convention
jjatie Nov 23, 2017
96b331c
Merge branch 'master' into remove-java-interface-convention
jjatie Nov 23, 2017
bea590f
Fixed guard formatting
jjatie Nov 23, 2017
a0cdf62
Merge remote-tracking branch 'origin/remove-java-interface-convention…
jjatie Nov 23, 2017
8da4ace
Fixed issue after merge
jjatie Nov 23, 2017
1cf38d7
Merge remote-tracking branch 'upstream/4.0.0' into remove-java-interf…
jjatie Dec 25, 2017
81a427c
Pulled latest 4.0.0
jjatie Dec 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 76 additions & 74 deletions Charts.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2,123 changes: 1,059 additions & 1,064 deletions ChartsDemo/ChartsDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ChartsDemo/Objective-C/Components/XYMarkerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import Charts

open class XYMarkerView: BalloonMarker
{
@objc open var xAxisValueFormatter: IAxisValueFormatter?
@objc open var xAxisValueFormatter: AxisValueFormatter?
fileprivate var yFormatter = NumberFormatter()

@objc public init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets,
xAxisValueFormatter: IAxisValueFormatter)
xAxisValueFormatter: AxisValueFormatter)
{
super.init(color: color, font: font, textColor: textColor, insets: insets)
self.xAxisValueFormatter = xAxisValueFormatter
Expand Down
8 changes: 4 additions & 4 deletions ChartsDemo/Objective-C/DemoBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView
{
if ([key isEqualToString:@"toggleValues"])
{
for (id<IChartDataSet> set in chartView.data.dataSets)
for (id<ChartDataSetProtocol> set in chartView.data.dataSets)
{
set.drawValuesEnabled = !set.isDrawValuesEnabled;
}
Expand All @@ -85,7 +85,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView

if ([key isEqualToString:@"toggleIcons"])
{
for (id<IChartDataSet> set in chartView.data.dataSets)
for (id<ChartDataSetProtocol> set in chartView.data.dataSets)
{
set.drawIconsEnabled = !set.isDrawIconsEnabled;
}
Expand Down Expand Up @@ -143,9 +143,9 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView

if ([key isEqualToString:@"toggleBarBorders"])
{
for (id<IBarChartDataSet, NSObject> set in chartView.data.dataSets)
for (id<BarChartDataSetProtocol, NSObject> set in chartView.data.dataSets)
{
if ([set conformsToProtocol:@protocol(IBarChartDataSet)])
if ([set conformsToProtocol:@protocol(BarChartDataSetProtocol)])
{
set.barBorderWidth = set.barBorderWidth == 1.0 ? 0.0 : 1.0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleShadowColorSameAsCandle"])
{
for (id<ICandleChartDataSet> set in _chartView.data.dataSets)
for (id<CandleChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.shadowColorSameAsCandle = !set.shadowColorSameAsCandle;
}
Expand Down
8 changes: 4 additions & 4 deletions ChartsDemo/Objective-C/Demos/CombinedChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#define ITEM_COUNT 12

@interface CombinedChartViewController () <ChartViewDelegate, IChartAxisValueFormatter>
@interface CombinedChartViewController () <ChartViewDelegate, ChartAxisValueFormatter>
{
NSArray<NSString *> *months;
}
Expand Down Expand Up @@ -122,7 +122,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleLineValues"])
{
for (NSObject<IChartDataSet> *set in _chartView.data.dataSets)
for (NSObject<ChartDataSetProtocol> *set in _chartView.data.dataSets)
{
if ([set isKindOfClass:LineChartDataSet.class])
{
Expand All @@ -136,7 +136,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleBarValues"])
{
for (NSObject<IChartDataSet> *set in _chartView.data.dataSets)
for (NSObject<ChartDataSetProtocol> *set in _chartView.data.dataSets)
{
if ([set isKindOfClass:BarChartDataSet.class])
{
Expand Down Expand Up @@ -313,7 +313,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView
NSLog(@"chartValueNothingSelected");
}

#pragma mark - IAxisValueFormatter
#pragma mark - AxisValueFormatter

- (NSString *)stringForValue:(double)value
axis:(ChartAxisBase *)axis
Expand Down
12 changes: 6 additions & 6 deletions ChartsDemo/Objective-C/Demos/CubicLineChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "CubicLineChartViewController.h"
#import "ChartsDemo-Swift.h"

@interface CubicLineSampleFillFormatter : NSObject <IChartFillFormatter>
@interface CubicLineSampleFillFormatter : NSObject <ChartFillFormatter>
{
}
@end
Expand Down Expand Up @@ -158,7 +158,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleFilled"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawFilledEnabled = !set.isDrawFilledEnabled;
}
Expand All @@ -169,7 +169,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCircles"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawCirclesEnabled = !set.isDrawCirclesEnabled;
}
Expand All @@ -180,7 +180,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier;
}
Expand All @@ -191,7 +191,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleStepped"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeStepped ? LineChartModeLinear : LineChartModeStepped;
}
Expand All @@ -201,7 +201,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleHorizontalCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeHorizontalBezier : LineChartModeCubicBezier;
}
Expand Down
10 changes: 5 additions & 5 deletions ChartsDemo/Objective-C/Demos/LineChart1ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleFilled"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawFilledEnabled = !set.isDrawFilledEnabled;
}
Expand All @@ -203,7 +203,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCircles"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawCirclesEnabled = !set.isDrawCirclesEnabled;
}
Expand All @@ -214,7 +214,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier;
}
Expand All @@ -225,7 +225,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleStepped"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
switch (set.mode) {
case LineChartModeLinear:
Expand All @@ -242,7 +242,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleHorizontalCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeHorizontalBezier ? LineChartModeCubicBezier : LineChartModeHorizontalBezier;
}
Expand Down
10 changes: 5 additions & 5 deletions ChartsDemo/Objective-C/Demos/LineChart2ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleFilled"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawFilledEnabled = !set.isDrawFilledEnabled;
}
Expand All @@ -215,7 +215,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCircles"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawCirclesEnabled = !set.isDrawCirclesEnabled;
}
Expand All @@ -226,7 +226,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier;
}
Expand All @@ -237,7 +237,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleStepped"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
switch (set.mode) {
case LineChartModeLinear:
Expand All @@ -254,7 +254,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleHorizontalCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeHorizontalBezier : LineChartModeCubicBezier;
}
Expand Down
4 changes: 2 additions & 2 deletions ChartsDemo/Objective-C/Demos/LineChartFilledViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ - (void)setDataCount:(int)count range:(double)range
set1.fillColor = UIColor.whiteColor;
set1.highlightColor = [UIColor colorWithRed:244/255.0 green:117/255.0 blue:117/255.0 alpha:1.0];
set1.drawCircleHoleEnabled = NO;
set1.fillFormatter = [ChartDefaultFillFormatter withBlock:^CGFloat(id<ILineChartDataSet> _Nonnull dataSet, id<LineChartDataProvider> _Nonnull dataProvider) {
set1.fillFormatter = [ChartDefaultFillFormatter withBlock:^CGFloat(id<LineChartDataSetProtocol> _Nonnull dataSet, id<LineChartDataProvider> _Nonnull dataProvider) {
return _chartView.leftAxis.axisMinimum;
}];

Expand All @@ -138,7 +138,7 @@ - (void)setDataCount:(int)count range:(double)range
set2.fillColor = UIColor.whiteColor;
set2.highlightColor = [UIColor colorWithRed:244/255.0 green:117/255.0 blue:117/255.0 alpha:1.0];
set2.drawCircleHoleEnabled = NO;
set2.fillFormatter = [ChartDefaultFillFormatter withBlock:^CGFloat(id<ILineChartDataSet> _Nonnull dataSet, id<LineChartDataProvider> _Nonnull dataProvider) {
set2.fillFormatter = [ChartDefaultFillFormatter withBlock:^CGFloat(id<LineChartDataSetProtocol> _Nonnull dataSet, id<LineChartDataProvider> _Nonnull dataProvider) {
return _chartView.leftAxis.axisMaximum;
}];

Expand Down
10 changes: 5 additions & 5 deletions ChartsDemo/Objective-C/Demos/LineChartTimeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleFilled"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawFilledEnabled = !set.isDrawFilledEnabled;
}
Expand All @@ -169,7 +169,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCircles"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawCirclesEnabled = !set.isDrawCirclesEnabled;
}
Expand All @@ -180,7 +180,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier;
}
Expand All @@ -191,7 +191,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleStepped"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
switch (set.mode) {
case LineChartModeLinear:
Expand All @@ -208,7 +208,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleHorizontalCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeHorizontalBezier : LineChartModeCubicBezier;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleFilled"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawFilledEnabled = !set.isDrawFilledEnabled;
}
Expand All @@ -141,7 +141,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCircles"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawCirclesEnabled = !set.isDrawCirclesEnabled;
}
Expand All @@ -152,7 +152,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier;
}
Expand All @@ -163,7 +163,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleStepped"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
switch (set.mode) {
case LineChartModeLinear:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "NegativeStackedBarChartViewController.h"
#import "ChartsDemo-Swift.h"

@interface NegativeStackedBarChartViewController () <ChartViewDelegate, IChartAxisValueFormatter>
@interface NegativeStackedBarChartViewController () <ChartViewDelegate, ChartAxisValueFormatter>

@property (nonatomic, strong) IBOutlet HorizontalBarChartView *chartView;

Expand Down Expand Up @@ -184,7 +184,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView
NSLog(@"chartValueNothingSelected");
}

#pragma mark - IAxisValueFormatter
#pragma mark - AxisValueFormatter

- (NSString *)stringForValue:(double)value
axis:(ChartAxisBase *)axis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "PositiveNegativeBarChartViewController.h"
#import "ChartsDemo-Swift.h"

@interface PositiveNegativeBarChartViewController () <ChartViewDelegate, IChartAxisValueFormatter>
@interface PositiveNegativeBarChartViewController () <ChartViewDelegate, ChartAxisValueFormatter>
{
NSArray<NSDictionary *> *dataList;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView
NSLog(@"chartValueNothingSelected");
}

#pragma mark - IAxisValueFormatter
#pragma mark - AxisValueFormatter

- (NSString *)stringForValue:(double)value
axis:(ChartAxisBase *)axis
Expand Down
4 changes: 2 additions & 2 deletions ChartsDemo/Objective-C/Demos/RadarChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "RadarChartViewController.h"
#import "ChartsDemo-Swift.h"

@interface RadarChartViewController () <ChartViewDelegate, IChartAxisValueFormatter>
@interface RadarChartViewController () <ChartViewDelegate, ChartAxisValueFormatter>
{
NSArray<NSString *> *activities;
UIColor *originalBarBgColor;
Expand Down Expand Up @@ -265,7 +265,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView
NSLog(@"chartValueNothingSelected");
}

#pragma mark - IAxisValueFormatter
#pragma mark - AxisValueFormatter

- (NSString *)stringForValue:(double)value
axis:(ChartAxisBase *)axis
Expand Down
2 changes: 1 addition & 1 deletion ChartsDemo/Objective-C/Formatters/DateValueFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
#import <UIKit/UIKit.h>
#import "ChartsDemo-Swift.h"

@interface DateValueFormatter : NSObject <IChartAxisValueFormatter>
@interface DateValueFormatter : NSObject <ChartAxisValueFormatter>

@end
Loading