Skip to content

Commit

Permalink
- Fixed mobile device screen zoom and rotate view issues
Browse files Browse the repository at this point in the history
- Set UFT API's errors as WARN
  • Loading branch information
MeniKadosh1 committed Sep 22, 2024
1 parent 154343b commit fcd6097
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 47 deletions.
67 changes: 35 additions & 32 deletions Ginger/Ginger/Drivers/DriversWindows/MobileDriverWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:UserControls="clr-namespace:Amdocs.Ginger.UserControls" xmlns:Ginger="clr-namespace:Ginger" xmlns:GingerCore="clr-namespace:GingerCore;assembly=GingerCore"
mc:Ignorable="d"
Title="Loading Device..." Height="650" Width="350"
Title="Loading Device..." Height="650" Width="370"
MinHeight="650" MinWidth="350" WindowStyle="ThreeDBorderWindow" ResizeMode="CanMinimize"
WindowStartupLocation="CenterScreen" Closing="Window_Closing" SizeChanged="Window_SizeChanged" Loaded="Window_Loaded"
Topmost="False" KeyDown="Window_KeyDown">
Expand Down Expand Up @@ -111,13 +111,13 @@

<Grid x:Name="xDeviceViewGrid" Margin="5" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="12"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="100*"/>
<ColumnDefinition Width="12"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="2"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="25"/>
<RowDefinition/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
Expand All @@ -126,41 +126,39 @@
<UserControls:ImageMakerControl x:Name="xRecordingImage" Grid.Row="0" Grid.Column="1" Height="16" Width="16" ImageType="Recording" Foreground="Red" ImageForeground="Red" HorizontalAlignment="Center" VerticalAlignment="Center" SetBorder="False" ToolTip="Recording..." Margin="0,0,0,0" Visibility="Collapsed" />


<!--mobile image -->
<Border Grid.Column="1" Grid.Row="1" BorderThickness="1" CornerRadius="0" BorderBrush="#424242" Background="#424242" Margin="0">
<Border.Effect>
<DropShadowEffect Color="Black" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect>
<DockPanel Background="#424242">
<StackPanel x:Name="xMessagePnl" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,100,0,0" DockPanel.Dock="Top">
<UserControls:ImageMakerControl x:Name="xMessageImage" ImageType="AndroidWhite" Width="110" Height="110"/>
<Label x:Name="xMessageLbl" Content="Loading..." Foreground="WhiteSmoke" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontWeight="Normal"/>
<UserControls:ImageMakerControl x:Name="xMessageProcessingImage" ImageType="Processing" SetAsFontImageWithSize="30" Width="30" Height="30" Foreground="WhiteSmoke" HorizontalAlignment="Center" VerticalAlignment="Center" />
</StackPanel>
<DockPanel x:Name="xDeviceSectionMainPnl" Grid.Row="1" Grid.Column="1" Background="#424242" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<StackPanel x:Name="xMessagePnl" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,100,0,0" DockPanel.Dock="Top">
<UserControls:ImageMakerControl x:Name="xMessageImage" ImageType="AndroidWhite" Width="110" Height="110"/>
<Label x:Name="xMessageLbl" Content="Loading..." Foreground="WhiteSmoke" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontWeight="Normal"/>
<UserControls:ImageMakerControl x:Name="xMessageProcessingImage" ImageType="Processing" SetAsFontImageWithSize="30" Width="30" Height="30" Foreground="WhiteSmoke" HorizontalAlignment="Center" VerticalAlignment="Center" />
</StackPanel>

