Skip to content

Commit 4f09c9e

Browse files
committed
"Finish" redesign of AddContactPage
It looks kind of jank but it's way better
1 parent dfb34bf commit 4f09c9e

File tree

7 files changed

+252
-128
lines changed

7 files changed

+252
-128
lines changed

Signal-Windows/Controls/AddContactListElement.xaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@
1313
<Grid.ColumnDefinitions>
1414
<ColumnDefinition Width="Auto" />
1515
<ColumnDefinition Width="*" />
16+
<ColumnDefinition Width="Auto" />
1617
</Grid.ColumnDefinitions>
1718
<Ellipse Grid.Column="0" Width="64" Height="64" Margin="8">
1819
<Ellipse.Fill>
19-
<ImageBrush ImageSource="{x:Bind ContactPhoto}"/>
20+
<ImageBrush ImageSource="{x:Bind ContactPhoto, Mode=OneWay}"/>
2021
</Ellipse.Fill>
2122
</Ellipse>
2223
<StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="0,0,8,0">
23-
<TextBlock Grid.Column="0" Name="ConversationDisplayName" FontSize="24" FontWeight="SemiLight" Text="{x:Bind DisplayName}" TextTrimming="CharacterEllipsis"/>
24-
<TextBlock Text="{x:Bind PhoneNumber}" FontSize="20"/>
24+
<TextBlock Grid.Column="0" Name="ConversationDisplayName" FontSize="24" FontWeight="SemiLight" Text="{x:Bind DisplayName, Mode=OneWay}" TextTrimming="CharacterEllipsis"/>
25+
<TextBlock Text="{x:Bind PhoneNumber, Mode=OneWay}" FontSize="20"/>
2526
</StackPanel>
27+
<SymbolIcon Grid.Column="2" Symbol="Message" Margin="0,0,8,0" Foreground="#FF2190EA" Visibility="{x:Bind OnSignal, Mode=OneWay}"/>
2628
</Grid>
2729
</UserControl>

Signal-Windows/Controls/AddContactListElement.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ public ImageSource ContactPhoto
6262
}
6363
}
6464

65+
public bool _OnSignal;
66+
public bool OnSignal
67+
{
68+
get { return _OnSignal; }
69+
set
70+
{
71+
_OnSignal = value;
72+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(OnSignal)));
73+
}
74+
}
75+
6576
public PhoneContact Model
6677
{
6778
get
@@ -82,6 +93,7 @@ private void AddContactListElement_DataContextChanged(FrameworkElement sender, D
8293
DisplayName = Model.Name;
8394
PhoneNumber = Model.PhoneNumber;
8495
ContactPhoto = Model.Photo;
96+
OnSignal = Model.OnSignal;
8597
}
8698
}
8799
}

Signal-Windows/Models/PhoneContact.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class PhoneContact
1313
public string Name { get; set; }
1414
public string PhoneNumber { get; set; }
1515
public ImageSource Photo { get; set; }
16+
public bool OnSignal { get; set; }
1617
public AddContactListElement View;
1718
}
1819
}

Signal-Windows/Utils.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace Signal_Windows
1414
{
15-
public class Utils
15+
public static class Utils
1616
{
1717
public static string[] Colors = {
1818
"red",
@@ -153,12 +153,17 @@ public static PageStyle GetViewStyle(Size s)
153153
}
154154
}
155155

156-
private string GetCountryCode()
156+
public static string GetCountryCode()
157157
{
158158
var c = CultureInfo.CurrentCulture.TwoLetterISOLanguageName;
159159
return GetCountryCode(c.ToUpper());
160160
}
161161

162+
public static bool ContainsCaseInsensitive(this string str, string value)
163+
{
164+
return CultureInfo.InvariantCulture.CompareInfo.IndexOf(str, value, CompareOptions.IgnoreCase) >= 0;
165+
}
166+
162167
public static string GetCountryCode(string ISO3166) //https://stackoverflow.com/questions/34837436/uwp-get-country-phone-number-prefix
163168
{
164169
var dictionary = new Dictionary<string, string>();

0 commit comments

Comments
 (0)