diff options
author | Ruslan Zakharov <r.zakharov@samsung.com> | 2017-10-03 11:55:04 +0300 |
---|---|---|
committer | Ruslan Zakharov <r.zakharov@samsung.com> | 2017-11-22 13:25:56 +0200 |
commit | 0797616fe7ee7669df91fe8b96ed2b64e4eb78b9 (patch) | |
tree | 4e2fb3db5e8a9eca5ba0b64b8152e0f3b10398d9 | |
parent | c4ca9300b19d48a9aa852e0a2f12bf196be0aa6b (diff) | |
download | call-ui-tizen.tar.gz call-ui-tizen.tar.bz2 call-ui-tizen.zip |
TizenRefApp-9104 Refactor ContactInformationPaneltizen
Divided on separate views and changed Grid to Stacklayout
Change-Id: Ie8225a34e3f79275086bfdfb4832eff211861281
19 files changed, 446 insertions, 313 deletions
diff --git a/CallApp.Tizen/Call/View/CallView.xaml b/CallApp.Tizen/Call/View/CallView.xaml index 5725889..a5c561c 100644 --- a/CallApp.Tizen/Call/View/CallView.xaml +++ b/CallApp.Tizen/Call/View/CallView.xaml @@ -10,18 +10,19 @@ <TizenUtilityControls:CustomGrid> <StackLayout> <StackLayout> - <CallControls:ContactInfoPanel LayoutType="Single" Image="{Binding ActiveCall.ContactModel.Image}" - PrimaryText="{Binding ActiveCall.ContactModel.Name}" SecondaryText="{Binding ActiveCall.CallerNumber}"> - <CallControls:ContactInfoPanel.Triggers> - <DataTrigger TargetType="CallControls:ContactInfoPanel" Binding="{Binding ActiveCall.Status}" Value="Active"> + <CallControls:SingleContactInfoPanel Image="{Binding ActiveCall.ContactModel.Image}" + PrimaryText="{Binding ActiveCall.ContactModel.Name}" + SecondaryText="{Binding ActiveCall.CallerNumber}"> + <CallControls:SingleContactInfoPanel.Triggers> + <DataTrigger TargetType="CallControls:SingleContactInfoPanel" Binding="{Binding ActiveCall.Status}" Value="Active"> <Setter Property="StatusText" Value="{Binding CallDuration.Duration}" /> </DataTrigger> - <DataTrigger TargetType="CallControls:ContactInfoPanel" Binding="{Binding ActiveCall.Status}" Value="Outgoing"> + <DataTrigger TargetType="CallControls:SingleContactInfoPanel" Binding="{Binding ActiveCall.Status}" Value="Outgoing"> <Setter Property="StatusText" Value="{x:Static Localization:Localization.Dialling}" /> </DataTrigger> - </CallControls:ContactInfoPanel.Triggers> - </CallControls:ContactInfoPanel> + </CallControls:SingleContactInfoPanel.Triggers> + </CallControls:SingleContactInfoPanel> <CallControls:CallHandlingPanel ToggleSpeakerCommand="{Binding ToggleSpeakerCommand}" OpenKeypadCommand="{Binding OpenKeypadCommand}" diff --git a/CallApp.Tizen/Call/View/ConferenceCallView.xaml b/CallApp.Tizen/Call/View/ConferenceCallView.xaml index 90fd6ca..0aa6090 100644 --- a/CallApp.Tizen/Call/View/ConferenceCallView.xaml +++ b/CallApp.Tizen/Call/View/ConferenceCallView.xaml @@ -10,9 +10,10 @@ <TizenUtilityControls:CustomGrid> <StackLayout> <StackLayout> - <CallControls:ContactInfoPanel LayoutType="Conference" StatusText="{Binding CallDuration.Duration}" - PrimaryText="{x:Static Localization:Localization.Conference}" SecondaryText="{Binding ConferencePeopleCount}" - ActionCommand="{Binding CallManagementCommand}" /> + <CallControls:ConferenceContactInfoPanel StatusText="{Binding CallDuration.Duration}" + PrimaryText="{x:Static Localization:Localization.Conference}" + SecondaryText="{Binding ConferencePeopleCount}" + ActionCommand="{Binding CallManagementCommand}" /> <CallControls:CallHandlingPanel SpeakerCommand="{Binding SpeakerCommand}" KeypadCommand="{Binding KeypadCommand}" diff --git a/CallApp.Tizen/Call/View/Controls/ActiveContactInfoPanel.xaml b/CallApp.Tizen/Call/View/Controls/ActiveContactInfoPanel.xaml new file mode 100644 index 0000000..33f048e --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/ActiveContactInfoPanel.xaml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CallControls:ContactInfoPanel xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="CallApp.Tizen.Call.View.Controls.ActiveContactInfoPanel" + x:Name="This" + xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls" + xmlns:TizenUtilityConverters="clr-namespace:Tizen.Utility.Converters" + HeightRequest="172"> + + <CallControls:ContactInfoPanel.Resources> + <ResourceDictionary> + <TizenUtilityConverters:IsNullConverter x:Key="IsNull" /> + </ResourceDictionary> + </CallControls:ContactInfoPanel.Resources> + + <StackLayout Orientation="Horizontal"> + <RelativeLayout Margin="32,0,0,0" HorizontalOptions="Start" VerticalOptions="Center"> + <Image x:Name="xPhoto" WidthRequest="96" HeightRequest="96"> + <Image.Triggers> + <DataTrigger TargetType="Image" Binding="{Binding Image, Source={x:Reference This}, Converter={StaticResource IsNull}}" Value="True"> + <Setter Property="Source" Value="Call ID/96x96/call_active_photo_id_default.png" /> + </DataTrigger> + + <DataTrigger TargetType="Image" Binding="{Binding Image, Source={x:Reference This}, Converter={StaticResource IsNull}}" Value="False"> + <Setter Property="Source" Value="{Binding Image, Source={x:Reference This}}" /> + </DataTrigger> + </Image.Triggers> + </Image> + + <Image Source="call_active_ic_call.png" + RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=xPhoto, Property=X, Constant=55}" + RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=xPhoto, Property=Y, Constant=55}" /> + </RelativeLayout> + + <StackLayout Margin="32,0,0,0" VerticalOptions="Center"> + <Label HeightRequest="43" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="21" Text="{Binding StatusText, Source={x:Reference This}}" /> + + <Label HeightRequest="53" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="26" Text="{Binding PrimaryText, Source={x:Reference This}}" /> + + <Label HeightRequest="43" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="21" Text="{Binding SecondaryText, Source={x:Reference This}}" IsVisible="False" /> + </StackLayout> + </StackLayout> +</CallControls:ContactInfoPanel>
\ No newline at end of file diff --git a/CallApp.Tizen/Call/View/Controls/ActiveContactInfoPanel.xaml.cs b/CallApp.Tizen/Call/View/Controls/ActiveContactInfoPanel.xaml.cs new file mode 100644 index 0000000..823d6c1 --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/ActiveContactInfoPanel.xaml.cs @@ -0,0 +1,29 @@ +/* + * 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.View.Controls +{ + /// <summary> + /// Represents ContactInfoPanel for Active call status in mini state + /// </summary> + public partial class ActiveContactInfoPanel : ContactInfoPanel + { + public ActiveContactInfoPanel() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/View/Controls/ConferenceContactInfoPanel.xaml b/CallApp.Tizen/Call/View/Controls/ConferenceContactInfoPanel.xaml new file mode 100644 index 0000000..10bec9e --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/ConferenceContactInfoPanel.xaml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CallControls:ContactInfoPanel xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="CallApp.Tizen.Call.View.Controls.ConferenceContactInfoPanel" + x:Name="This" + xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls" + xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls" + HeightRequest="712"> + + <TizenUtilityControls:CustomGrid> + <StackLayout> + <Label Margin="32,24,0,0" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="27" Text="{Binding StatusText, Source={x:Reference This}}" /> + + <Image Margin="104,33,104,0" Source="Call ID/348x348/call_photo_id_conference.png" /> + + <Label Margin="104,14,104,0" HorizontalOptions="Center" TextColor="{StaticResource DefaultTextColor}" + FontSize="47" Text="{Binding PrimaryText, Source={x:Reference This}}" /> + + <Label Margin="104,8,104,0" HorizontalOptions="Center" TextColor="{StaticResource DefaultTextColor}" + FontSize="27" Text="{Binding SecondaryText, Source={x:Reference This}}" /> + </StackLayout> + + <CallControls:FlatButton Margin="0,0,22,98" WidthRequest="50" HeightRequest="50" + HorizontalOptions="End" VerticalOptions="End" Image="call_multi_ic_arrow.png" + Command="{Binding ActionCommand, Source={x:Reference This}, Mode=TwoWay}}" /> + </TizenUtilityControls:CustomGrid> +</CallControls:ContactInfoPanel>
\ No newline at end of file diff --git a/CallApp.Tizen/Call/View/Controls/ConferenceContactInfoPanel.xaml.cs b/CallApp.Tizen/Call/View/Controls/ConferenceContactInfoPanel.xaml.cs new file mode 100644 index 0000000..2f604cf --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/ConferenceContactInfoPanel.xaml.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 Xamarin.Forms; + +namespace CallApp.Tizen.Call.View.Controls +{ + /// <summary> + /// Represents ContactInfoPanel for Conference call status + /// </summary> + public partial class ConferenceContactInfoPanel : ContactInfoPanel + { + public ConferenceContactInfoPanel() + { + InitializeComponent(); + } + + /// <summary> + /// Сommand to binding various custom actions + /// </summary> + public static readonly BindableProperty ActionCommandProperty = BindableProperty.Create( + "ActionCommand", + typeof(Command), + typeof(ConferenceContactInfoPanel), + null); + + public Command ActionCommand + { + get + { + return (Command)GetValue(ActionCommandProperty); + } + + set + { + SetValue(ActionCommandProperty, value); + } + } + } +} diff --git a/CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml b/CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml index 4d9d7e7..9221bcf 100644 --- a/CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml +++ b/CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml @@ -1,240 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - x:Class="CallApp.Tizen.Call.View.Controls.ContactInfoPanel" - x:Name="This" - xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls" - xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls" - xmlns:TizenUtilityConverters="clr-namespace:Tizen.Utility.Converters"> + x:Class="CallApp.Tizen.Call.View.Controls.ContactInfoPanel"> - <ContentView.Resources> - <ResourceDictionary> - <TizenUtilityConverters:IsNullConverter x:Key="IsNull" /> - - <ControlTemplate x:Key="ActivePanel"> - <TizenUtilityControls:CustomGrid HeightRequest="172"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="160" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - - <RelativeLayout Grid.Column="0" HorizontalOptions="Center" VerticalOptions="Center"> - <Image x:Name="xPhoto" WidthRequest="96" HeightRequest="96" HorizontalOptions="Center" VerticalOptions="Center"> - <Image.Triggers> - <DataTrigger TargetType="Image" Binding="{TemplateBinding Image, Converter={StaticResource IsNull}}" Value="True"> - <Setter Property="Source" Value="Call ID/96x96/call_active_photo_id_default.png" /> - </DataTrigger> - - <DataTrigger TargetType="Image" Binding="{TemplateBinding Image, Converter={StaticResource IsNull}}" Value="False"> - <Setter Property="Source" Value="{TemplateBinding Image}" /> - </DataTrigger> - </Image.Triggers> - </Image> - - <Image Source="call_active_ic_call.png" - RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=xPhoto, Property=X, Constant=55}" - RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=xPhoto, Property=Y, Constant=55}" /> - </RelativeLayout> - - <StackLayout Grid.Column="1" VerticalOptions="Center"> - <Label HeightRequest="43" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="21" Text="{TemplateBinding StatusText}" /> - - <Label HeightRequest="53" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="26" Text="{TemplateBinding PrimaryText}" /> - - <Label HeightRequest="43" HorizontalOptions="Start" VerticalOptions="Center" - TextColor="{StaticResource DefaultTextColor}" FontSize="21" Text="{TemplateBinding SecondaryText}" - IsVisible="False" /> - </StackLayout> - </TizenUtilityControls:CustomGrid> - </ControlTemplate> - - <ControlTemplate x:Key="ConferencePanel"> - <TizenUtilityControls:CustomGrid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="104" /> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="104" /> - </Grid.ColumnDefinitions> - - <Grid.RowDefinitions> - <RowDefinition Height="24" /> - <RowDefinition Height="54" /> - <RowDefinition Height="33" /> - <RowDefinition Height="348" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <Label Grid.Column="0" Grid.Row="1" Margin="32,0,0,0" HorizontalOptions="Start" VerticalOptions="Center" - TextColor="{StaticResource DefaultTextColor}" FontSize="27" Text="{TemplateBinding StatusText}" /> - - <Image Grid.Column="1" Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center" Source="Call ID/348x348/call_photo_id_conference.png" /> - - <TizenUtilityControls:CustomGrid Grid.Column="1" Grid.Row="4"> - <Grid.RowDefinitions> - <RowDefinition Height="42" /> - <RowDefinition Height="86" /> - <RowDefinition Height="8" /> - <RowDefinition Height="54" /> - <RowDefinition Height="63" /> - </Grid.RowDefinitions> - - <Label Grid.Row="1" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="47" Text="{TemplateBinding PrimaryText}" /> - - <Label Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="27" Text="{TemplateBinding SecondaryText}" /> - </TizenUtilityControls:CustomGrid> - - <CallControls:FlatButton Grid.Column="2" Grid.Row="4" WidthRequest="50" HeightRequest="50" Margin="0,32,22,0" - HorizontalOptions="Center" VerticalOptions="Center" Image="call_multi_ic_arrow.png" - Command="{TemplateBinding ActionCommand}" /> - </TizenUtilityControls:CustomGrid> - </ControlTemplate> - - <ControlTemplate x:Key="EmergencyPanel"> - <TizenUtilityControls:CustomGrid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="32" /> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="32" /> - </Grid.ColumnDefinitions> - - <Grid.RowDefinitions> - <RowDefinition Height="24" /> - <RowDefinition Height="54" /> - <RowDefinition Height="33" /> - <RowDefinition Height="348" /> - <RowDefinition Height="71" /> - <RowDefinition Height="86" /> - <RowDefinition Height="96" /> - </Grid.RowDefinitions> - - <Label Grid.Column="1" Grid.Row="1" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="27" Text="{TemplateBinding StatusText}" /> - - <Image Grid.Column="1" Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center" Source="Call ID/348x348/call_photo_id_emergency.png" /> - - <Label Grid.Column="1" Grid.Row="5" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="47" Text="{TemplateBinding PrimaryText}" /> - </TizenUtilityControls:CustomGrid> - </ControlTemplate> - - <ControlTemplate x:Key="SinglePanel"> - <TizenUtilityControls:CustomGrid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="32" /> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="32" /> - </Grid.ColumnDefinitions> - - <Grid.RowDefinitions> - <RowDefinition Height="24" /> - <RowDefinition Height="54" /> - <RowDefinition Height="33" /> - <RowDefinition Height="348" /> - <RowDefinition Height="42" /> - <RowDefinition Height="86" /> - <RowDefinition Height="8" /> - <RowDefinition Height="54" /> - <RowDefinition Height="63" /> - </Grid.RowDefinitions> - - <Label Grid.Column="1" Grid.Row="1" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="27" Text="{TemplateBinding StatusText}" /> - - <Image Grid.Column="1" Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center"> - <Image.Triggers> - <DataTrigger TargetType="Image" Binding="{TemplateBinding Image, Converter={StaticResource IsNull}}" Value="True"> - <Setter Property="Source" Value="Call ID/348x348/call_photo_id.png" /> - </DataTrigger> - - <DataTrigger TargetType="Image" Binding="{TemplateBinding Image, Converter={StaticResource IsNull}}" Value="False"> - <Setter Property="Source" Value="{TemplateBinding Image}" /> - </DataTrigger> - </Image.Triggers> - </Image> - - <Label Grid.Column="1" Grid.Row="5" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="47" Text="{TemplateBinding PrimaryText}" /> - - <Label Grid.Column="1" Grid.Row="7" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="27" Text="{TemplateBinding SecondaryText}" /> - </TizenUtilityControls:CustomGrid> - </ControlTemplate> - - <ControlTemplate x:Key="TopPanel"> - <TizenUtilityControls:CustomGrid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="232" /> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <Grid.RowDefinitions> - <RowDefinition Height="24" /> - <RowDefinition Height="54" /> - <RowDefinition Height="242" /> - </Grid.RowDefinitions> - - <Label Grid.Column="0" Grid.Row="1" Margin="32,0,0,0" HorizontalOptions="Start" VerticalOptions="Center" - TextColor="{StaticResource DefaultTextColor}" FontSize="27" Text="{TemplateBinding StatusText}" /> - - <Image Grid.Column="0" Grid.Row="2" Margin="32,0,32,0" WidthRequest="168" HeightRequest="168" - HorizontalOptions="Center" VerticalOptions="Center"> - <Image.Triggers> - <DataTrigger TargetType="Image" Binding="{TemplateBinding Image, Converter={StaticResource IsNull}}" Value="True"> - <Setter Property="Source" Value="Call ID/168x168/call_end_photo_id_default.png" /> - </DataTrigger> - - <DataTrigger TargetType="Image" Binding="{TemplateBinding Image, Converter={StaticResource IsNull}}" Value="False"> - <Setter Property="Source" Value="{TemplateBinding Image}" /> - </DataTrigger> - </Image.Triggers> - </Image> - - <TizenUtilityControls:CustomGrid Grid.Column="1" Grid.Row="2"> - <Grid.RowDefinitions> - <RowDefinition Height="50" /> - <RowDefinition Height="76" /> - <RowDefinition Height="6" /> - <RowDefinition Height="46" /> - </Grid.RowDefinitions> - - <Label Grid.Row="1" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="38" Text="{TemplateBinding PrimaryText}" /> - - <Label Grid.Row="3" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource DefaultTextColor}" - FontSize="23" Text="{TemplateBinding SecondaryText}" /> - </TizenUtilityControls:CustomGrid> - - <CallControls:FlatButton Grid.Column="2" Grid.Row="2" WidthRequest="80" HeightRequest="80" - Margin="32,74,0,0" Image="call_btn_addcall.png" IsVisible="False" /> - </TizenUtilityControls:CustomGrid> - </ControlTemplate> - </ResourceDictionary> - </ContentView.Resources> - - <ContentView.Triggers> - <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Active"> - <Setter Property="ControlTemplate" Value="{StaticResource ActivePanel}" /> - </DataTrigger> - - <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Conference"> - <Setter Property="ControlTemplate" Value="{StaticResource ConferencePanel}" /> - </DataTrigger> - - <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Emergency"> - <Setter Property="ControlTemplate" Value="{StaticResource EmergencyPanel}" /> - </DataTrigger> - - <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Single"> - <Setter Property="ControlTemplate" Value="{StaticResource SinglePanel}" /> - </DataTrigger> - - <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Top"> - <Setter Property="ControlTemplate" Value="{StaticResource TopPanel}" /> - </DataTrigger> - </ContentView.Triggers> </ContentView>
\ No newline at end of file diff --git a/CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml.cs b/CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml.cs index bd9f4b5..c6f30f2 100644 --- a/CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml.cs +++ b/CallApp.Tizen/Call/View/Controls/ContactInfoPanel.xaml.cs @@ -19,72 +19,16 @@ using Xamarin.Forms; namespace CallApp.Tizen.Call.View.Controls { /// <summary> - /// Partial class of ContactInfoPanel.xaml + /// Represents base class of ContactInfoPanel /// </summary> public partial class ContactInfoPanel : ContentView { - /// <summary> - /// Layout types - /// </summary> - public enum LayoutTypes - { - Active, - Conference, - Emergency, - Single, - Top - } - public ContactInfoPanel() { InitializeComponent(); } /// <summary> - /// Сommand to binding various custom actions - /// </summary> - public static readonly BindableProperty ActionCommandProperty = BindableProperty.Create( - "ActionCommand", - typeof(Command), - typeof(ContactInfoPanel), - null); - - public Command ActionCommand - { - get - { - return (Command)GetValue(ActionCommandProperty); - } - - set - { - SetValue(ActionCommandProperty, value); - } - } - - /// <summary> - /// Layout type of panel - /// </summary> - public static readonly BindableProperty LayoutTypeProperty = BindableProperty.Create( - "LayoutType", - typeof(LayoutTypes), - typeof(ContactInfoPanel), - LayoutTypes.Active); - - public LayoutTypes LayoutType - { - get - { - return (LayoutTypes)GetValue(LayoutTypeProperty); - } - - set - { - SetValue(LayoutTypeProperty, value); - } - } - - /// <summary> /// Text of status /// </summary> public static readonly BindableProperty StatusTextProperty = BindableProperty.Create( diff --git a/CallApp.Tizen/Call/View/Controls/EmergencyContactInfoPanel.xaml b/CallApp.Tizen/Call/View/Controls/EmergencyContactInfoPanel.xaml new file mode 100644 index 0000000..a11bb26 --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/EmergencyContactInfoPanel.xaml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CallControls:ContactInfoPanel xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="CallApp.Tizen.Call.View.Controls.EmergencyContactInfoPanel" + x:Name="This" + xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls" + HeightRequest="712"> + + <StackLayout> + <Label Margin="32,24,0,0" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="27" Text="{Binding StatusText, Source={x:Reference This}}" /> + + <Image Margin="32,33,32,0" Source="Call ID/348x348/call_photo_id_emergency.png" /> + + <Label Margin="32,71,32,0" HorizontalOptions="Center" TextColor="{StaticResource DefaultTextColor}" + FontSize="47" Text="{Binding PrimaryText, Source={x:Reference This}}" /> + </StackLayout> +</CallControls:ContactInfoPanel>
\ No newline at end of file diff --git a/CallApp.Tizen/Call/View/Controls/EmergencyContactInfoPanel.xaml.cs b/CallApp.Tizen/Call/View/Controls/EmergencyContactInfoPanel.xaml.cs new file mode 100644 index 0000000..c2b2130 --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/EmergencyContactInfoPanel.xaml.cs @@ -0,0 +1,29 @@ +/* + * 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.View.Controls +{ + /// <summary> + /// Represents ContactInfoPanel for Emergency call status + /// </summary> + public partial class EmergencyContactInfoPanel : ContactInfoPanel + { + public EmergencyContactInfoPanel() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/View/Controls/MergeSwapPanel.xaml b/CallApp.Tizen/Call/View/Controls/MergeSwapPanel.xaml index ac1d1e3..505290b 100644 --- a/CallApp.Tizen/Call/View/Controls/MergeSwapPanel.xaml +++ b/CallApp.Tizen/Call/View/Controls/MergeSwapPanel.xaml @@ -6,8 +6,9 @@ xmlns:Localization="clr-namespace:CallApp.Tizen.Localization"> <StackLayout> - <CallControls:ContactInfoPanel LayoutType="Top" StatusText="{x:Static Localization:Localization.OnHold}" - PrimaryText="Test" SecondaryText="Test" /> + <CallControls:TopContactInfoPanel StatusText="{x:Static Localization:Localization.OnHold}" + PrimaryText="Test" + SecondaryText="Test" /> <StackLayout HeightRequest="122" Orientation="Horizontal"> <CallControls:FlatButton HorizontalOptions="FillAndExpand" Image="call_multi_ic_merge.png" Text="{x:Static Localization:Localization.Merge}" /> diff --git a/CallApp.Tizen/Call/View/Controls/SingleContactInfoPanel.xaml b/CallApp.Tizen/Call/View/Controls/SingleContactInfoPanel.xaml new file mode 100644 index 0000000..8668981 --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/SingleContactInfoPanel.xaml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CallControls:ContactInfoPanel xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="CallApp.Tizen.Call.View.Controls.SingleContactInfoPanel" + x:Name="This" + xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls" + xmlns:TizenUtilityConverters="clr-namespace:Tizen.Utility.Converters" + HeightRequest="712"> + + <CallControls:ContactInfoPanel.Resources> + <ResourceDictionary> + <TizenUtilityConverters:IsNullConverter x:Key="IsNull" /> + </ResourceDictionary> + </CallControls:ContactInfoPanel.Resources> + + <StackLayout> + <Label Margin="32,24,0,0" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="27" Text="{Binding StatusText, Source={x:Reference This}}" /> + + <Image Margin="32,33,32,0"> + <Image.Triggers> + <DataTrigger TargetType="Image" Binding="{Binding Image, Source={x:Reference This}, Converter={StaticResource IsNull}}" Value="True"> + <Setter Property="Source" Value="Call ID/348x348/call_photo_id.png" /> + </DataTrigger> + + <DataTrigger TargetType="Image" Binding="{Binding Image, Source={x:Reference This}, Converter={StaticResource IsNull}}" Value="False"> + <Setter Property="Source" Value="{Binding Image, Source={x:Reference This}}" /> + </DataTrigger> + </Image.Triggers> + </Image> + + <Label Margin="32,14,32,0" HorizontalOptions="Center" TextColor="{StaticResource DefaultTextColor}" + FontSize="47" Text="{Binding PrimaryText, Source={x:Reference This}}" /> + + <Label Margin="32,8,32,0" HorizontalOptions="Center" TextColor="{StaticResource DefaultTextColor}" + FontSize="27" Text="{Binding SecondaryText, Source={x:Reference This}}" /> + </StackLayout> +</CallControls:ContactInfoPanel>
\ No newline at end of file diff --git a/CallApp.Tizen/Call/View/Controls/SingleContactInfoPanel.xaml.cs b/CallApp.Tizen/Call/View/Controls/SingleContactInfoPanel.xaml.cs new file mode 100644 index 0000000..f0aef8f --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/SingleContactInfoPanel.xaml.cs @@ -0,0 +1,29 @@ +/* + * 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.View.Controls +{ + /// <summary> + /// Represents ContactInfoPanel for Active, Incoming, Outgoing call statuses + /// </summary> + public partial class SingleContactInfoPanel : ContactInfoPanel + { + public SingleContactInfoPanel() + { + InitializeComponent(); + } + } +} diff --git a/CallApp.Tizen/Call/View/Controls/TopContactInfoPanel.xaml b/CallApp.Tizen/Call/View/Controls/TopContactInfoPanel.xaml new file mode 100644 index 0000000..1be4413 --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/TopContactInfoPanel.xaml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CallControls:ContactInfoPanel xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="CallApp.Tizen.Call.View.Controls.TopContactInfoPanel" + x:Name="This" + xmlns:CallControls="clr-namespace:CallApp.Tizen.Call.View.Controls" + xmlns:TizenUtilityControls="clr-namespace:Tizen.Utility.Controls" + xmlns:TizenUtilityConverters="clr-namespace:Tizen.Utility.Converters" + HeightRequest="320"> + + <CallControls:ContactInfoPanel.Resources> + <ResourceDictionary> + <TizenUtilityConverters:IsNullConverter x:Key="IsNull" /> + </ResourceDictionary> + </CallControls:ContactInfoPanel.Resources> + + <StackLayout> + <Label Margin="32,24,0,0" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="27" Text="{Binding StatusText, Source={x:Reference This}}" /> + + <StackLayout Orientation="Horizontal"> + <Image Margin="32,30,0,44" WidthRequest="168" HeightRequest="168"> + <Image.Triggers> + <DataTrigger TargetType="Image" Binding="{Binding Image, Source={x:Reference This}, Converter={StaticResource IsNull}}" Value="True"> + <Setter Property="Source" Value="Call ID/168x168/call_end_photo_id_default.png" /> + </DataTrigger> + + <DataTrigger TargetType="Image" Binding="{Binding Image, Source={x:Reference This}, Converter={StaticResource IsNull}}" Value="False"> + <Setter Property="Source" Value="{Binding Image, Source={x:Reference This}}" /> + </DataTrigger> + </Image.Triggers> + </Image> + + <TizenUtilityControls:CustomGrid Margin="32,0,0,0" HorizontalOptions="FillAndExpand"> + <StackLayout> + <Label Margin="0,50,0,0" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="38" Text="{Binding PrimaryText, Source={x:Reference This}}" /> + + <Label Margin="0,6,0,0" HorizontalOptions="Start" TextColor="{StaticResource DefaultTextColor}" + FontSize="23" Text="{Binding SecondaryText, Source={x:Reference This}}" /> + </StackLayout> + + <CallControls:FlatButton Margin="32,74,17,0" WidthRequest="80" HeightRequest="80" + HorizontalOptions="End" VerticalOptions="Start" Image="call_btn_addcall.png" + Command="{Binding ActionCommand, Source={x:Reference This}, Mode=TwoWay}}" + IsVisible="False" /> + </TizenUtilityControls:CustomGrid> + </StackLayout> + </StackLayout> +</CallControls:ContactInfoPanel>
\ No newline at end of file diff --git a/CallApp.Tizen/Call/View/Controls/TopContactInfoPanel.xaml.cs b/CallApp.Tizen/Call/View/Controls/TopContactInfoPanel.xaml.cs new file mode 100644 index 0000000..b24da35 --- /dev/null +++ b/CallApp.Tizen/Call/View/Controls/TopContactInfoPanel.xaml.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 Xamarin.Forms; + +namespace CallApp.Tizen.Call.View.Controls +{ + /// <summary> + /// Represents ContactInfoPanel for End, Hold call statuses + /// </summary> + public partial class TopContactInfoPanel : ContactInfoPanel + { + public TopContactInfoPanel() + { + InitializeComponent(); + } + + /// <summary> + /// Сommand to binding various custom actions + /// </summary> + public static readonly BindableProperty ActionCommandProperty = BindableProperty.Create( + "ActionCommand", + typeof(Command), + typeof(TopContactInfoPanel), + null); + + public Command ActionCommand + { + get + { + return (Command)GetValue(ActionCommandProperty); + } + + set + { + SetValue(ActionCommandProperty, value); + } + } + } +} diff --git a/CallApp.Tizen/Call/View/EndCallView.xaml b/CallApp.Tizen/Call/View/EndCallView.xaml index 9e0424e..e0289a7 100644 --- a/CallApp.Tizen/Call/View/EndCallView.xaml +++ b/CallApp.Tizen/Call/View/EndCallView.xaml @@ -25,8 +25,9 @@ </ContentView.Resources> <StackLayout> - <CallControls:ContactInfoPanel LayoutType="Top" StatusText="{x:Static Localization:Localization.EndCall}" - PrimaryText="{Binding EndCall.ContactModel.Name}" SecondaryText="{Binding EndCall.CallerNumber}" /> + <CallControls:TopContactInfoPanel StatusText="{x:Static Localization:Localization.EndCall}" + PrimaryText="{Binding EndCall.ContactModel.Name}" + SecondaryText="{Binding EndCall.CallerNumber}" /> <StackLayout HeightRequest="190" Orientation="Horizontal"> <Frame Padding="0,0,1,0"> diff --git a/CallApp.Tizen/Call/View/IncomingCallView.xaml b/CallApp.Tizen/Call/View/IncomingCallView.xaml index 51b382d..1118d5d 100644 --- a/CallApp.Tizen/Call/View/IncomingCallView.xaml +++ b/CallApp.Tizen/Call/View/IncomingCallView.xaml @@ -17,9 +17,10 @@ <TizenUtilityControls:CustomGrid> <StackLayout> <TizenUtilityControls:CustomGrid> - <CallControls:ContactInfoPanel LayoutType="Single" StatusText="{x:Static Localization:Localization.IncomingCall}" - Image="{Binding IncomingCall.ContactModel.Image}" - PrimaryText="{Binding IncomingCall.ContactModel.Name}" SecondaryText="{Binding IncomingCall.CallerNumber}" /> + <CallControls:SingleContactInfoPanel StatusText="{x:Static Localization:Localization.IncomingCall}" + Image="{Binding IncomingCall.ContactModel.Image}" + PrimaryText="{Binding IncomingCall.ContactModel.Name}" + SecondaryText="{Binding IncomingCall.CallerNumber}" /> <ContentView> <ContentView.Triggers> diff --git a/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml b/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml index 633d485..4462ffd 100644 --- a/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml +++ b/CallApp.Tizen/Call/View/MiniIncomingCallView.xaml @@ -17,10 +17,11 @@ </ContentView.Resources> <StackLayout> - <CallControls:ContactInfoPanel LayoutType="Active" StatusText="{x:Static Localization:Localization.IncomingCall}" - Image="{Binding IncomingCall.ContactModel.Image}" - PrimaryText="{Binding IncomingCall.ContactModel.Name}" SecondaryText="{Binding IncomingCall.CallerNumber}" - BackgroundColor="{StaticResource ContactInfoPanelBGColor}" /> + <CallControls:ActiveContactInfoPanel StatusText="{x:Static Localization:Localization.IncomingCall}" + Image="{Binding IncomingCall.ContactModel.Image}" + PrimaryText="{Binding IncomingCall.ContactModel.Name}" + SecondaryText="{Binding IncomingCall.CallerNumber}" + BackgroundColor="{StaticResource ContactInfoPanelBGColor}" /> <StackLayout HeightRequest="106" Orientation="Horizontal" BackgroundColor="{StaticResource MiniIncomingCallBGColor}"> <Button Margin="32,0,0,0" WidthRequest="320" HeightRequest="78" HorizontalOptions="Start" VerticalOptions="Center" diff --git a/CallApp.Tizen/CallApp.Tizen.csproj b/CallApp.Tizen/CallApp.Tizen.csproj index 0313f79..dae1a1a 100644 --- a/CallApp.Tizen/CallApp.Tizen.csproj +++ b/CallApp.Tizen/CallApp.Tizen.csproj @@ -81,6 +81,21 @@ <Compile Include="Call\View\ConferenceCallView.xaml.cs"> <DependentUpon>ConferenceCallView.xaml</DependentUpon> </Compile> + <Compile Include="Call\View\Controls\TopContactInfoPanel.xaml.cs"> + <DependentUpon>TopContactInfoPanel.xaml</DependentUpon> + </Compile> + <Compile Include="Call\View\Controls\SingleContactInfoPanel.xaml.cs"> + <DependentUpon>SingleContactInfoPanel.xaml</DependentUpon> + </Compile> + <Compile Include="Call\View\Controls\EmergencyContactInfoPanel.xaml.cs"> + <DependentUpon>EmergencyContactInfoPanel.xaml</DependentUpon> + </Compile> + <Compile Include="Call\View\Controls\ConferenceContactInfoPanel.xaml.cs"> + <DependentUpon>ConferenceContactInfoPanel.xaml</DependentUpon> + </Compile> + <Compile Include="Call\View\Controls\ActiveContactInfoPanel.xaml.cs"> + <DependentUpon>ActiveContactInfoPanel.xaml</DependentUpon> + </Compile> <Compile Include="Call\View\Controls\AnimatedCircleButton.xaml.cs"> <DependentUpon>AnimatedCircleButton.xaml</DependentUpon> </Compile> @@ -375,6 +390,35 @@ <Generator>MSBuild:UpdateDesignTimeXaml</Generator> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Call\View\Controls\ActiveContactInfoPanel.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Call\View\Controls\ConferenceContactInfoPanel.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Call\View\Controls\EmergencyContactInfoPanel.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Call\View\Controls\SingleContactInfoPanel.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Call\View\Controls\TopContactInfoPanel.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. |