<Canvas x:Name="xDeviceScreenshotCanvas" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" DockPanel.Dock="Top" MinWidth="200" MinHeight="500">
<Canvas x:Name="xDeviceScreenshotCanvas" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" DockPanel.Dock="Top" Height="{Binding ActualHeight, ElementName=xDeviceSectionMainPnl}" Width="{Binding ActualWidth, ElementName=xDeviceSectionMainPnl}">
<Border BorderThickness="1" CornerRadius="0" BorderBrush="#424242" Background="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="{Binding ActualHeight, ElementName=xDeviceScreenshotCanvas}" Width="{Binding ActualWidth, ElementName=xDeviceScreenshotCanvas}" >
<Border.Effect>
<DropShadowEffect Color="Black" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect>
<Image x:Name="xDeviceScreenshotImage" Panel.ZIndex="1" Cursor="Hand" Height="{Binding ActualHeight, ElementName=xDeviceScreenshotCanvas}" Width="{Binding ActualWidth, ElementName=xDeviceScreenshotCanvas}"
MouseLeftButtonDown="xDeviceScreenshotImage_MouseLeftButtonDown"
MouseMove="xDeviceScreenshotImage_MouseMove"
MouseLeftButtonUp="xDeviceScreenshotImage_MouseLeftButtonUp"
MouseWheel="xDeviceScreenshotImage_MouseWheel"
SizeChanged="xDeviceScreenshotImage_SizeChanged">
</Image>
<Border x:Name="xHighlighterBorder" BorderBrush="{StaticResource $amdocsLogoLinarGradientBrush}" BorderThickness="3" Visibility="Collapsed" Margin="3" Panel.ZIndex="2" />
<UserControls:ucButton x:Name="xSwipeUp" Panel.ZIndex="3" Canvas.Top="1" ButtonType="ImageButton" ButtonFontImageSize="30" ButtonImageType="AngleArrowUp" Click="xSwipeUp_Click" MouseDoubleClick="xSwipeUp_MouseDoubleClick" ToolTip="Swipe Up (Double Click For Double Swipe Up)" Margin="0,0,0,0" ButtonImageForground="{StaticResource $HighlightColor_Purple}" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xSwipeLeft" Panel.ZIndex="3" Canvas.Left="1" ButtonType="ImageButton" ButtonFontImageSize="30" ButtonImageType="AngleArrowLeft" Click="xSwipeLeft_Click" ToolTip="Swipe Left" Margin="0,0,0,0" ButtonImageForground="{StaticResource $HighlightColor_Purple}" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xSwipeRight" Panel.ZIndex="3" Canvas.Right="1" ButtonType="ImageButton" ButtonFontImageSize="30" ButtonImageType="AngleArrowRight" Click="xSwipeRight_Click" ToolTip="Swipe Right" Margin="0,0,0,0" ButtonImageForground="{StaticResource $HighlightColor_Purple}" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xSwipeDown" Panel.ZIndex="3" Canvas.Bottom="1" ButtonType="ImageButton" ButtonFontImageSize="30" ButtonImageType="AngleArrowDown" Click="xSwipeDown_Click" MouseDoubleClick="xSwipeDown_MouseDoubleClick" ToolTip="Swipe Down (Double Click For Double Swipe Down)" Margin="0,0,0,0" ButtonImageForground="{StaticResource $HighlightColor_Purple}" Visibility="Collapsed"/>
<StackPanel x:Name="xCordsStack" Panel.ZIndex="4" Canvas.Left="1" Visibility="Collapsed" MouseEnter="xCordsStack_MouseEnter" Background="{StaticResource $BackgroundColor_White}">
<Label x:Name="xXcord" Foreground="{StaticResource $HighlightColor_Purple}" Content="X: 0" FontSize="12" FontWeight="Bold" HorizontalAlignment="Left" />
<Label x:Name="xYcord" Foreground="{StaticResource $HighlightColor_Purple}" Content="Y: 0" FontSize="12" FontWeight="Bold" HorizontalAlignment="Left" />
</StackPanel>
</Canvas>
</DockPanel>
</Border>


</Border>
<Border x:Name="xHighlighterBorder" BorderBrush="{StaticResource $amdocsLogoLinarGradientBrush}" BorderThickness="3" Visibility="Collapsed" Margin="3" Panel.ZIndex="2" />
<UserControls:ucButton x:Name="xSwipeUp" Panel.ZIndex="3" Canvas.Top="1" ButtonType="ImageButton" ButtonFontImageSize="30" ButtonImageType="AngleArrowUp" Click="xSwipeUp_Click" MouseDoubleClick="xSwipeUp_MouseDoubleClick" ToolTip="Swipe Up (Double Click For Double Swipe Up)" Margin="0,0,0,0" ButtonImageForground="{StaticResource $HighlightColor_Purple}" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xSwipeLeft" Panel.ZIndex="3" Canvas.Left="1" ButtonType="ImageButton" ButtonFontImageSize="30" ButtonImageType="AngleArrowLeft" Click="xSwipeLeft_Click" ToolTip="Swipe Left" Margin="0,0,0,0" ButtonImageForground="{StaticResource $HighlightColor_Purple}" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xSwipeRight" Panel.ZIndex="3" Canvas.Right="1" ButtonType="ImageButton" ButtonFontImageSize="30" ButtonImageType="AngleArrowRight" Click="xSwipeRight_Click" ToolTip="Swipe Right" Margin="0,0,0,0" ButtonImageForground="{StaticResource $HighlightColor_Purple}" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xSwipeDown" Panel.ZIndex="3" Canvas.Bottom="1" ButtonType="ImageButton" ButtonFontImageSize="30" ButtonImageType="AngleArrowDown" Click="xSwipeDown_Click" MouseDoubleClick="xSwipeDown_MouseDoubleClick" ToolTip="Swipe Down (Double Click For Double Swipe Down)" Margin="0,0,0,0" ButtonImageForground="{StaticResource $HighlightColor_Purple}" Visibility="Collapsed"/>
<StackPanel x:Name="xCordsStack" Panel.ZIndex="4" Canvas.Left="1" Visibility="Collapsed" MouseEnter="xCordsStack_MouseEnter" Background="{StaticResource $BackgroundColor_White}">
<Label x:Name="xXcord" Foreground="{StaticResource $HighlightColor_Purple}" Content="X: 0" FontSize="12" FontWeight="Bold" HorizontalAlignment="Left" />
<Label x:Name="xYcord" Foreground="{StaticResource $HighlightColor_Purple}" Content="Y: 0" FontSize="12" FontWeight="Bold" HorizontalAlignment="Left" />
</StackPanel>
</Canvas>
</DockPanel>
</Grid>

