Skip to content

Commit

Permalink
Merge pull request #7 from muak/fixTimePicker
Browse files Browse the repository at this point in the history
fixed TimePickerCell and DatePickerCell on iOS
  • Loading branch information
muak authored Dec 25, 2017
2 parents 70e8b6d + a1a4015 commit 458972e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Sample/Sample.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@
<string>Resources/Images.xcassets/AppIcons.appiconset</string>
<key>CFBundleName</key>
<string>Sample</string>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
</dict>
</plist>
6 changes: 3 additions & 3 deletions Sample/Sample/ViewModels/LabelCellTestViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public LabelCellTestViewModel(INavigationService navigationService,IPageDialogSe
TimeFormat.Value = "t";
Time.Value = new TimeSpan(12, 0, 0);

Date.Value = Dates[0];
MinDate.Value = MinDates[0];
MaxDate.Value = MaxDates[0];
DateFormat.Value = DateFormats[0];
TodayText.Value = TodayTexts[0];
Date.Value = Dates[0];
MaxDate.Value = MaxDates[0];
MinDate.Value = MinDates[0];

CanExecute.Value = CanExecutes[0];

Expand Down
4 changes: 3 additions & 1 deletion SettingsView.iOS/Cells/DatePickerCellRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,21 @@ void Done()

void UpdateDate()
{
_picker.SetDate(_DatePickerCell.Date.ToNSDate(), true);
_picker.SetDate(_DatePickerCell.Date.ToNSDate(),false);
ValueLabel.Text = _DatePickerCell.Date.ToString(_DatePickerCell.Format);
_preSelectedDate = _DatePickerCell.Date.ToNSDate();
}

void UpdateMaximumDate()
{
_picker.MaximumDate = _DatePickerCell.MaximumDate.ToNSDate();
UpdateDate(); //without this code, selected date isn't sometimes correct when it is shown first.
}

void UpdateMinimumDate()
{
_picker.MinimumDate = _DatePickerCell.MinimumDate.ToNSDate();
UpdateDate();
}

void UpdateTodayText()
Expand Down
3 changes: 2 additions & 1 deletion SettingsView.iOS/Cells/TimePickerCellRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ void SetUpTimePicker()
DummyField.InputView = _picker;
DummyField.InputAccessoryView = toolbar;


}

void Canceled()
Expand All @@ -156,7 +157,7 @@ void UpdatePickerTitle()
{
_titleLabel.Text = _TimePickerCell.PickerTitle;
_titleLabel.SizeToFit();
_titleLabel.Frame = new CGRect(0, 0, 200, 44);
_titleLabel.Frame = new CGRect(0, 0, 160, 44);
}
}
}
6 changes: 3 additions & 3 deletions SettingsView/SettingsView.nuget.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">/Users/kamu/Projects/AiForms.Renderers/SettingsView/project.lock.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/kamu/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/kamu/.nuget/packages/</NuGetPackageFolders>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">/Users/kamusoft/Projects/AiForms.Renderers/SettingsView/project.lock.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/kamusoft/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/kamusoft/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">ProjectJson</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.3.1</NuGetToolVersion>
</PropertyGroup>
Expand Down
6 changes: 4 additions & 2 deletions nuget/SettingsView_mac.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>AiForms.SettingsView</id>
<version>0.0.1-pre8</version>
<version>0.0.1-pre9</version>
<title>SettingsView for Xamarin.Forms</title>
<authors>kamu</authors>
<owners>kamu</owners>
Expand All @@ -14,8 +14,10 @@ There are various cells such as (LabelCell,ButtonCell,CommandCell,SwitchCell,Che
</description>
<summary></summary>
<releaseNotes>
## Bug fix
## Bug fixes

* CancelButton text of TimePickerCell isn't completely displayed on iOS in Japanese. (pre9)
* Current date of DatePickerCell isn't sometimes set correctly. (pre9)
* When create a SettingsView instance programatically, crashed.(pre8)
* EntryCell didn't correctly work when inputting Japanese. (pre6)
* Crashed when used style.
Expand Down

0 comments on commit 458972e

Please sign in to comment.