Skip to content

Commit 8ac1bfd

Browse files
committed
Start redesigning MainPage
1 parent c151c3a commit 8ac1bfd

File tree

6 files changed

+73
-42
lines changed

6 files changed

+73
-42
lines changed

Signal-Windows/Assets/gambino.png

480 KB
Loading

Signal-Windows/Controls/ConversationListElement.xaml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,28 @@
66
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
88
mc:Ignorable="d"
9-
d:DesignHeight="300"
10-
d:DesignWidth="400">
11-
<Grid Padding="0 10 0 10">
9+
d:DesignHeight="96"
10+
d:DesignWidth="480">
11+
<Grid>
1212
<Grid.ColumnDefinitions>
13+
<ColumnDefinition Width="Auto" />
1314
<ColumnDefinition Width="*" />
14-
<ColumnDefinition Width="auto" />
1515
</Grid.ColumnDefinitions>
16-
<Grid.RowDefinitions>
17-
<RowDefinition Height="Auto" />
18-
<RowDefinition Height="Auto" />
19-
</Grid.RowDefinitions>
20-
<TextBlock Grid.Column="0" Name="ConversationDisplayName" FontSize="18" />
21-
<TextBlock Grid.Column="1" Text="{x:Bind UnreadString, Mode=OneWay}" />
22-
<TextBlock Grid.Row="1" Text="{x:Bind LastMessage, Mode=OneWay}" />
16+
<Ellipse Grid.Column="0" Width="64" Height="64" Margin="8">
17+
<Ellipse.Fill>
18+
<ImageBrush ImageSource="ms-appx:///Assets/gambino.png"/>
19+
</Ellipse.Fill>
20+
</Ellipse>
21+
<StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="0,0,8,0">
22+
<Grid>
23+
<Grid.ColumnDefinitions>
24+
<ColumnDefinition Width="*"/>
25+
<ColumnDefinition Width="Auto"/>
26+
</Grid.ColumnDefinitions>
27+
<TextBlock Grid.Column="0" Name="ConversationDisplayName" FontSize="24" FontWeight="SemiLight" Text="Sanders Lauture"/>
28+
<TextBlock x:Name="LastActiveTextBlock" Grid.Column="1" Text="11:11p" FontSize="11" Foreground="#999999"/>
29+
</Grid>
30+
<TextBlock Text="{x:Bind LastMessage, Mode=OneWay}" FontSize="20"/>
31+
</StackPanel>
2332
</Grid>
2433
</UserControl>

Signal-Windows/Controls/Welcome.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
d:DesignWidth="400">
1111

1212
<Grid>
13-
<TextBlock HorizontalAlignment="Center" Padding="0 0 14 0">Select a contact and go!</TextBlock>
13+
<Image Source="ms-appx:///Assets/logo-idea-2.png" Width="256"/>
1414
</Grid>
1515
</UserControl>

Signal-Windows/Signal-Windows.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
<None Include="project.json" />
9898
<Content Include="Assets\check.png" />
9999
<Content Include="Assets\double-check.png" />
100+
<Content Include="Assets\gambino.png" />
100101
<Content Include="Assets\LargeTile.scale-100.png" />
101102
<Content Include="Assets\LargeTile.scale-125.png" />
102103
<Content Include="Assets\LargeTile.scale-150.png" />

Signal-Windows/Views/MainPage.xaml

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,48 @@
1010
mc:Ignorable="d"
1111
DataContext="{Binding MainPageInstance, Source={StaticResource Locator}}">
1212