<!--Control buttons-->
<DockPanel Grid.Column="2" Background="Transparent">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Background="{StaticResource $BackgroundColor_White}" >
Expand All @@ -172,16 +170,20 @@
<StackPanel Orientation="Vertical">
<UserControls:ucButton x:Name="xExternalViewBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="ShareExternal" Click="xExternalViewBtn_Click" ToolTip="Open Device External View" Margin="0,0,0,0" Visibility="Collapsed" />
<UserControls:ucButton x:Name="xPinBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Pin" Click="xPinBtn_Click" ToolTip="Dock Window" Margin="0,0,0,0" IsEnabled="False"/>
<Separator Margin="10,0,10,0" Background="LightGray" />
<UserControls:ucButton x:Name="xRefreshButton" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Refresh" Click="xRefreshButton_Click" ToolTip="Refresh Device Screenshot" Margin="0,0,0,0" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xCordBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Target" Click="xCordBtn_Click" ToolTip="Show Mouse Coordinates" Margin="0,0,0,0"/>
<UserControls:ucButton x:Name="xSwipeBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Pointer" Click="xSwipeBtn_Click" ToolTip="Perform Swipe" Margin="0,0,0,0"/>


<UserControls:ucButton x:Name="xClearHighlightBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="Invisible" Click="xClearHighlightsBtn_Click" ToolTip="Clear Highlights" Margin="0,0,0,0"/>
<Separator Margin="10,0,10,0" Background="LightGray" />
<StackPanel Orientation="Vertical" Margin="0,0,0,0">
<UserControls:ucButton x:Name="xZoomInBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="Add" Click="xZoomInBtn_Click" ToolTip="Zoom In" Margin="0,0,0,0"/>
<UserControls:ucButton x:Name="xZoomOutBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="DeleteSingle" Click="xZoomOutBtn_Click" ToolTip="Zoom Out" Margin="0,0,0,0"/>
<UserControls:ucButton x:Name="xZoomInBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="Add" Click="xZoomInBtn_Click" ToolTip="Zoom In" Margin="0,0,0,-10"/>
<Label x:Name="xZoomSizeLbl" Content="25%" FontSize="9" Foreground="Gray"/>
<UserControls:ucButton x:Name="xZoomOutBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="DeleteSingle" Click="xZoomOutBtn_Click" ToolTip="Zoom Out" Margin="0,-10,0,0"/>
</StackPanel>
<Separator Margin="10,0,10,0" Background="LightGray" />
<UserControls:ucButton x:Name="xMetricsBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Graph" Click="xMetricsBtn_Click" ToolTip="Show Device Details &amp; Metrics" Margin="0,0,0,0" />
<UserControls:ucButton x:Name="xConfigurationsBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Config" Click="xConfigurationsBtn_Click" ToolTip="Mobile View Configurations" Margin="0,0,0,0" />
</StackPanel>
Expand All @@ -204,6 +206,7 @@
</UserControls:ucButton.RenderTransform>
</UserControls:ucButton>
<UserControls:ucButton x:Name="xDeviceSettingsBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Parameter" Click="xDeviceSettingsBtn_Click" ToolTip="Open Device Settings" Margin="0,0,0,0"/>
<Separator Margin="10,0,10,0" Background="LightGray" />
<UserControls:ucButton x:Name="xBackButton" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="GoBack" Click="xBackBtn_Click" ToolTip="Back" Margin="0,0,0,0"/>
<UserControls:ucButton x:Name="xHomeBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Home" Click="xHomeBtn_Click" ToolTip="Home" Margin="0,0,0,0"/>
<UserControls:ucButton x:Name="xMenuBtn" ButtonType="ImageButton" HorizontalAlignment="Center" VerticalAlignment="Center" ButtonFontImageSize="14" ButtonImageType="Copy" Click="xMenuBtn_Click" ToolTip="Switch App" Margin="0,0,0,0"/>
Expand Down
Loading

0 comments on commit fcd6097

Please sign in to comment.