1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-12-22 01:53:24 +00:00

Icones bookmarks

This commit is contained in:
Yan Maniez 2018-09-19 13:47:22 +02:00
parent b578967f21
commit f8f43f049f
24 changed files with 196 additions and 41 deletions

View file

@ -224,5 +224,41 @@
<ItemGroup>
<AndroidResource Include="Resources\values\colors.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\plain_arrow_down.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\plain_arrow_up.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\trash_can.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\plain_arrow_down.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\plain_arrow_up.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\trash_can.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\plain_arrow_down.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\plain_arrow_up.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\trash_can.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\plain_arrow_down.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\plain_arrow_up.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\trash_can.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>

View file

@ -2219,26 +2219,26 @@ namespace AideDeJeu.Droid
// aapt resource value: 0x7f020053
public const int avd_hide_password = 2130837587;
// aapt resource value: 0x7f020118
public const int avd_hide_password_1 = 2130837784;
// aapt resource value: 0x7f02011b
public const int avd_hide_password_1 = 2130837787;
// aapt resource value: 0x7f020119
public const int avd_hide_password_2 = 2130837785;
// aapt resource value: 0x7f02011c
public const int avd_hide_password_2 = 2130837788;
// aapt resource value: 0x7f02011a
public const int avd_hide_password_3 = 2130837786;
// aapt resource value: 0x7f02011d
public const int avd_hide_password_3 = 2130837789;
// aapt resource value: 0x7f020054
public const int avd_show_password = 2130837588;
// aapt resource value: 0x7f02011b
public const int avd_show_password_1 = 2130837787;
// aapt resource value: 0x7f02011e
public const int avd_show_password_1 = 2130837790;
// aapt resource value: 0x7f02011c
public const int avd_show_password_2 = 2130837788;
// aapt resource value: 0x7f02011f
public const int avd_show_password_2 = 2130837791;
// aapt resource value: 0x7f02011d
public const int avd_show_password_3 = 2130837789;
// aapt resource value: 0x7f020120
public const int avd_show_password_3 = 2130837792;
// aapt resource value: 0x7f020055
public const int crystal_ball = 2130837589;
@ -2795,11 +2795,11 @@ namespace AideDeJeu.Droid
// aapt resource value: 0x7f02010d
public const int notification_icon_background = 2130837773;
// aapt resource value: 0x7f020116
public const int notification_template_icon_bg = 2130837782;
// aapt resource value: 0x7f020119
public const int notification_template_icon_bg = 2130837785;
// aapt resource value: 0x7f020117
public const int notification_template_icon_low_bg = 2130837783;
// aapt resource value: 0x7f02011a
public const int notification_template_icon_low_bg = 2130837786;
// aapt resource value: 0x7f02010e
public const int notification_tile_bg = 2130837774;
@ -2808,22 +2808,31 @@ namespace AideDeJeu.Droid
public const int notify_panel_notification_icon_bg = 2130837775;
// aapt resource value: 0x7f020110
public const int round_star = 2130837776;
public const int plain_arrow_down = 2130837776;
// aapt resource value: 0x7f020111
public const int settings_knobs = 2130837777;
public const int plain_arrow_up = 2130837777;
// aapt resource value: 0x7f020112
public const int spell_book = 2130837778;
public const int round_star = 2130837778;
// aapt resource value: 0x7f020113
public const int splash = 2130837779;
public const int settings_knobs = 2130837779;
// aapt resource value: 0x7f020114
public const int stars_stack = 2130837780;
public const int spell_book = 2130837780;
// aapt resource value: 0x7f020115
public const int wooden_sign = 2130837781;
public const int splash = 2130837781;
// aapt resource value: 0x7f020116
public const int stars_stack = 2130837782;
// aapt resource value: 0x7f020117
public const int trash_can = 2130837783;
// aapt resource value: 0x7f020118
public const int wooden_sign = 2130837784;
static Drawable()
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -69,21 +69,28 @@ namespace AideDeJeu.Tools
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var level = value as int?;
if(level.HasValue)
try
{
int finallevel = level.Value;
int baselevel = 1;
if(int.TryParse(parameter as string, out baselevel))
var level = value as int?;
if (level.HasValue)
{
finallevel += baselevel;
}
finallevel = Math.Max(1, Math.Min(6, finallevel));
var heading = $"heading{finallevel}";
if (Application.Current.Resources.ContainsKey(heading))
{
return Application.Current.Resources[heading];
int finallevel = level.Value;
int baselevel = 1;
if (int.TryParse(parameter as string, out baselevel))
{
finallevel += baselevel;
}
finallevel = Math.Max(1, Math.Min(6, finallevel));
var heading = $"heading{finallevel}";
if (Application.Current.Resources.ContainsKey(heading))
{
return Application.Current.Resources[heading];
}
}
}
catch(Exception)
{
}
return Application.Current.Resources["paragraph"];
}

View file

