Skip to content

Commit

Permalink
[TextControls] Annotate symbols as to be deprecated
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 457764325
  • Loading branch information
codeman7 authored and material-automation committed Jun 28, 2022
1 parent f59169a commit a169a26
Show file tree
Hide file tree
Showing 25 changed files with 150 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@

#import "MDCTextControl.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
A base implementation of MDCTextControlStyle. This is only used for base text controls, i.e.
ones that are not filled or outlined.
*/
@interface MDCTextControlStyleBase : NSObject <MDCTextControlStyle>
@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

#import "MDCTextControlVerticalPositioningReference.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

@interface MDCTextControlVerticalPositioningReferenceBase
: NSObject <MDCTextControlVerticalPositioningReference>

Expand All @@ -28,3 +32,5 @@
isMultilineTextControl:(BOOL)isMultilineTextControl;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#import "MDCTextControl.h"
#import "MDCTextControlStyleUnderlined.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
This style object is used by MDCTextControls adopting the Material Filled style.
*/
Expand All @@ -42,3 +46,5 @@ Returns the filled background color for a given state.
- (nonnull UIColor *)filledBackgroundColorForState:(MDCTextControlState)state;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#import "MDCTextControlVerticalPositioningReference.h"
#import "MDCTextControlVerticalPositioningReferenceUnderlined.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

@interface MDCTextControlVerticalPositioningReferenceFilled
: NSObject <MDCTextControlVerticalPositioningReference>

Expand All @@ -30,3 +34,5 @@
isMultilineTextControl:(BOOL)isMultilineTextControl;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#import "MDCTextControl.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

// TODO: When the MDCBaseTextField subclass that makes use of this style (and the path drawing logic
// inside it) lands there should be snapshot tests for it.
/**
Expand All @@ -43,3 +47,5 @@ Returns the outline color for a given state.
- (nonnull UIColor *)outlineColorForState:(MDCTextControlState)state;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#import "MDCTextControlVerticalPositioningReference.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

@interface MDCTextControlVerticalPositioningReferenceOutlined
: NSObject <MDCTextControlVerticalPositioningReference>

Expand All @@ -29,3 +33,5 @@
isMultilineTextControl:(BOOL)isMultilineTextControl;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#import "MDCTextControlLabelSupport.h"
#import "MDCTextControlVerticalPositioningReference.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

UIFont *_Nonnull MDCTextControlDefaultUITextFieldFont(void);

FOUNDATION_EXTERN const CGFloat kMDCTextControlDefaultAnimationDuration;
Expand Down Expand Up @@ -215,3 +219,5 @@ FOUNDATION_EXTERN const CGFloat kMDCTextControlDefaultAnimationDuration;
- (nonnull MDCTextControlHorizontalPositioningReference *)horizontalPositioningReference;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
Dictates the relative importance of the underline labels, and the order in which they are laid out.
It is important to note that at the time this documentation is being written this type is not
Expand All @@ -40,3 +44,5 @@ typedef NS_ENUM(NSUInteger, MDCTextControlAssistiveLabelDrawPriority) {
*/
MDCTextControlAssistiveLabelDrawPriorityCustom,
};

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

#import "MDCTextControlAssistiveLabelViewLayout.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
This view acts as a subview of MDCTextControls and a superview of their leading and assistive
labels.
Expand All @@ -29,3 +33,5 @@
@property(nonatomic, strong, nonnull) MDCTextControlAssistiveLabelViewLayout *layout;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#import "MDCTextControl.h"
#import "MDCTextControlAssistiveLabelDrawPriority.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
MDCTextControlAssistiveLabelViewLayout objects tell MDCAssistiveLabelViews where to position their
assistive labels. Instantiating one of these classes is tantamount to calculating a layout.
Expand All @@ -43,3 +47,5 @@
isRTL:(BOOL)isRTL;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#import "MDCTextControlState.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
This object represents a group of colors that are applied on a state by state basis to
MDCTextControls. Each property corresponds to a Contained Input View specific subview.
Expand Down Expand Up @@ -49,3 +53,5 @@
- (nonnull instancetype)initWithState:(MDCTextControlState)state NS_DESIGNATED_INITIALIZER;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#import <UIKit/UIKit.h>

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
MDCTextControl text areas and input chip views retain one of these from initialization to
deallocation. Instances of this class hold on to the gradient layers used by text areas and input
Expand All @@ -28,3 +32,5 @@
- (CALayer *)combinedGradientMaskLayer;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#import <UIKit/UIKit.h>

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
Objects conforming to this protocol provide information to layout objects regarding the horizontal
positioning of TextControl subviews.
Expand All @@ -38,3 +42,5 @@
@property(nonatomic, assign) CGFloat horizontalInterItemSpacing;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@

