From 3d6bc1678bf73297642a03f8a1e7e0b1a16db995 Mon Sep 17 00:00:00 2001 From: Ruslan Zakharov Date: Wed, 13 Sep 2017 15:26:15 +0300 Subject: [PATCH] TizenRefApp-9087 Implement Call architecture based on Design Added classes based on design document Change-Id: I609797b080aa10623ed062080aca02e224dc7505 --- CallApp.Tizen/App.xaml.cs | 9 +- CallApp.Tizen/Call/Manager/CallManager.cs | 143 +++++++++++++++++++++ CallApp.Tizen/Call/Manager/MessagesManager.cs | 53 ++++++++ CallApp.Tizen/Call/Manager/SettingsManager.cs | 65 ++++++++++ CallApp.Tizen/Call/Model/CallBase.cs | 80 ++++++++++++ CallApp.Tizen/Call/Model/CallModel.cs | 60 +++++++++ CallApp.Tizen/Call/Model/ConferenceCallModel.cs | 39 ++++++ CallApp.Tizen/Call/Model/ContactModel.cs | 44 +++++++ CallApp.Tizen/Call/Provider/ContactProvider.cs | 25 ++++ CallApp.Tizen/Call/View/CallView.xaml | 6 + CallApp.Tizen/Call/View/CallView.xaml.cs | 31 +++++ .../Call/View/ConferenceCallManagePage.xaml.cs | 2 +- CallApp.Tizen/Call/View/ConferenceCallView.xaml | 6 + CallApp.Tizen/Call/View/ConferenceCallView.xaml.cs | 31 +++++ .../Renderers/AnimatedCircleButtonRenderer.cs | 2 +- CallApp.Tizen/Call/View/EndCallView.xaml | 6 + CallApp.Tizen/Call/View/EndCallView.xaml.cs | 31 +++++ CallApp.Tizen/Call/View/IncomingCallView.xaml | 6 + CallApp.Tizen/Call/View/IncomingCallView.xaml.cs | 31 +++++ CallApp.Tizen/Call/View/MainPage.xaml | 57 ++++++++ CallApp.Tizen/Call/View/MainPage.xaml.cs | 31 +++++ CallApp.Tizen/Call/View/MiniIncomingCallView.xaml | 6 + .../Call/View/MiniIncomingCallView.xaml.cs | 31 +++++ CallApp.Tizen/Call/ViewModel/CallViewModel.cs | 136 ++++++++++++++++++++ .../Call/ViewModel/ConferenceCallViewModel.cs | 30 +++++ CallApp.Tizen/Call/ViewModel/EndCallViewModel.cs | 49 +++++++ .../Call/ViewModel/IncomingCallViewModel.cs | 56 ++++++++ CallApp.Tizen/Call/ViewModel/MainViewModel.cs | 66 ++++++++++ .../Call/ViewModel/MiniIncomingCallViewModel.cs | 30 +++++ CallApp.Tizen/CallApp.Tizen.csproj | 65 +++++++++- .../Controls/Renderers/CustomImageRenderer.cs | 2 +- .../Tizen.Utility/Converters/IsNullConverter.cs | 5 +- .../Converters/IsStringEmptyConverter.cs | 5 +- .../Converters/TypeToNameConverter.cs | 43 +++++++ CallApp.Tizen/Tizen.Utility/Helpers/Logger.cs | 11 +- .../Tizen.Utility/Helpers/PageNavigator.cs | 2 +- .../Tizen.Utility/Input/AttachedTapCommand.cs | 2 +- CallApp.Tizen/Tizen.Utility/Input/GesturesInput.cs | 2 +- 38 files changed, 1287 insertions(+), 12 deletions(-) create mode 100644 CallApp.Tizen/Call/Manager/CallManager.cs create mode 100644 CallApp.Tizen/Call/Manager/MessagesManager.cs create mode 100644 CallApp.Tizen/Call/Manager/SettingsManager.cs create mode 100644 CallApp.Tizen/Call/Model/CallBase.cs create mode 100644 CallApp.Tizen/Call/Model/CallModel.cs create mode 100644 CallApp.Tizen/Call/Model/ConferenceCallModel.cs create mode 100644 CallApp.Tizen/Call/Model/ContactModel.cs create mode 100644 CallApp.Tizen/Call/Provider/ContactProvider.cs create mode 100644 CallApp.Tizen/Call/View/CallView.xaml create mode 100644 CallApp.Tizen/Call/View/CallView.xaml.cs create mode 100644 CallApp.Tizen/Call/View/ConferenceCallView.xaml create mode 100644 CallApp.Tizen/Call/View/ConferenceCallView.xaml.cs create mode 100644 CallApp.Tizen/Call/View/EndCallView.xaml create mode 100644 CallApp.Tizen/Call/View/EndCallView.xaml.cs create mode 100644 CallApp.Tizen/Call/View/IncomingCallView.xaml create mode 100644 CallApp.Tizen/Call/View/IncomingCallView.xaml.cs create mode 100644 CallApp.Tizen/Call/View/MainPage.xaml create mode 100644 CallApp.Tizen/Call/View/MainPage.xaml.cs create mode 100644 CallApp.Tizen/Call/View/MiniIncomingCallView.xaml create mode 100644 CallApp.Tizen/Call/View/MiniIncomingCallView.xaml.cs create mode 100644 CallApp.Tizen/Call/ViewModel/CallViewModel.cs create mode 100644 CallApp.Tizen/Call/ViewModel/ConferenceCallViewModel.cs create mode 100644 CallApp.Tizen/Call/ViewModel/EndCallViewModel.cs create mode 100644 CallApp.Tizen/Call/ViewModel/IncomingCallViewModel.cs create mode 100644 CallApp.Tizen/Call/ViewModel/MainViewModel.cs create mode 100644 CallApp.Tizen/Call/ViewModel/MiniIncomingCallViewModel.cs create mode 100644 CallApp.Tizen/Tizen.Utility/Converters/TypeToNameConverter.cs diff --git a/CallApp.Tizen/App.xaml.cs b/CallApp.Tizen/App.xaml.cs index 45e733a..94db8fb 100644 --- a/CallApp.Tizen/App.xaml.cs +++ b/CallApp.Tizen/App.xaml.cs @@ -14,6 +14,9 @@ * limitations under the License. */ +using CallApp.Tizen.Call.Manager; +using CallApp.Tizen.Call.View; +using CallApp.Tizen.Call.ViewModel; using Xamarin.Forms; namespace CallApp @@ -27,7 +30,11 @@ namespace CallApp { InitializeComponent(); - MainPage = null; + MainPage = new MainPage(); + + // FIXME: Test only + MainPage.BindingContext = new MainViewModel(new CallManager()); + // } protected override void OnStart() diff --git a/CallApp.Tizen/Call/Manager/CallManager.cs b/CallApp.Tizen/Call/Manager/CallManager.cs new file mode 100644 index 0000000..fc1ebc6 --- /dev/null +++ b/CallApp.Tizen/Call/Manager/CallManager.cs @@ -0,0 +1,143 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using CallApp.Tizen.Call.Model; +using CallApp.Tizen.Call.Provider; +using System.Collections.Generic; + +namespace CallApp.Tizen.Call.Manager +{ + /// + /// Class for managing calls + /// + public class CallManager + { + public CallManager() + { + Calls = new List(); + ContactsProvider = new ContactProvider(); + } + + /// + /// All calls of app + /// + public List Calls + { + get; + private set; + } + + /// + /// Gets a provider that provide info about contacts + /// + public ContactProvider ContactsProvider + { + get; + private set; + } + + /// + /// Joins a call + /// + public void JoinCall() + { + } + + /// + /// Split a call + /// + public void SplitCall() + { + } + + /// + /// Swap a calls + /// + public void SwapCalls() + { + } + + /// + /// Accept call callback + /// + public void OnAcceptCall() + { + } + + /// + /// End call callback + /// + public void OnEndCall() + { + } + + /// + /// Hold call callback + /// + public void OnHoldCall() + { + } + + /// + /// Incoming call callback + /// + public void OnIncomingCall() + { + } + + /// + /// Joins call callback + /// + public void OnJoinCall() + { + } + + /// + /// Outgoing call callback + /// + public void OnOutgoingCall() + { + } + + /// + /// Rejects call callback + /// + public void OnRejectCall() + { + } + + /// + /// Split call callback + /// + public void OnSplitCall() + { + } + + /// + /// Swap call callback + /// + public void OnSwapCall() + { + } + + /// + /// Unhold call callback + /// + public void OnUnholdCall() + { + } + } +} diff --git a/CallApp.Tizen/Call/Manager/MessagesManager.cs b/CallApp.Tizen/Call/Manager/MessagesManager.cs new file mode 100644 index 0000000..dad8d4d --- /dev/null +++ b/CallApp.Tizen/Call/Manager/MessagesManager.cs @@ -0,0 +1,53 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using System.Collections.Generic; + +namespace CallApp.Tizen.Call.Manager +{ + /// + /// Class for managing messages + /// + public class MessagesManager + { + /// + /// Launch messages' composer + /// + /// Id of contact number + /// Text message to send + public void LaunchComposer(uint id, string text) + { + } + + /// + /// Gets default messages answers + /// + /// List of default messages answers + public List GetMessageList() + { + return null; + } + + /// + /// Send message with text from list of default messages answers + /// + /// Id of contact number + /// Index from list of default messages answers + public void SendMessage(uint id, int index) + { + } + } +} diff --git a/CallApp.Tizen/Call/Manager/SettingsManager.cs b/CallApp.Tizen/Call/Manager/SettingsManager.cs new file mode 100644 index 0000000..65ace8f --- /dev/null +++ b/CallApp.Tizen/Call/Manager/SettingsManager.cs @@ -0,0 +1,65 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +namespace CallApp.Tizen.Call.Manager +{ + /// + /// Class for managing settings + /// + public class SettingsManager + { + /// + /// Bluetooth state, on or off + /// + public bool BluetoothState + { + get; + set; + } + + /// + /// Sound state, on or off + /// + public bool SoundState + { + get; + set; + } + + /// + /// Speaker state, on or off + /// + public bool SpeakerState + { + get; + set; + } + + /// + /// Ear jack plugged callback + /// + public void OnEarJackPlugged() + { + } + + /// + /// Ear jack unplugged callback + /// + public void OnEarJackUnplugged() + { + } + } +} diff --git a/CallApp.Tizen/Call/Model/CallBase.cs b/CallApp.Tizen/Call/Model/CallBase.cs new file mode 100644 index 0000000..c259028 --- /dev/null +++ b/CallApp.Tizen/Call/Model/CallBase.cs @@ -0,0 +1,80 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +namespace CallApp.Tizen.Call.Model +{ + /// + /// Specifies the status of call + /// + public enum CallStatus + { + Active, + End, + Hold, + Incoming, + Outgoing + } + + /// + /// Base class of call model + /// + public class CallBase + { + public CallBase(uint id) + { + Id = id; + } + + /// + /// Gets or sets a call status + /// + public CallStatus Status + { + get; + internal set; + } + + /// + /// Id of call + /// + public uint Id + { + get; + private set; + } + + /// + /// End a call + /// + public void End() + { + } + + /// + /// Hold a call + /// + public void Hold() + { + } + + /// + /// Unhold a call + /// + public void Unhold() + { + } + } +} diff --git a/CallApp.Tizen/Call/Model/CallModel.cs b/CallApp.Tizen/Call/Model/CallModel.cs new file mode 100644 index 0000000..49e043b --- /dev/null +++ b/CallApp.Tizen/Call/Model/CallModel.cs @@ -0,0 +1,60 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +namespace CallApp.Tizen.Call.Model +{ + /// + /// Model of call + /// + public class CallModel : CallBase + { + public CallModel(uint id) : base(id) + { + } + + /// + /// Model of contact + /// + public ContactModel ContactModel + { + get; + internal set; + } + + /// + /// Number of caller + /// + public string CallerNumber + { + get; + internal set; + } + + /// + /// Accepts a call + /// + public void Accept() + { + } + + /// + /// Rejects a call + /// + public void Reject() + { + } + } +} diff --git a/CallApp.Tizen/Call/Model/ConferenceCallModel.cs b/CallApp.Tizen/Call/Model/ConferenceCallModel.cs new file mode 100644 index 0000000..2346f82 --- /dev/null +++ b/CallApp.Tizen/Call/Model/ConferenceCallModel.cs @@ -0,0 +1,39 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using System.Collections.Generic; + +namespace CallApp.Tizen.Call.Model +{ + /// + /// Model of conference call + /// + public class ConferenceCallModel : CallBase + { + public ConferenceCallModel(uint id) : base(id) + { + } + + /// + /// All calls of conference + /// + public List Calls + { + get; + internal set; + } + } +} diff --git a/CallApp.Tizen/Call/Model/ContactModel.cs b/CallApp.Tizen/Call/Model/ContactModel.cs new file mode 100644 index 0000000..1ada7d7 --- /dev/null +++ b/CallApp.Tizen/Call/Model/ContactModel.cs @@ -0,0 +1,44 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using Xamarin.Forms; + +namespace CallApp.Tizen.Call.Model +{ + /// + /// Model of contact + /// + public class ContactModel + { + /// + /// Photo of contact + /// + public Image Photo + { + get; + internal set; + } + + /// + /// Name of contact + /// + public string Name + { + get; + internal set; + } + } +} diff --git a/CallApp.Tizen/Call/Provider/ContactProvider.cs b/CallApp.Tizen/Call/Provider/ContactProvider.cs new file mode 100644 index 0000000..cc7fe78 --- /dev/null +++ b/CallApp.Tizen/Call/Provider/ContactProvider.cs @@ -0,0 +1,25 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +namespace CallApp.Tizen.Call.Provider +{ + /// + /// Represents a provider for contact info + /// + public class ContactProvider + { + } +} diff --git a/CallApp.Tizen/Call/View/CallView.xaml b/CallApp.Tizen/Call/View/CallView.xaml new file mode 100644 index 0000000..7cc8194 --- /dev/null +++ b/CallApp.Tizen/Call/View/CallView.xaml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/CallApp.Tizen/Call/View/CallView.xaml.cs b/CallApp.Tizen/Call/View/CallView.xaml.cs new file mode 100644 index 0000000..6dd7f1d --- /dev/null +++ b/CallApp.Tizen/Call/View/CallView.xaml.cs @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using Xamarin.Forms; + +namespace CallApp.Tizen.Call.View +{ + /// + /// Represents Active or Outgoing call view + /// + public partial class CallView : ContentView + { + public CallView() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/View/ConferenceCallManagePage.xaml.cs b/CallApp.Tizen/Call/View/ConferenceCallManagePage.xaml.cs index 230ac02..b629b07 100644 --- a/CallApp.Tizen/Call/View/ConferenceCallManagePage.xaml.cs +++ b/CallApp.Tizen/Call/View/ConferenceCallManagePage.xaml.cs @@ -19,7 +19,7 @@ using Xamarin.Forms; namespace CallApp.Tizen.Call.View { /// - /// Partial class of ConferenceCallManagePage.xaml + /// Represents Conference call managing page /// public partial class ConferenceCallManagePage : ContentPage { diff --git a/CallApp.Tizen/Call/View/ConferenceCallView.xaml b/CallApp.Tizen/Call/View/ConferenceCallView.xaml new file mode 100644 index 0000000..eed2acb --- /dev/null +++ b/CallApp.Tizen/Call/View/ConferenceCallView.xaml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/CallApp.Tizen/Call/View/ConferenceCallView.xaml.cs b/CallApp.Tizen/Call/View/ConferenceCallView.xaml.cs new file mode 100644 index 0000000..1b31fd8 --- /dev/null +++ b/CallApp.Tizen/Call/View/ConferenceCallView.xaml.cs @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using Xamarin.Forms; + +namespace CallApp.Tizen.Call.View +{ + /// + /// Represents Conference call view + /// + public partial class ConferenceCallView : ContentView + { + public ConferenceCallView() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/View/Controls/Renderers/AnimatedCircleButtonRenderer.cs b/CallApp.Tizen/Call/View/Controls/Renderers/AnimatedCircleButtonRenderer.cs index 13e402f..1c7a43c 100644 --- a/CallApp.Tizen/Call/View/Controls/Renderers/AnimatedCircleButtonRenderer.cs +++ b/CallApp.Tizen/Call/View/Controls/Renderers/AnimatedCircleButtonRenderer.cs @@ -25,7 +25,7 @@ namespace CallApp.Tizen.Call.View.Controls.Renderers /// /// A renderer for AnimatedCircleButton /// - class AnimatedCircleButtonRenderer : LayoutRenderer + public class AnimatedCircleButtonRenderer : LayoutRenderer { private ElmSharp.GestureLayer _gestureLayer = null; diff --git a/CallApp.Tizen/Call/View/EndCallView.xaml b/CallApp.Tizen/Call/View/EndCallView.xaml new file mode 100644 index 0000000..5c32df5 --- /dev/null +++ b/CallApp.Tizen/Call/View/EndCallView.xaml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/CallApp.Tizen/Call/View/EndCallView.xaml.cs b/CallApp.Tizen/Call/View/EndCallView.xaml.cs new file mode 100644 index 0000000..1acc39d --- /dev/null +++ b/CallApp.Tizen/Call/View/EndCallView.xaml.cs @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using Xamarin.Forms; + +namespace CallApp.Tizen.Call.View +{ + /// + /// Represents End call view + /// + public partial class EndCallView : ContentView + { + public EndCallView() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/View/IncomingCallView.xaml b/CallApp.Tizen/Call/View/IncomingCallView.xaml new file mode 100644 index 0000000..1bd28b9 --- /dev/null +++ b/CallApp.Tizen/Call/View/IncomingCallView.xaml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/CallApp.Tizen/Call/View/IncomingCallView.xaml.cs b/CallApp.Tizen/Call/View/IncomingCallView.xaml.cs new file mode 100644 index 0000000..d2862be --- /dev/null +++ b/CallApp.Tizen/Call/View/IncomingCallView.xaml.cs @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using Xamarin.Forms; + +namespace CallApp.Tizen.Call.View +{ + /// + /// Represents Incoming call view + /// + public partial class IncomingCallView : ContentView + { + public IncomingCallView() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/View/MainPage.xaml b/CallApp.Tizen/Call/View/MainPage.xaml new file mode 100644 index 0000000..92b2642 --- /dev/null +++ b/CallApp.Tizen/Call/View/MainPage.xaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CallApp.Tizen/Call/View/MainPage.xaml.cs b/CallApp.Tizen/Call/View/MainPage.xaml.cs new file mode 100644 index 0000000..ed1f011 --- /dev/null +++ b/CallApp.Tizen/Call/View/MainPage.xaml.cs @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using Xamarin.Forms; + +namespace CallApp.Tizen.Call.View +{ + /// + /// Represents Main page of app for showing various views + /// + public partial class MainPage : ContentPage + { + public MainPage() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml b/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml new file mode 100644 index 0000000..a3f1ffd --- /dev/null +++ b/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml.cs b/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml.cs new file mode 100644 index 0000000..825a25f --- /dev/null +++ b/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml.cs @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using Xamarin.Forms; + +namespace CallApp.Tizen.Call.View +{ + /// + /// Represents MiniIncoming call view + /// + public partial class MiniIncomingCallView : ContentView + { + public MiniIncomingCallView() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/ViewModel/CallViewModel.cs b/CallApp.Tizen/Call/ViewModel/CallViewModel.cs new file mode 100644 index 0000000..5731894 --- /dev/null +++ b/CallApp.Tizen/Call/ViewModel/CallViewModel.cs @@ -0,0 +1,136 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using CallApp.Tizen.Call.Manager; +using CallApp.Tizen.Call.Model; +using Tizen.Utility.Helpers; + +namespace CallApp.Tizen.Call.ViewModel +{ + /// + /// ViewModel of CallView + /// + public class CallViewModel : BaseModel + { + protected readonly CallManager _callManager = null; + protected readonly SettingsManager _settingsManager = new SettingsManager(); + + public CallViewModel(CallManager callManager) + { + _callManager = callManager; + } + + /// + /// Gets or sets the active call + /// + public CallModel ActiveCall + { + get; + + // FIXME: Make it private when Call API is completed, at this moment needed to test app + set; + } + + /// + /// Gets or sets the call on hold + /// + public CallModel HoldCall + { + get; + + // FIXME: Make it private when Call API is completed, at this moment needed to test app + set; + } + + /// + /// Bluetooth state, on or off + /// + public bool BluetoothState + { + get + { + return _settingsManager.BluetoothState; + } + + set + { + _settingsManager.BluetoothState = value; + } + } + + /// + /// Sound state, on or off + /// + public bool SoundState + { + get + { + return _settingsManager.SoundState; + } + + set + { + _settingsManager.SoundState = value; + } + } + + /// + /// Speaker state, on or off + /// + public bool SpeakerState + { + get + { + return _settingsManager.SpeakerState; + } + + set + { + _settingsManager.SpeakerState = value; + } + } + + /// + /// Keypad state, showed or not + /// + public bool KeypadState + { + get; + set; + } + + /// + /// Adds a call + /// + public void AddCall() + { + } + + /// + /// Add a contact + /// + public void AddContact() + { + } + + /// + /// Reject a call + /// + public void RejectCall() + { + } + } +} diff --git a/CallApp.Tizen/Call/ViewModel/ConferenceCallViewModel.cs b/CallApp.Tizen/Call/ViewModel/ConferenceCallViewModel.cs new file mode 100644 index 0000000..0ad89f2 --- /dev/null +++ b/CallApp.Tizen/Call/ViewModel/ConferenceCallViewModel.cs @@ -0,0 +1,30 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using CallApp.Tizen.Call.Manager; + +namespace CallApp.Tizen.Call.ViewModel +{ + /// + /// ViewModel of ConferenceCallView + /// + public class ConferenceCallViewModel : CallViewModel + { + public ConferenceCallViewModel(CallManager callManager) : base(callManager) + { + } + } +} diff --git a/CallApp.Tizen/Call/ViewModel/EndCallViewModel.cs b/CallApp.Tizen/Call/ViewModel/EndCallViewModel.cs new file mode 100644 index 0000000..15c19b1 --- /dev/null +++ b/CallApp.Tizen/Call/ViewModel/EndCallViewModel.cs @@ -0,0 +1,49 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using CallApp.Tizen.Call.Manager; +using Tizen.Utility.Helpers; + +namespace CallApp.Tizen.Call.ViewModel +{ + /// + /// ViewModel of EndCallView + /// + public class EndCallViewModel : BaseModel + { + private readonly CallManager _callManager = null; + private readonly MessagesManager _messagesManager = new MessagesManager(); + + public EndCallViewModel(CallManager callManager) + { + _callManager = callManager; + } + + /// + /// Callback a call + /// + public void CallBack() + { + } + + /// + /// Send a message + /// + public void Message() + { + } + } +} diff --git a/CallApp.Tizen/Call/ViewModel/IncomingCallViewModel.cs b/CallApp.Tizen/Call/ViewModel/IncomingCallViewModel.cs new file mode 100644 index 0000000..6304167 --- /dev/null +++ b/CallApp.Tizen/Call/ViewModel/IncomingCallViewModel.cs @@ -0,0 +1,56 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using CallApp.Tizen.Call.Manager; +using Tizen.Utility.Helpers; + +namespace CallApp.Tizen.Call.ViewModel +{ + /// + /// ViewModel of IncomingCallView + /// + public class IncomingCallViewModel : BaseModel + { + private readonly CallManager _callManager = null; + private readonly MessagesManager _messagesManager = new MessagesManager(); + + public IncomingCallViewModel(CallManager callManager) + { + _callManager = callManager; + } + + /// + /// Accept a call + /// + public void AcceptCall() + { + } + + /// + /// Reject a call + /// + public void RejectCall() + { + } + + /// + /// Reject a call with message + /// + public void RejectCallWithMessage(string text) + { + } + } +} diff --git a/CallApp.Tizen/Call/ViewModel/MainViewModel.cs b/CallApp.Tizen/Call/ViewModel/MainViewModel.cs new file mode 100644 index 0000000..dcefe6d --- /dev/null +++ b/CallApp.Tizen/Call/ViewModel/MainViewModel.cs @@ -0,0 +1,66 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using CallApp.Tizen.Call.Manager; +using Tizen.Utility.Helpers; + +namespace CallApp.Tizen.Call.ViewModel +{ + /// + /// ViewModel of MainPage + /// + public class MainViewModel : BaseModel + { + private readonly CallManager _callManager = null; + + // FIXME: Due to warning "is assigned but its value is never used" + /* + private readonly CallViewModel _callVM = null; + private readonly ConferenceCallViewModel _conferenceCallVM = null; + private readonly EndCallViewModel _endCallVM = null; + private readonly IncomingCallViewModel _incomingCallVM = null; + private readonly MiniIncomingCallViewModel _miniIncomingCallVM = null; + */ + + public MainViewModel(CallManager callManager) + { + _callManager = callManager; + + // FIXME: Test only + CurrentVM = new CallViewModel(_callManager); + // + } + + /// + /// Current ViewModel + /// + private BaseModel _currentVM = null; + public BaseModel CurrentVM + { + get + { + return _currentVM; + } + + set + { + _currentVM = value; + + OnPropertyChanged(); + } + } + } +} diff --git a/CallApp.Tizen/Call/ViewModel/MiniIncomingCallViewModel.cs b/CallApp.Tizen/Call/ViewModel/MiniIncomingCallViewModel.cs new file mode 100644 index 0000000..44c62b1 --- /dev/null +++ b/CallApp.Tizen/Call/ViewModel/MiniIncomingCallViewModel.cs @@ -0,0 +1,30 @@ +/* + * Copyright 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * 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. + */ + +using CallApp.Tizen.Call.Manager; + +namespace CallApp.Tizen.Call.ViewModel +{ + /// + /// ViewModel of MiniIncomingCallView + /// + public class MiniIncomingCallViewModel : IncomingCallViewModel + { + public MiniIncomingCallViewModel(CallManager callManager) : base(callManager) + { + } + } +} diff --git a/CallApp.Tizen/CallApp.Tizen.csproj b/CallApp.Tizen/CallApp.Tizen.csproj index 6df77e4..6bc6f1b 100644 --- a/CallApp.Tizen/CallApp.Tizen.csproj +++ b/CallApp.Tizen/CallApp.Tizen.csproj @@ -55,6 +55,26 @@ App.xaml + + + + + + + + + + + + + + + + CallView.xaml + + + ConferenceCallView.xaml + AnimatedCircleButton.xaml @@ -98,6 +118,18 @@ ConferenceCallManagePage.xaml + + EndCallView.xaml + + + IncomingCallView.xaml + + + MainPage.xaml + + + MiniIncomingCallView.xaml + CommonTheme.xaml @@ -111,6 +143,7 @@ GesturesContainer.xaml + @@ -126,8 +159,6 @@ - - @@ -269,6 +300,36 @@ MSBuild:UpdateDesignTimeXaml + + + MSBuild:UpdateDesignTimeXaml + + + + + MSBuild:UpdateDesignTimeXaml + + + + + MSBuild:UpdateDesignTimeXaml + + + + + MSBuild:UpdateDesignTimeXaml + + + + + MSBuild:UpdateDesignTimeXaml + + + + + MSBuild:UpdateDesignTimeXaml + +