Skip to content

Commit

Permalink
Updated for Material Components for iOS (MDC-iOS) version 35.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ilap committed Oct 1, 2017
1 parent 83be017 commit dfed474
Show file tree
Hide file tree
Showing 32 changed files with 232 additions and 11 deletions.
4 changes: 2 additions & 2 deletions MaterialComponentsBinding.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Global
$5.NewLineForCatch = False
$5.NewLineForFinally = False
$5.scope = text/x-csharp
description = @For Api changes check https://github.com/material-components/material-components-ios/releases/tag/v35.0.0\n\nThis Xamarin Binding Solution follows the Material Components for iOS and other projects versioning convention.\ne.g.:\n* Material Components for iOS 31.0.0 --> Xamarin Bindig 31.0.0\n* MDFTextAccessibility --> use the latest.
version = 35.0.0
description = @For Api changes check https://github.com/material-components/material-components-ios/releases/tag/v35.2.0\n\nThis Xamarin Binding Solution follows the Material Components for iOS and other projects versioning convention.\ne.g.:\n* Material Components for iOS 31.0.0 --> Xamarin Bindig 31.0.0\n* MDFTextAccessibility --> use the latest.
version = 35.2.0
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion MaterialComponentsXamarinExamples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Global
{E98F86E6-DB5D-48AE-A6F1-B2919D89C87C}.Debug|iPhone.Build.0 = Debug|iPhone
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 35.0.0
version = 35.2.0
Policies = $0
$0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = PrefixedHierarchical
Expand Down
2 changes: 1 addition & 1 deletion nuspec/Xamarin.iOS.MaterialComponents.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>Xamarin.iOS.MaterialComponents</id>
<version>35.0.0</version>
<version>35.2.0</version>
<title>Xamarin.iOS.MaterialComponents</title>
<authors>ilap</authors>
<licenseUrl>https://github.com/ilap/MaterialComponentsXamarin/blob/master/LICENSE</licenseUrl>
Expand Down
Binary file modified references/MDFTextAccessibility.framework/Info.plist
Binary file not shown.
Binary file modified references/MDFTextAccessibility.framework/MDFTextAccessibility
Binary file not shown.
102 changes: 102 additions & 0 deletions references/MaterialComponents.framework/Headers/MDCBottomAppBarView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
Copyright 2017-present the Material Components for iOS authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#import <UIKit/UIKit.h>

#import "MaterialButtons.h"

/** The elevation of the floating action button. */
typedef NS_ENUM(NSInteger, MDCBottomAppBarFloatingButtonElevation) {
MDCBottomAppBarFloatingButtonElevationPrimary = 0,
MDCBottomAppBarFloatingButtonElevationSecondary = 1
};

/** The position of the floating action button. */
typedef NS_ENUM(NSInteger, MDCBottomAppBarFloatingButtonPosition) {
MDCBottomAppBarFloatingButtonPositionCenter = 0,
MDCBottomAppBarFloatingButtonPositionLeading = 1,
MDCBottomAppBarFloatingButtonPositionTrailing = 2
};

/**
A bottom app bar view with an embedded floating button.
The bottom app bar is a bar docked at the bottom of the screen. A floating action button is
provided for a primary action.
*/
@interface MDCBottomAppBarView : UIView

/**
Is the floating button on the bottom bar hidden.
Default is NO.
*/
@property(nonatomic, assign, getter=isFloatingButtonHidden) BOOL floatingButtonHidden;

/**
The elevation of the floating action button.
Default is MDCBottomAppBarFloatingButtonElevationPrimary.
*/
@property(nonatomic, assign) MDCBottomAppBarFloatingButtonElevation floatingButtonElevation;

/**
The position of the floating action button.
Default is MDCBottomAppBarFloatingButtonPositionCenter.
*/
@property(nonatomic, assign) MDCBottomAppBarFloatingButtonPosition floatingButtonPosition;

/**
The floating button on the bottom bar. This button is exposed for customizability.
*/
@property(nonatomic, strong, nonnull, readonly) MDCFloatingButton *floatingButton;

