Skip to content

Commit

Permalink
UI improvements and optimizations; EncryptedList optimized;
Browse files Browse the repository at this point in the history
  • Loading branch information
Admin authored and Admin committed Aug 8, 2018
1 parent e616240 commit e7e76d0
Show file tree
Hide file tree
Showing 151 changed files with 386 additions and 349 deletions.
6 changes: 3 additions & 3 deletions Lazurite/Lazurite.MainDomain/MessageSecurity/EncryptedList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Lazurite.MainDomain.MessageSecurity
public class EncryptedList<T>
{
[DataMember]
public List<Encrypted<T>> SourceList { get; set; } = new List<Encrypted<T>>();
public Encrypted<List<T>> SourceList { get; set; } = new Encrypted<List<T>>();

[DataMember]
public DateTime ServerTime { get; set; }
Expand All @@ -21,12 +21,12 @@ public EncryptedList()

public EncryptedList(IEnumerable<T> objs, string secretKey) : this()
{
SourceList.AddRange(objs.Select(x => new Encrypted<T>(x, secretKey, true)));
SourceList = new Encrypted<List<T>>(objs.ToList(), secretKey);
}

public List<T> Decrypt(string secretKey)
{
return SourceList.Select(x => x.Decrypt(secretKey)).ToList();
return SourceList.Decrypt(secretKey);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Lazurite.Logging;
using PCLCrypto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static PCLCrypto.WinRTCrypto;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionName="First" package="lazurite.lazurite" android:versionCode="154">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionName="First" package="lazurite.lazurite" android:versionCode="162">
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="26" />
<application android:label="Lazurite" android:icon="@drawable/splashscreen"></application>
<receiver android:name=".StartLazuriteServiceReceiver" android:enabled="true" android:exported="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<ContentView WidthRequest="40" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="LazuriteMobile.App.Common.ScaleView">
<Grid>
<Grid BackgroundColor="Gray" VerticalOptions="FillAndExpand" HorizontalOptions="End" WidthRequest="4" Opacity="0.2"></Grid>
<Grid x:Name="gridValue" WidthRequest="4" VerticalOptions="End" HorizontalOptions="End" BackgroundColor="#87CEFA"></Grid>
<Grid x:Name="gridValue" WidthRequest="4" VerticalOptions="End" HorizontalOptions="End" BackgroundColor="MediumOrchid"></Grid>
</Grid>
</ContentView>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private void RefreshScale()
if (percent < 0.25)
gridValue.BackgroundColor = Color.Gray;
else if (percent >= 0.25 && percent < 0.9)
gridValue.BackgroundColor = Color.FromHex("5090B4");
gridValue.BackgroundColor = Color.MediumOrchid;
else
gridValue.BackgroundColor = Color.Red;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:controls="clr-namespace:LazuriteMobile.App.Controls"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
BackgroundColor="Black"
BackgroundColor="{Static controls:Visual.BackgroundLazurite}"
x:Class="LazuriteMobile.App.Common.SliderMenu">
<ContentView x:Name="contentView" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></ContentView>
</Grid>
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ public SliderTabsView()

public void AddTabInfo(TabInfo info)
{
var itemView = new ItemView();
itemView.Icon = info.Icon;
itemView.HeightRequest = itemView.WidthRequest = 45;
itemView.BackgroundColor = Color.Transparent;
var itemView = new ItemView() {
Opacity = 0.71,
Icon = info.Icon,
HeightRequest = 45,
WidthRequest = 45,
BackgroundColor = Color.Transparent
};
itemView.Clicked += (o, e) => info.Menu.Show();
stackPanel.Children.Add(itemView);
_tabs.Add(info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
x:Class="LazuriteMobile.App.Controls.ItemView">
<Grid x:Name="backGrid" InputTransparent="True" VerticalOptions="Fill" HorizontalOptions="Fill" BackgroundColor="{Static local:Visual.ItemSelection}" Opacity="0"></Grid>
<Button Opacity="0" Margin="0" BorderColor="Transparent" BorderRadius="0" BorderWidth="0" x:Name="button" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" BackgroundColor="Transparent" Clicked="Button_Clicked" ></Button>
<local:IconView HeightRequest="35" WidthRequest="35" HorizontalOptions="Start" InputTransparent="True" VerticalOptions="Center" x:Name="iconView" x:FieldModifier="private" Icon="AdobeAcrobat" IsVisible="{Binding IconVisibility}" Margin="4"></local:IconView>
<Label x:Name="label" InputTransparent="True" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" BackgroundColor="Transparent"></Label>
<local:IconView Opacity="0.64" HeightRequest="35" WidthRequest="35" HorizontalOptions="Start" InputTransparent="True" VerticalOptions="Center" x:Name="iconView" x:FieldModifier="private" Icon="AdobeAcrobat" IsVisible="{Binding IconVisibility}" Margin="4"></local:IconView>
<Label FontFamily="{Static local:Visual.FontFamily}" x:Name="label" InputTransparent="True" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" BackgroundColor="Transparent"></Label>
<Grid HeightRequest="3" Opacity="0" VerticalOptions="End" HorizontalOptions="FillAndExpand" BackgroundColor="DarkOrchid" x:Name="strokeGrid"></Grid>
</Grid>
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms;

namespace LazuriteMobile.App.Controls
{
public static class Visual
{
public static readonly Color ItemBackground = Color.FromRgb(37, 37, 45);
public static readonly Color ItemSelection = Color.SteelBlue;
public static readonly Color ItemSelection = Color.SlateBlue;
public static readonly Color BrightItemBackground = Color.FromRgb(60, 60, 68);
public static readonly Color Background = Color.FromRgb(26, 26, 34);
public static readonly Color BackgroundLazurite = Color.FromRgb(29, 25, 39);
public static readonly Color CaptionForeground = Color.SteelBlue;
public static readonly Color Foreground = Color.LightGray;
public static readonly int FontSize = 14;
public static readonly int BigFontSize = 17;
public static readonly Color SwitchBackground = BackgroundLazurite;

public static readonly string FontFamily = "sans-serif-light";

public static readonly Color SwitchBackground = ItemBackground;
public static readonly Color SwitchBackgroundReadonly = Color.FromRgb(0, 49, 83);

public static readonly Color SelectedSwitchBackground = ItemSelection;
public static readonly Color SelectedSwitchBackgroundReadonly = Color.FromRgb(0, 80, 130);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Switches\Bases\SwitchIconView.cs" />
<Compile Include="Switches\Bases\LabelValueView.cs" />
<Compile Include="Switches\Bases\LabelCaptionView.cs" />
<Compile Include="Common\SliderTabsView.xaml.cs">
<DependentUpon>SliderTabsView.xaml</DependentUpon>
</Compile>
<Compile Include="Common\SliderWrapperView.xaml.cs">
<DependentUpon>SliderWrapperView.xaml</DependentUpon>
</Compile>
<Compile Include="Switches\Bases\SwitchBase.cs" />
<Compile Include="Controls\Visual.cs" />
<Compile Include="DeviceDataHandler.cs" />
<Compile Include="GeolocationDataHandler.cs" />
Expand Down Expand Up @@ -93,6 +97,7 @@
<Compile Include="SwitchesGrid.xaml.cs">
<DependentUpon>SwitchesGrid.xaml</DependentUpon>
</Compile>
<Compile Include="Switches\Bases\SwitchItemView.cs" />
<Compile Include="Switches\FloatViewManualSwitch.xaml.cs">
<DependentUpon>FloatViewManualSwitch.xaml</DependentUpon>
</Compile>
Expand All @@ -114,7 +119,6 @@
<Compile Include="Switches\ButtonView.xaml.cs">
<DependentUpon>ButtonView.xaml</DependentUpon>
</Compile>
<Compile Include="Switches\DateTimeValueTypeToSplittedString.cs" />
<Compile Include="Switches\DateTimeView.xaml.cs">
<DependentUpon>DateTimeView.xaml</DependentUpon>
</Compile>
Expand All @@ -130,8 +134,7 @@
<Compile Include="Switches\InfoView.xaml.cs">
<DependentUpon>InfoView.xaml</DependentUpon>
</Compile>
<Compile Include="Switches\StringToSplittedStringShort.cs" />
<Compile Include="Switches\SwitchBottomBorder.xaml.cs">
<Compile Include="Switches\Bases\SwitchBottomBorder.xaml.cs">
<DependentUpon>SwitchBottomBorder.xaml</DependentUpon>
</Compile>
<Compile Include="Switches\SwitchScenarioModel.cs" />
Expand All @@ -142,8 +145,7 @@
<DependentUpon>StatusViewSwitch.xaml</DependentUpon>
</Compile>
<Compile Include="Switches\StringToIcon.cs" />
<Compile Include="Switches\StringToSplittedStringLong.cs" />
<Compile Include="Switches\StringToSplittedString.cs" />
<Compile Include="Switches\StringToShortString.cs" />
<Compile Include="Switches\SwitchesCreator.cs" />
<Compile Include="Switches\ToggleView.xaml.cs">
<DependentUpon>ToggleView.xaml</DependentUpon>
Expand Down Expand Up @@ -374,7 +376,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Switches\SwitchBottomBorder.xaml">
<EmbeddedResource Include="Switches\Bases\SwitchBottomBorder.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
<SubType>Designer</SubType>
</EmbeddedResource>
Expand Down
6 changes: 3 additions & 3 deletions Lazurite/LazuriteMobile.App/LazuriteMobile.App/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
x:Class="LazuriteMobile.App.MainPage">
<Grid x:Name="grid" VerticalOptions="Fill" HorizontalOptions="FillAndExpand">
<app:SwitchesGrid x:Name="swgrid"></app:SwitchesGrid>
<Grid BackgroundColor="Black" x:Name="gridCaption" Opacity="0.9">
<controls:IconView Icon="Lazurite256" VerticalOptions="Center" HorizontalOptions="Center"></controls:IconView>
<Label HorizontalTextAlignment="Center" VerticalOptions="End" TextColor="White" HorizontalOptions="Center" Margin="0,0,0,100" FontSize="Medium" x:Name="lblCaption">Соединение...</Label>
<Grid BackgroundColor="{Static controls:Visual.BackgroundLazurite}" x:Name="gridCaption" Opacity="0.9">
<controls:IconView Icon="Lazurite256" VerticalOptions="Center" HeightRequest="210" WidthRequest="210" HorizontalOptions="Center"></controls:IconView>
<Label HorizontalTextAlignment="Center" VerticalOptions="End" TextColor="{Static controls:Visual.CaptionForeground}" HorizontalOptions="Center" Margin="0,0,0,100" FontSize="Medium" x:Name="lblCaption">Соединение...</Label>
</Grid>
<common:SliderTabsView x:Name="tabsView"></common:SliderTabsView>
<common:SliderMenu x:Name="connectionSettingsSlider">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public void ShowCaption(string text, bool error = false, bool show = true)
if (show)
gridCaption.IsVisible = true;
lblCaption.Text = text;
lblCaption.TextColor = error ? Color.Purple : Color.White;
lblCaption.TextColor = error ? Visual.Foreground : Visual.CaptionForeground;
settingsView.SetErrorMessage(text);
}

Expand Down
13 changes: 8 additions & 5 deletions Lazurite/LazuriteMobile.App/LazuriteMobile.App/MessageView.xaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Grid xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:LazuriteMobile.App.Controls"
x:Class="LazuriteMobile.App.MessageView"
BackgroundColor="#1D191D" HorizontalOptions="FillAndExpand" VerticalOptions="Start" Padding="4">
Margin="2,2,2,0"
BackgroundColor="{Static controls:Visual.ItemBackground}" HorizontalOptions="FillAndExpand" VerticalOptions="Start" Padding="4">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="19"></RowDefinition>
</Grid.RowDefinitions>
<Label Margin="4" VerticalOptions="Center" FontAttributes="Italic" TextColor="SteelBlue" x:Name="lblTitle"></Label>
<Label Margin="4" VerticalOptions="Center" Grid.Row="1" TextColor="SteelBlue" x:Name="lblText"></Label>
<Label Margin="4" VerticalOptions="Center" Grid.Row="2" TextColor="Gray" FontSize="Micro" x:Name="lblDateTime"></Label>
<Label x:Name="lblNew" Grid.Row="0" TextColor="Yellow" FontSize="Large" HorizontalOptions="End">*</Label>
<Label BackgroundColor="{Static controls:Visual.BrightItemBackground}"></Label>
<Label FontFamily="{Static controls:Visual.FontFamily}" Margin="4" VerticalOptions="Center" TextColor="{Static controls:Visual.CaptionForeground}" x:Name="lblTitle"></Label>
<Label FontFamily="{Static controls:Visual.FontFamily}" Margin="4" VerticalOptions="Center" Grid.Row="1" TextColor="{Static controls:Visual.Foreground}" x:Name="lblText"></Label>
<Label FontFamily="{Static controls:Visual.FontFamily}" Margin="4" VerticalOptions="Center" Grid.Row="2" TextColor="Gray" FontSize="Micro" x:Name="lblDateTime"></Label>
<Label FontFamily="{Static controls:Visual.FontFamily}" Margin="0,0,7,0" x:Name="lblNew" Grid.Row="0" TextColor="SteelBlue" FontSize="Large" HorizontalOptions="End" VerticalOptions="Center">*</Label>
</Grid>
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<Grid xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="LazuriteMobile.App.MessagesView" BackgroundColor="Black">
xmlns:controls="clr-namespace:LazuriteMobile.App.Controls"
x:Class="LazuriteMobile.App.MessagesView" BackgroundColor="{Static controls:Visual.Background}">
<ScrollView x:Name="scrollView">
<StackLayout Spacing="2" Orientation="Vertical" x:Name="stackView" BackgroundColor="DarkOrchid" VerticalOptions="StartAndExpand"></StackLayout>
<StackLayout Orientation="Vertical" x:Name="stackView" BackgroundColor="Transparent" VerticalOptions="StartAndExpand"></StackLayout>
</ScrollView>
<Label x:Name="lblEmpty" IsVisible="False" VerticalOptions="Center" HorizontalOptions="Center" TextColor="Orchid">
<Label FontFamily="{Static controls:Visual.FontFamily}" x:Name="lblEmpty" IsVisible="False" VerticalOptions="Center" HorizontalOptions="Center" TextColor="Orchid">
Сообщений пока нет...
</Label>
</Grid>
Loading

0 comments on commit e7e76d0

Please sign in to comment.