This commit is contained in:
Trevi Awater
2026-04-02 12:26:07 +02:00
parent 528a8ba3a3
commit b709c7b5ce
6 changed files with 25 additions and 53 deletions

View File

@@ -114,35 +114,11 @@ namespace Xamarin.Neo4j.iOS.CustomRenderers
scrollView.BottomAnchor.ConstraintEqualTo(pillContainer.BottomAnchor),
});
// Execute button — blue pill
var executeBtn = new UIButton(UIButtonType.System);
executeBtn.TranslatesAutoresizingMaskIntoConstraints = false;
executeBtn.SetTitle("Execute", UIControlState.Normal);
executeBtn.SetTitleColor(UIColor.White, UIControlState.Normal);
executeBtn.BackgroundColor = UIColor.SystemBlue;
executeBtn.Layer.CornerRadius = pillHeight / 2f;
executeBtn.Layer.MasksToBounds = true;
executeBtn.TouchUpInside += (s, e) =>
{
if (VirtualView is QueryEditor queryEditor)
{
queryEditor.RaiseExecuteClicked();
platformView.ResignFirstResponder();
}
};
accessoryView.AddSubview(pillContainer);
accessoryView.AddSubview(executeBtn);
NSLayoutConstraint.ActivateConstraints(new[]
{
executeBtn.TrailingAnchor.ConstraintEqualTo(accessoryView.TrailingAnchor, -padding),
executeBtn.CenterYAnchor.ConstraintEqualTo(accessoryView.CenterYAnchor),
executeBtn.HeightAnchor.ConstraintEqualTo(pillHeight),
executeBtn.WidthAnchor.ConstraintEqualTo(executeButtonWidth),
pillContainer.LeadingAnchor.ConstraintEqualTo(accessoryView.LeadingAnchor, padding),
pillContainer.TrailingAnchor.ConstraintEqualTo(executeBtn.LeadingAnchor, -padding),
pillContainer.CenterYAnchor.ConstraintEqualTo(accessoryView.CenterYAnchor),
pillContainer.HeightAnchor.ConstraintEqualTo(pillHeight),
});
@@ -172,6 +148,9 @@ namespace Xamarin.Neo4j.iOS.CustomRenderers
{
var text = PreprocessText(platformView.Text ?? string.Empty);
var attributedText = new NSMutableAttributedString(text);
attributedText.AddAttribute(UIStringAttributeKey.ForegroundColor,
UIColor.Label,
new NSRange(0, text.Length));
foreach (var word in wordsToHighlight)
{

View File

@@ -24,7 +24,7 @@
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="1038"/>
<color key="backgroundColor" red="0.19136750699999999" green="0.2006954849" blue="0.2327556908" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.047058823529" green="0.047058823529" blue="0.047058823529" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="198" firstAttribute="centerX" secondItem="1038" secondAttribute="centerX" id="201"/>
<constraint firstItem="1038" firstAttribute="centerY" secondItem="198" secondAttribute="centerY" id="203"/>

View File

@@ -56,7 +56,7 @@
</Grid>
</StackLayout>
<Button Text="Test" BackgroundColor="Transparent" TextColor="{DynamicResource SecondaryTextColor}" BorderColor="{DynamicResource SecondaryTextColor}" BorderWidth="1" Command="{Binding Commands[Test]}" />
<Button Text="Test" BackgroundColor="Transparent" TextColor="{DynamicResource PrimaryTextColor}" BorderColor="{DynamicResource PrimaryTextColor}" BorderWidth="1" Command="{Binding Commands[Test]}" />
<Button Text="Connect" BackgroundColor="Transparent" TextColor="{DynamicResource PrimaryTextColor}" BorderColor="{DynamicResource PrimaryTextColor}" BorderWidth="1" Command="{Binding Commands[Connect]}" />
<Button Text="Save" BackgroundColor="{DynamicResource Accent}" TextColor="{DynamicResource QueryTextBackground}" Command="{Binding Commands[Save]}" />
</StackLayout>

View File

@@ -7,38 +7,31 @@
x:Name="connectionsPage"
Title=" ">
<NavigationPage.TitleView>
<StackLayout Orientation="Horizontal" Spacing="8" VerticalOptions="Center" HorizontalOptions="Start" Padding="4,0,0,0">
<Label Text="{x:Static fonts:FontAwesomeSolid.ProjectDiagram}"
FontFamily="{StaticResource FontAwesomeSolid}"
FontSize="18"
TextColor="White"
VerticalOptions="Center" />
<Label Text="PocketGraph"
FontSize="18" FontAttributes="Bold"
TextColor="White"
VerticalOptions="Center" />
</StackLayout>
</NavigationPage.TitleView>
<ContentPage.ToolbarItems>
<ToolbarItem Text="Settings" Order="Secondary" Command="{Binding Commands[OpenSettings]}" />
</ContentPage.ToolbarItems>
<ContentPage.Content>
<Grid RowDefinitions="Auto,*">
<!-- Row 0: Dashboard header -->
<StackLayout Grid.Row="0" Spacing="4" Padding="16,16,16,12" HorizontalOptions="Center">
<Label Text="{x:Static fonts:FontAwesomeSolid.ProjectDiagram}"
FontFamily="{StaticResource FontAwesomeSolid}"
FontSize="32"
TextColor="{DynamicResource PrimaryTextColor}"
HorizontalOptions="Center"
Margin="0,0,0,4" />
<Label Text="PocketGraph"
FontSize="22" FontAttributes="Bold"
TextColor="{DynamicResource PrimaryTextColor}"
HorizontalOptions="Center" />
<Label Text="{Binding ConnectionCountLabel}"
FontSize="13"
TextColor="{DynamicResource SecondaryTextColor}"
HorizontalOptions="Center" />
</StackLayout>
<!-- Row 1: Connection cards + empty state + FAB -->
<Grid Grid.Row="1">
<Grid>
<!-- Scrollable connection cards -->
<ScrollView IsVisible="{Binding HasItems}">
<StackLayout BindableLayout.ItemsSource="{Binding ConnectionStrings}"
Spacing="0" Padding="0,0,0,80">
Spacing="0" Padding="0,16,0,80">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Border Margin="16,0,16,8"
@@ -155,8 +148,6 @@
VerticalOptions="End" HorizontalOptions="End"
Margin="0,0,16,16"
Command="{Binding Commands[AddConnection]}" />
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>

View File

@@ -178,7 +178,7 @@
</Border>
</StackLayout>
<!-- Footer — at end of scroll -->
<!-- Footer -->
<StackLayout Spacing="15" Padding="9,16,9,32">
<Label Text="A product of" HorizontalOptions="Center" FontAttributes="Italic" FontSize="12"
TextColor="{DynamicResource SecondaryTextColor}" />

View File

@@ -150,6 +150,7 @@
/* JSON view */
.json-view-wrapper {
position: relative;
overflow: visible;
}
.json-view-wrapper pre {
background: {{borderColor}};
@@ -157,7 +158,7 @@
font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
font-size: 12px;
line-height: 1.5;
padding: 12px;
padding: 36px 12px 12px 12px;
border-radius: 8px;
overflow: auto;
max-height: 40vh;
@@ -169,6 +170,7 @@
position: absolute;
top: 8px;
right: 8px;
z-index: 10;
width: 28px;
height: 28px;
border: none;