/**
Navigation bar items that precede the floating action button. There is no limit to the number of
buttons that can be added, but button bar width overflow is not handled.
*/
@property(nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *leadingBarButtonItems;

/**
Navigation bar items that trail the floating action button. There is no limit to the number of
buttons that can be added, but button bar width overflow is not handled.
*/
@property(nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *trailingBarButtonItems;

/**
Sets the visibility of the floating action button.
@param animated Enable or disable animation.
*/
- (void)setFloatingButtonHidden:(BOOL)floatingButtonHidden animated:(BOOL)animated;

/**
Sets the elevation of the floating action button. Note, if the set elevation is the same as the
current elevation there is no change in the elevation nor animation.
@param animated Enable or disable animation.
*/
- (void)setFloatingButtonElevation:(MDCBottomAppBarFloatingButtonElevation)floatingButtonElevation
animated:(BOOL)animated;

/**
Sets the position of the floating action button. Note, if the set position is the same as the
current position there is no change in the position nor animation.
@param animated Enable or disable animation.
*/
- (void)setFloatingButtonPosition:(MDCBottomAppBarFloatingButtonPosition)floatingButtonPosition
animated:(BOOL)animated;

@end
8 changes: 8 additions & 0 deletions references/MaterialComponents.framework/Headers/MDCMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ static inline CGFloat MDCFabs(CGFloat value) {
#endif
}

static inline CGFloat MDCDegreesToRadians(CGFloat degrees) {
#if CGFLOAT_IS_DOUBLE
return degrees * (CGFloat)M_PI / 180.0;
#else
return degrees * (CGFloat)M_PI / 180.f;
#endif
}

static inline bool MDCCGFloatEqual(CGFloat a, CGFloat b) {
const CGFloat constantK = 3;
#if CGFLOAT_IS_DOUBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ typedef NS_ENUM(NSUInteger, MDCTextInputTextInsetsMode) {
Note: The clear button will never display when there is no entered text.
*/
@property(nonatomic, assign) UITextFieldViewMode clearButtonMode;
@property(nonatomic, assign) UITextFieldViewMode clearButtonMode UI_APPEARANCE_SELECTOR;

/** A Boolean value indicating whether the text field is currently in edit mode. */
@property(nonatomic, assign, readonly, getter=isEditing) BOOL editing;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Copyright 2017-present the Material Components for iOS authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#import "MDCBottomAppBarView.h"
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#import "MaterialAppBar.h"
#import "MDCAppBar.h"
#import "MDCAppBarContainerViewController.h"
#import "MaterialBottomAppBar.h"
#import "MDCBottomAppBarView.h"
#import "MaterialBottomSheet.h"
#import "MDCBottomSheetController.h"
#import "MDCBottomSheetPresentationController.h"
Expand Down
Binary file modified references/MaterialComponents.framework/Info.plist
Binary file not shown.
Binary file modified references/MaterialComponents.framework/MaterialComponents
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified references/MotionAnimator.framework/Info.plist
Binary file not shown.
Binary file modified references/MotionAnimator.framework/MotionAnimator
Binary file not shown.
Binary file modified references/MotionInterchange.framework/Info.plist
Binary file not shown.
Binary file modified references/MotionInterchange.framework/MotionInterchange
Binary file not shown.
Binary file modified references/MotionTransitioning.framework/Info.plist
Binary file not shown.
Binary file modified references/MotionTransitioning.framework/MotionTransitioning
Binary file not shown.
2 changes: 1 addition & 1 deletion samples/MDC-Tutorial/MDC-Tutorial.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RootNamespace>MDCTutorial</RootNamespace>
<AssemblyName>MDC-Sample</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<ReleaseVersion>35.0.0</ReleaseVersion>
<ReleaseVersion>35.2.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
5 changes: 3 additions & 2 deletions samples/Pesto/Pesto.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RootNamespace>Pesto</RootNamespace>
<AssemblyName>Pesto</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<ReleaseVersion>35.0.0</ReleaseVersion>
<ReleaseVersion>35.2.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -28,6 +28,7 @@
<MtouchArch>i386, x86_64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<DeviceSpecificBuild>false</DeviceSpecificBuild>
<RunCodeAnalysis>true</RunCodeAnalysis><MtouchSdkVersion>11.0</MtouchSdkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>pdbonly</DebugType>
Expand Down Expand Up @@ -55,7 +56,7 @@
<MtouchLink>None</MtouchLink>
<MtouchArch>i386, x86_64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
</PropertyGroup>
<RunCodeAnalysis>true</RunCodeAnalysis> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand Down
2 changes: 1 addition & 1 deletion samples/Shrine/ShrineXamarin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RootNamespace>ShrineXamarin</RootNamespace>
<AssemblyName>ShrineXamarin</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<ReleaseVersion>35.0.0</ReleaseVersion>
<ReleaseVersion>35.2.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
2 changes: 1 addition & 1 deletion samples/ShrineRemoteImage/ShrineRemoteImage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RootNamespace>ShrineRemoteImage.iOS</RootNamespace>
<AssemblyName>ShrineRemoteImage.iOS</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<ReleaseVersion>35.0.0</ReleaseVersion>
<ReleaseVersion>35.2.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
75 changes: 75 additions & 0 deletions src/MaterialComponents/MaterialBottomAppBar.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
//
// Copyright (c) 2017 The Material Components for iOS Xamarin Binding Authors.
// All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

using System;
using Foundation;
using CoreGraphics;
using UIKit;
using ObjCRuntime;
using MaterialComponents.MaterialInk;
using MaterialComponents.MaterialButtons;
using MaterialComponents;


namespace MaterialComponents.MaterialBottomAppBar {

// @interface MDCBottomAppBarView : UIView
[BaseType(typeof(UIView))]
interface MDCBottomAppBarView {
// @property (getter = isFloatingButtonHidden, assign, nonatomic) BOOL floatingButtonHidden;
[Export("floatingButtonHidden")]
bool FloatingButtonHidden { [Bind("isFloatingButtonHidden")] get; set; }

// @property (assign, nonatomic) MDCBottomAppBarFloatingButtonElevation floatingButtonElevation;
[Export("floatingButtonElevation", ArgumentSemantic.Assign)]
MDCBottomAppBarFloatingButtonElevation FloatingButtonElevation { get; set; }

// @property (assign, nonatomic) MDCBottomAppBarFloatingButtonPosition floatingButtonPosition;
[Export("floatingButtonPosition", ArgumentSemantic.Assign)]
MDCBottomAppBarFloatingButtonPosition FloatingButtonPosition { get; set; }

// @property (readonly, nonatomic, strong) MDCFloatingButton * _Nonnull floatingButton;
[Export("floatingButton", ArgumentSemantic.Strong)]
MDCFloatingButton FloatingButton { get; }

// @property (copy, nonatomic) NSArray<UIBarButtonItem *> * _Nullable leadingBarButtonItems;
[NullAllowed, Export("leadingBarButtonItems", ArgumentSemantic.Copy)]
UIBarButtonItem[] LeadingBarButtonItems { get; set; }

// @property (copy, nonatomic) NSArray<UIBarButtonItem *> * _Nullable trailingBarButtonItems;
[NullAllowed, Export("trailingBarButtonItems", ArgumentSemantic.Copy)]
UIBarButtonItem[] TrailingBarButtonItems { get; set; }

// -(void)setFloatingButtonHidden:(BOOL)floatingButtonHidden animated:(BOOL)animated;
[Export("setFloatingButtonHidden:animated:")]
void SetFloatingButtonHidden(bool floatingButtonHidden, bool animated);

// -(void)setFloatingButtonElevation:(MDCBottomAppBarFloatingButtonElevation)floatingButtonElevation animated:(BOOL)animated;
[Export("setFloatingButtonElevation:animated:")]
void SetFloatingButtonElevation(MDCBottomAppBarFloatingButtonElevation floatingButtonElevation, bool animated);

// -(void)setFloatingButtonPosition:(MDCBottomAppBarFloatingButtonPosition)floatingButtonPosition animated:(BOOL)animated;
[Export("setFloatingButtonPosition:animated:")]
void SetFloatingButtonPosition(MDCBottomAppBarFloatingButtonPosition floatingButtonPosition, bool animated);
}
}
3 changes: 2 additions & 1 deletion src/MaterialComponents/MaterialComponents.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RootNamespace>MaterialComponents</RootNamespace>
<AssemblyName>MaterialComponents</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<ReleaseVersion>35.0.0</ReleaseVersion>
<ReleaseVersion>35.2.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -66,6 +66,7 @@
<ObjcBindingApiDefinition Include="MaterialMaskedTransition.cs" />
<ObjcBindingApiDefinition Include="MotionTransitioning.cs" />
<ObjcBindingApiDefinition Include="MaterialIcons.cs" />
<ObjcBindingApiDefinition Include="MaterialBottomAppBar.cs" />
</ItemGroup>
<ItemGroup>
<ObjcBindingCoreSource Include="Structs.cs" />
Expand Down
15 changes: 15 additions & 0 deletions src/MaterialComponents/Structs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,19 @@ public enum MDCNavigationBarTitleAlignment : long
Leading
}

[Native]
public enum MDCBottomAppBarFloatingButtonElevation : long
{
Primary = 0,
Secondary = 1
}

[Native]
public enum MDCBottomAppBarFloatingButtonPosition : long
{
Center = 0,
Leading = 1,
Trailing = 2
}

}

0 comments on commit dfed474

Please sign in to comment.