Icon work - and apptheming
This commit is contained in:
@@ -3,19 +3,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="WebViewDemo.WebViewPage"
|
||||
Title="WebView Demo"
|
||||
BackgroundColor="#F5F7FA">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<Color x:Key="PrimaryColor">#5C6BC0</Color>
|
||||
<Color x:Key="PrimaryDark">#3949AB</Color>
|
||||
<Color x:Key="AccentColor">#26A69A</Color>
|
||||
<Color x:Key="ButtonColor">#667EEA</Color>
|
||||
<Color x:Key="TextPrimary">#212121</Color>
|
||||
<Color x:Key="TextSecondary">#757575</Color>
|
||||
<Color x:Key="CardBackground">#FFFFFF</Color>
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource PageBackgroundLight}, Dark={StaticResource PageBackgroundDark}}">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,*,Auto,Auto" Padding="16" RowSpacing="12">
|
||||
|
||||
@@ -29,44 +17,44 @@
|
||||
|
||||
<!-- Navigation Bar -->
|
||||
<Border Grid.Row="1"
|
||||
BackgroundColor="{StaticResource CardBackground}"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
||||
StrokeThickness="0"
|
||||
Padding="12">
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="8" />
|
||||
</Border.StrokeShape>
|
||||
|
||||
<HorizontalStackLayout Spacing="8" HorizontalOptions="Center">
|
||||
<Button x:Name="BackButton"
|
||||
Text="Back"
|
||||
WidthRequest="70"
|
||||
HeightRequest="36"
|
||||
FontSize="13"
|
||||
BackgroundColor="{StaticResource ButtonColor}"
|
||||
TextColor="White"
|
||||
Clicked="OnBackClicked" />
|
||||
<Button x:Name="ForwardButton"
|
||||
Text="Forward"
|
||||
WidthRequest="80"
|
||||
HeightRequest="36"
|
||||
FontSize="13"
|
||||
BackgroundColor="{StaticResource ButtonColor}"
|
||||
TextColor="White"
|
||||
Clicked="OnForwardClicked" />
|
||||
<Button x:Name="ReloadButton"
|
||||
Text="Reload"
|
||||
WidthRequest="70"
|
||||
HeightRequest="36"
|
||||
FontSize="13"
|
||||
BackgroundColor="{StaticResource ButtonColor}"
|
||||
TextColor="White"
|
||||
Clicked="OnReloadClicked" />
|
||||
<HorizontalStackLayout Spacing="12" HorizontalOptions="Center">
|
||||
<ImageButton x:Name="BackButton"
|
||||
Source="{AppThemeBinding Light=arrow_back_light.svg, Dark=arrow_back_dark.svg}"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Padding="10"
|
||||
BackgroundColor="{StaticResource ButtonColor}"
|
||||
CornerRadius="8"
|
||||
Clicked="OnBackClicked" />
|
||||
<ImageButton x:Name="ForwardButton"
|
||||
Source="{AppThemeBinding Light=arrow_forward_light.svg, Dark=arrow_forward_dark.svg}"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Padding="10"
|
||||
BackgroundColor="{StaticResource ButtonColor}"
|
||||
CornerRadius="8"
|
||||
Clicked="OnForwardClicked" />
|
||||
<ImageButton x:Name="ReloadButton"
|
||||
Source="{AppThemeBinding Light=refresh_light.svg, Dark=refresh_dark.svg}"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Padding="10"
|
||||
BackgroundColor="{StaticResource ButtonColor}"
|
||||
CornerRadius="8"
|
||||
Clicked="OnReloadClicked" />
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
|
||||
<!-- URL Bar -->
|
||||
<Border Grid.Row="2"
|
||||
BackgroundColor="{StaticResource CardBackground}"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
||||
StrokeThickness="0"
|
||||
Padding="12">
|
||||
<Border.StrokeShape>
|
||||
@@ -79,25 +67,27 @@
|
||||
Placeholder="Enter URL..."
|
||||
Text="https://dotnet.microsoft.com"
|
||||
FontSize="14"
|
||||
TextColor="{AppThemeBinding Light={StaticResource TextPrimaryLight}, Dark={StaticResource TextPrimaryDark}}"
|
||||
PlaceholderColor="{AppThemeBinding Light={StaticResource TextSecondaryLight}, Dark={StaticResource TextSecondaryDark}}"
|
||||
VerticalOptions="Center"
|
||||
Completed="OnUrlSubmitted" />
|
||||
<Button x:Name="GoButton"
|
||||
Grid.Column="1"
|
||||
Text="Go"
|
||||
WidthRequest="60"
|
||||
HeightRequest="36"
|
||||
FontSize="13"
|
||||
BackgroundColor="{StaticResource AccentColor}"
|
||||
TextColor="White"
|
||||
Clicked="OnGoClicked" />
|
||||
<ImageButton x:Name="GoButton"
|
||||
Grid.Column="1"
|
||||
Source="{AppThemeBinding Light=send_light.svg, Dark=send_dark.svg}"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Padding="10"
|
||||
BackgroundColor="{StaticResource AccentColor}"
|
||||
CornerRadius="8"
|
||||
Clicked="OnGoClicked" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- WebView -->
|
||||
<Border Grid.Row="3"
|
||||
BackgroundColor="{StaticResource CardBackground}"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
||||
StrokeThickness="1"
|
||||
Stroke="#E0E0E0">
|
||||
Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}">
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="8" />
|
||||
</Border.StrokeShape>
|
||||
@@ -111,36 +101,36 @@
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<Border Grid.Row="4"
|
||||
BackgroundColor="{StaticResource CardBackground}"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource CardBackgroundLight}, Dark={StaticResource CardBackgroundDark}}"
|
||||
StrokeThickness="0"
|
||||
Padding="12">
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="8" />
|
||||
</Border.StrokeShape>
|
||||
|
||||
<HorizontalStackLayout Spacing="8" HorizontalOptions="Center">
|
||||
<Button x:Name="LoadHtmlButton"
|
||||
Text="Load HTML"
|
||||
WidthRequest="110"
|
||||
HeightRequest="36"
|
||||
FontSize="13"
|
||||
BackgroundColor="{StaticResource PrimaryColor}"
|
||||
TextColor="White"
|
||||
Clicked="OnLoadHtmlClicked" />
|
||||
<Button x:Name="EvalJsButton"
|
||||
Text="Run JS"
|
||||
WidthRequest="90"
|
||||
HeightRequest="36"
|
||||
FontSize="13"
|
||||
BackgroundColor="{StaticResource PrimaryColor}"
|
||||
TextColor="White"
|
||||
Clicked="OnEvalJsClicked" />
|
||||
<HorizontalStackLayout Spacing="12" HorizontalOptions="Center">
|
||||
<ImageButton x:Name="LoadHtmlButton"
|
||||
Source="{AppThemeBinding Light=code_light.svg, Dark=code_dark.svg}"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Padding="10"
|
||||
BackgroundColor="{StaticResource PrimaryColor}"
|
||||
CornerRadius="8"
|
||||
Clicked="OnLoadHtmlClicked" />
|
||||
<ImageButton x:Name="EvalJsButton"
|
||||
Source="{AppThemeBinding Light=play_arrow_light.svg, Dark=play_arrow_dark.svg}"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Padding="10"
|
||||
BackgroundColor="{StaticResource PrimaryColor}"
|
||||
CornerRadius="8"
|
||||
Clicked="OnEvalJsClicked" />
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
|
||||
<!-- Status Bar -->
|
||||
<Border Grid.Row="5"
|
||||
BackgroundColor="{StaticResource PrimaryDark}"
|
||||
BackgroundColor="{StaticResource PrimaryDarkColor}"
|
||||
StrokeThickness="0"
|
||||
Padding="12,8">
|
||||
<Border.StrokeShape>
|
||||
|
||||
Reference in New Issue
Block a user