13-
<SplitView Name="MainPanel" CompactPaneLength="0" OpenPaneLength="640">
13+
<Page.Resources>
14+
<ResourceDictionary>
15+
<ResourceDictionary.ThemeDictionaries>
16+
<ResourceDictionary x:Key="Default">
17+
<Color x:Key="SystemAltHighColor">#2190EA</Color>
18+
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="{ThemeResource SystemAltHighColor}" />
19+
</ResourceDictionary>
20+
<ResourceDictionary x:Key="Dark">
21+
<Color x:Key="SystemAltHighColor">#2190EA</Color>
22+
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="{ThemeResource SystemAltHighColor}" />
23+
</ResourceDictionary>
24+
</ResourceDictionary.ThemeDictionaries>
25+
</ResourceDictionary>
26+
</Page.Resources>
27+
<SplitView Name="MainPanel" CompactPaneLength="0" OpenPaneLength="480">
1428
<SplitView.Pane>
15-
<ScrollViewer Name="ContactsPanelScrollViewer" HorizontalAlignment="Left" MaxWidth="640" Padding="0 0 15 0">
16-
<StackPanel>
17-
<SymbolIcon Symbol="AddFriend" HorizontalAlignment="Right" Name="AddFriendSymbol" Tapped="AddFriendSymbol_Tapped" Margin="0 0 0 5" />
18-
<ListView Name="ContactsList" ItemsSource="{x:Bind Vm.Threads}" SelectionMode="Single" SelectionChanged="ContactsList_SelectionChanged">
19-
<ListView.ItemContainerStyle>
20-
<Style TargetType="ListViewItem">
21-
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
22-
</Style>
23-
</ListView.ItemContainerStyle>
24-
<ListView.ItemTemplate>
25-
<DataTemplate>
26-
<controls:ConversationListElement />
27-
</DataTemplate>
28-
</ListView.ItemTemplate>
29-
</ListView>
30-
</StackPanel>
31-
</ScrollViewer>
29+
<Grid x:Name="ContactsGrid">
30+
<Grid.RowDefinitions>
31+
<RowDefinition Height="Auto"/>
32+
<RowDefinition Height="Auto"/>
33+
<RowDefinition Height="*"/>
34+
</Grid.RowDefinitions>
35+
<TextBlock Grid.Row="0" Text="Signal" FontSize="34" FontWeight="Light" Margin="0,16" HorizontalAlignment="Center" Foreground="{ThemeResource ApplicationPageBackgroundThemeBrush}"/>
36+
<Button x:Name="AddContactButton" Grid.Row="0" HorizontalAlignment="Right" Background="{x:Null}" Click="AddContactButton_Click">
37+
<TextBlock Text="+" FontSize="34" FontWeight="Light" Foreground="{ThemeResource ApplicationPageBackgroundThemeBrush}"/>
38+
</Button>
39+
<AutoSuggestBox Grid.Row="1" Margin="16"/>
40+
<ListView Grid.Row="2" Name="ContactsList" ItemsSource="{x:Bind Vm.Threads}" SelectionMode="Single" SelectionChanged="ContactsList_SelectionChanged">
41+
<ListView.ItemContainerStyle>
42+
<Style TargetType="ListViewItem">
43+
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
44+
</Style>
45+
</ListView.ItemContainerStyle>
46+
<ListView.ItemTemplate>
47+
<DataTemplate>
48+
<controls:ConversationListElement />
49+
</DataTemplate>
50+
</ListView.ItemTemplate>
51+
</ListView>
52+
</Grid>
3253
</SplitView.Pane>
33-
<Grid>
54+
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
3455
<controls:Welcome Grid.Row="0" Visibility="{x:Bind Vm.WelcomeVisibility, Mode=OneWay}" />
3556
<controls:Conversation Grid.Row="0" Visibility="{x:Bind Vm.ThreadVisibility, Mode=OneWay}" x:Name="ThreadView" />
3657
</Grid>

Signal-Windows/Views/MainPage.xaml.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void SwitchToStyle(PageStyle newStyle)
4343
{
4444
if (newStyle == PageStyle.Narrow)
4545
{
46-
ContactsPanelScrollViewer.Width = ActualWidth;
46+
ContactsGrid.Width = ActualWidth;
4747
if (Vm.SelectedThread != null)
4848
{
4949
Utils.EnableBackButton(Vm.BackButton_Click);
@@ -60,7 +60,7 @@ public void SwitchToStyle(PageStyle newStyle)
6060
{
6161
Utils.DisableBackButton(Vm.BackButton_Click);
6262
MainPanel.IsPaneOpen = false;
63-
MainPanel.CompactPaneLength = ContactsPanelScrollViewer.Width = 180;
63+
MainPanel.CompactPaneLength = ContactsGrid.Width = 480;
6464
}
6565
}
6666

@@ -85,7 +85,7 @@ private void Frame_SizeChanged(object sender, SizeChangedEventArgs e)
8585
}
8686
if (newStyle == PageStyle.Narrow)
8787
{
88-
ContactsPanelScrollViewer.Width = ActualWidth;
88+
ContactsGrid.Width = ActualWidth;
8989
}
9090
}
9191

@@ -110,14 +110,6 @@ private void ContactsList_SelectionChanged(object sender, SelectionChangedEventA
110110
Vm.ContactsList_SelectionChanged(sender, e);
111111
}
112112

113-
private void AddFriendSymbol_Tapped(object sender, TappedRoutedEventArgs e)
114-
{
115-
App.ViewModels.AddContactPageInstance.MainPageVM = Vm;
116-
App.ViewModels.AddContactPageInstance.ContactName = "";
117-
App.ViewModels.AddContactPageInstance.ContactNumber = "";
118-
Frame.Navigate(typeof(AddContactPage));
119-
}
120-
121113
public static async Task NotifyNewIdentity(string user)
122114
{
123115
var title = "Safety Numbers Change";
@@ -138,5 +130,13 @@ public void ReselectTop()
138130
{
139131
ContactsList.SelectedIndex = 0;
140132
}
133+
134+
private void AddContactButton_Click(object sender, RoutedEventArgs e)
135+
{
136+
App.ViewModels.AddContactPageInstance.MainPageVM = Vm;
137+
App.ViewModels.AddContactPageInstance.ContactName = "";
138+
App.ViewModels.AddContactPageInstance.ContactNumber = "";
139+
Frame.Navigate(typeof(AddContactPage));
140+
}
141141
}
142142
}

0 commit comments

Comments
 (0)