@ -22,7 +22,7 @@
<Entry Grid.Column="0" Grid.Row="0" Style="{StaticResource heading1}" HorizontalOptions="FillAndExpand" />
<ListView Grid.Column="0" Grid.Row="1" x:Name="ItemsListView" SelectionMode="None" ItemsSource="{Binding BookmarkCollection}" VerticalOptions="FillAndExpand">
<ListView Grid.Column="0" Grid.Row="1" x:Name="ItemsListView" SelectionMode="None" ItemsSource="{Binding BookmarkCollection}" VerticalOptions="FillAndExpand" HasUnevenRows="true" CachingStrategy="RecycleElement" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
@ -34,7 +34,7 @@
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Text="{Binding Name}" LineBreakMode="WordWrap" Style="{DynamicResource heading3}" FontSize="16" />
<Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Text="{Binding Link}" LineBreakMode="WordWrap" Style="{DynamicResource heading3}" FontSize="12" />
<Button Grid.Column="0" Grid.Row="2" Text="Sypprimer" Command="{Binding BindingContext.RemoveItemCommand, Source={x:Reference This}}" CommandParameter="{Binding}" />
<Button Grid.Column="0" Grid.Row="2" Text="Supprimer" Command="{Binding BindingContext.RemoveItemCommand, Source={x:Reference This}}" CommandParameter="{Binding}" />
<Button Grid.Column="1" Grid.Row="2" Text="Monter" Command="{Binding BindingContext.MoveUpItemCommand, Source={x:Reference This}}" CommandParameter="{Binding}" />
<Button Grid.Column="2" Grid.Row="2" Text="Descendre" Command="{Binding BindingContext.MoveDownItemCommand, Source={x:Reference This}}" CommandParameter="{Binding}" />
</Grid>

View file

@ -9,6 +9,7 @@
<ContentPage.Resources>
<ResourceDictionary>
<tools:IntToBooleanConverter x:Key="IntToBooleanConverter" NonZeroValue="False" NullOrZeroValue="True" />
<tools:HeaderLevelToStyleConverter x:Key="HeaderLevelToStyleConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.ToolbarItems>
@ -29,14 +30,40 @@
<Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" HorizontalOptions="Center" VerticalOptions="Center" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Margin="15,0,15,0" Style="{StaticResource heading3}" Text="Cette liste est vide, ajoutez des éléments à partir de la bibliothèque !" IsVisible="{Binding BookmarkCollection.Count, Converter={StaticResource IntToBooleanConverter}}" />
<ListView Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" x:Name="ItemsListView" ItemsSource="{Binding BookmarkCollection}" VerticalOptions="FillAndExpand" HasUnevenRows="true" CachingStrategy="RecycleElement" SelectedItem="{Binding SelectedItem}" ItemTapped="ItemsListView_ItemTapped">
<ListView Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" x:Name="ItemsListView" SelectionMode="None" ItemsSource="{Binding BookmarkCollection}" VerticalOptions="FillAndExpand" HasUnevenRows="true" CachingStrategy="RecycleElement" SelectedItem="{Binding SelectedItem}" ItemTapped="ItemsListView_ItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="10" Orientation="Vertical">
<Label Text="{Binding Name}" LineBreakMode="WordWrap" Style="{DynamicResource heading3}" FontSize="16" />
<Label Text="{Binding Link}" LineBreakMode="WordWrap" Style="{DynamicResource heading3}" FontSize="12" />
</StackLayout>
<Grid Padding="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding Name}" LineBreakMode="WordWrap" TextColor="{StaticResource HDBlue}" Style="{Binding NameLevel,Converter={StaticResource HeaderLevelToStyleConverter}, ConverterParameter=1}" />
<Image Grid.Column="1" Source="trash_can.png" WidthRequest="32" HeightRequest="32">
<Image.GestureRecognizers>
<TapGestureRecognizer Command="{Binding BindingContext.RemoveItemCommand, Source={x:Reference This}}" CommandParameter="{Binding}" />
</Image.GestureRecognizers>
</Image>
<Image Grid.Column="2" Source="plain_arrow_up.png" WidthRequest="32" HeightRequest="2">
<Image.GestureRecognizers>
<TapGestureRecognizer Command="{Binding BindingContext.MoveUpItemCommand, Source={x:Reference This}}" CommandParameter="{Binding}" />
</Image.GestureRecognizers>
</Image>
<Image Grid.Column="3" Source="plain_arrow_down.png" WidthRequest="32" HeightRequest="32">
<Image.GestureRecognizers>
<TapGestureRecognizer Command="{Binding BindingContext.MoveDownItemCommand, Source={x:Reference This}}" CommandParameter="{Binding}" />
</Image.GestureRecognizers>
</Image>
</Grid>
<!--<StackLayout Padding="10" Orientation="Vertical">
<Label Text="{Binding Name}" LineBreakMode="WordWrap" TextColor="{StaticResource HDBlue}" Style="{Binding NameLevel,Converter={StaticResource HeaderLevelToStyleConverter}, ConverterParameter=1}" />
--><!--<Label Text="{Binding Link}" LineBreakMode="WordWrap" TextColor="{StaticResource HDLightGrey}" Style="{Binding NameLevel,Converter={StaticResource HeaderLevelToStyleConverter}, ConverterParameter=4}" />--><!--
</StackLayout>-->
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>