1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 22:45:44 +00:00

Problème droid

This commit is contained in:
Maniez Yan 2019-02-10 03:07:36 +01:00
parent f8daf71f27
commit b10dda447d
5 changed files with 66 additions and 21 deletions

View file

@ -50,7 +50,8 @@ namespace AideDeJeu.Droid
}
public string GetNewFilePath(string fileName, string extension)
{
var documentsDirectoryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
//var documentsDirectoryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var documentsDirectoryPath = Android.App.Application.Context.CacheDir.AbsolutePath;
return Path.Combine(documentsDirectoryPath, $"{fileName}.{extension}");
}
public async Task CopyOldToNewFileAsync(string fileName, string extension)

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="32" android:versionName="1.32" package="com.nioux.aidedejeubeta" android:installLocation="preferExternal">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="32" android:versionName="1.32" package="com.nioux.aidedejeu" android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="27" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="Haches &amp; Dés beta" android:icon="@drawable/battle_axe"></application>
<application android:label="Haches &amp; Dés" android:icon="@drawable/battle_axe"></application>
</manifest>

View file

@ -98,13 +98,22 @@ namespace AideDeJeu.ViewModels
}
}
public List<string> Abilities { get; set; } = new List<string>()
{
"3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"
};
public List<string> Levels { get; set; } = new List<string>()
{
"1", //"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"
};
public async Task InitAsync()
{
using (var context = await StoreViewModel.GetLibraryContextAsync())
{
Races = await context.Races.Where(r => r.GetType() == typeof(RaceItem)).OrderBy(r => r.Name).ToListAsync();
Classes = await context.Classes.OrderBy(c => c.Name).ToListAsync();
Backgrounds = await context.Backgrounds.Where(b => b.GetType() == typeof(BackgroundItem)).OrderBy(b => b.Name).ToListAsync();
Races = await context.Races.Where(r => r.GetType() == typeof(RaceItem)).OrderBy(r => Tools.Helpers.RemoveDiacritics(r.Name)).ToListAsync();
Classes = await context.Classes.Where(c => c.GetType() == typeof(ClassItem)).OrderBy(c => Tools.Helpers.RemoveDiacritics(c.Name)).ToListAsync();
Backgrounds = await context.Backgrounds.Where(b => b.GetType() == typeof(BackgroundItem)).OrderBy(b => Tools.Helpers.RemoveDiacritics(b.Name)).ToListAsync();
}
}
}

View file

@ -12,30 +12,65 @@
<tools:NullToFalseConverter x:Key="NullToFalseConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<StackLayout Orientation="Vertical">
<Label Text="Race" />
<Picker ItemsSource="{Binding Races}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding RaceSelectedIndex, Mode=TwoWay}">
<ScrollView>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Text="Niveau" />
<Picker Grid.Row="0" Grid.Column="1" ItemsSource="{Binding Levels}" ItemDisplayBinding="{Binding}" />
<Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="Race" />
<Picker Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding Races}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding RaceSelectedIndex, Mode=TwoWay}">
</Picker>
<!--<mdview:MarkdownView
Theme="{StaticResource MonsterMarkdownTheme}"
Markdown="{Binding SelectedPlayerCharacter.Race.Markdown}"
NavigateToLinkCommand="{Binding BindingContext.Main.Navigator.NavigateToLinkCommand, Source={x:Reference This}}"
/>-->
<Label Text="Classe" />
<Picker ItemsSource="{Binding Classes}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding ClassSelectedIndex, Mode=TwoWay}">
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Text="Classe" />
<Picker Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding Classes}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding ClassSelectedIndex, Mode=TwoWay}">
</Picker>
<!--<mdview:MarkdownView
Theme="{StaticResource MonsterMarkdownTheme}"
Markdown="{Binding SelectedPlayerCharacter.Class.Markdown}"
NavigateToLinkCommand="{Binding BindingContext.Main.Navigator.NavigateToLinkCommand, Source={x:Reference This}}"
/>-->
<Label Text="Historique" />
<Picker ItemsSource="{Binding Backgrounds}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding BackgroundSelectedIndex, Mode=TwoWay}">
<Label Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Text="Historique" />
<Picker Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding Backgrounds}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding BackgroundSelectedIndex, Mode=TwoWay}">
</Picker>
<!--<mdview:MarkdownView
Theme="{StaticResource MonsterMarkdownTheme}"
Markdown="{Binding SelectedPlayerCharacter.Background.Markdown}"
NavigateToLinkCommand="{Binding BindingContext.Main.Navigator.NavigateToLinkCommand, Source={x:Reference This}}"
/>-->
</StackLayout>
<Label Grid.Row="7" Grid.Column="0" Text="Force" />
<Picker Grid.Row="7" Grid.Column="1" ItemsSource="{Binding Abilities}" ItemDisplayBinding="{Binding}" />
<Label Grid.Row="8" Grid.Column="0" Text="Dextérité" />
<Picker Grid.Row="8" Grid.Column="1" ItemsSource="{Binding Abilities}" ItemDisplayBinding="{Binding}" />
<Label Grid.Row="9" Grid.Column="0" Text="Constitution" />
<Picker Grid.Row="9" Grid.Column="1" ItemsSource="{Binding Abilities}" ItemDisplayBinding="{Binding}" />
<Label Grid.Row="10" Grid.Column="0" Text="Intelligence" />
<Picker Grid.Row="10" Grid.Column="1" ItemsSource="{Binding Abilities}" ItemDisplayBinding="{Binding}" />
<Label Grid.Row="11" Grid.Column="0" Text="Sagesse" />
<Picker Grid.Row="11" Grid.Column="1" ItemsSource="{Binding Abilities}" ItemDisplayBinding="{Binding}" />
<Label Grid.Row="12" Grid.Column="0" Text="Charisme" />
<Picker Grid.Row="12" Grid.Column="1" ItemsSource="{Binding Abilities}" ItemDisplayBinding="{Binding}" />
</Grid>
</ScrollView>
</ContentPage>

View file

@ -1 +1 @@
14
15