#import "MDCTextControlHorizontalPositioning.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
An object conforming to @c MDCTextControlHorizontalPositioning
*/
@interface MDCTextControlHorizontalPositioningReference
: NSObject <MDCTextControlHorizontalPositioning>
@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
#import <UIKit/UIKit.h>
#import "MDCTextControlLabelSupport.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
The logic to animate labels is extracted into its own class so that any MDCTextControl can
make use of it.
Expand All @@ -40,3 +44,5 @@
animationDuration:(NSTimeInterval)animationDuration
completion:(void (^__nullable)(BOOL))completion;
@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#import <UIKit/UIKit.h>

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
This enum represents different positional states the label can be in.
*/
Expand All @@ -36,3 +40,5 @@ MDCTextControlLabelPosition MDCTextControlLabelPositionWith(BOOL hasLabelText, B
BOOL canLabelFloat, BOOL isEditing);

CGSize MDCTextControlLabelSizeWith(NSString *text, CGFloat maxWidth, UIFont *font);

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
#import <UIKit/UIKit.h>
#import "MDCTextControlLabelSupport.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
This method tells an MDCTextControl whether its placeholder should be visible.
*/
BOOL MDCTextControlShouldPlaceholderBeVisibleWithPlaceholder(
NSString *placeholder, NSString *text, MDCTextControlLabelPosition labelPosition);

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
#import <UIKit/UIKit.h>
#import "MDCTextControlLabelSupport.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
This method tells an MDCTextControl whether to display a side view or not.
*/
BOOL MDCTextControlShouldDisplaySideViewWithSideView(UIView *sideView, UITextFieldViewMode viewMode,
BOOL isEditing);

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#import "MDCTextControlLabelBehavior.h"
#import "MDCTextControlLabelSupport.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
Style objects vend objects conforming to this protocol to provide the MDCTextControl's layout
object with information about the vertical positions of views. This helps achieve the variations in
Expand Down Expand Up @@ -55,3 +59,5 @@ CGFloat MDCTextControlPaddingValueWithMinimumPadding(CGFloat minimumPadding, CGF
BOOL MDCTextControlShouldLayoutForFloatingLabelWithLabelPosition(
MDCTextControlLabelPosition labelPosition, MDCTextControlLabelBehavior labelBehavior,
NSString *labelText);

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

@interface UIBezierPath (MDCTextControlStyle)

- (void)mdc_addTopRightCornerFromPoint:(CGPoint)point1
Expand All @@ -31,3 +35,5 @@
withRadius:(CGFloat)radius;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#import "MaterialTextControlsPrivate+Shared.h"
#import "MDCTextControlTextFieldSideViewAlignment.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

@interface MDCBaseTextFieldLayout : NSObject

@property(nonatomic, assign) BOOL displaysLeadingView;
Expand Down Expand Up @@ -73,3 +77,5 @@
- (CGRect)labelFrameWithLabelPosition:(MDCTextControlLabelPosition)labelPosition;

@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@

#import "MDCTextControlTextFieldSideViewAlignment.h" // IWYU pragma: keep

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

@protocol MDCTextControlTextField <MDCTextControl>
@property(nonatomic, assign, readonly) MDCTextControlTextFieldSideViewAlignment sideViewAlignment;
@end

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
This enum describes different approaches to vertically positioning side views (@c leadingView, @c
trailingView, and the clear button) in a text field. MDCBaseTextFieldLayout uses this to help it
Expand All @@ -28,3 +32,5 @@ typedef NS_ENUM(NSUInteger, MDCTextControlTextFieldSideViewAlignment) {
*/
MDCTextControlTextFieldSideViewAlignmentAlignedWithText,
};

API_DEPRECATED_END
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

#import "MDCTextControl.h"

API_DEPRECATED_BEGIN("Use a branded UITextField (go/material-ios-text-fields) or branded "
"UITextView (go/material-ios-text-views) instead",
ios(12, API_TO_BE_DEPRECATED))

/**
This style object is used by MDCTextControls adopting the Material Underlined style.
*/
Expand Down Expand Up @@ -59,3 +63,5 @@ Returns the underline color color for a given state.
- (nonnull UIColor *)underlineColorForState:(MDCTextControlState)state;

@end

API_DEPRECATED_END

0 comments on commit a169a26

Please sign in to comment.