Skip to content

Commit

Permalink
Merge pull request #13 from emiliano84/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Emiliano84 authored May 23, 2020
2 parents 6062d1f + 83dfdc2 commit ccacb25
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 107 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Yugen Mosaic UWP
![logo](/Yugen.Mosaic.Uwp/Assets/SmallTile.scale-400.png)

# Yugen Mosaic UWP
Yugen Mosaic is a free app that helps you to create digital art pictures made from your own pictures. For example you can create a photo mosaic, an image composed of many tiled photos.

## Contributing
Expand All @@ -9,5 +9,14 @@ Everyone is welcome to contribute, if you're looking to help out with the projec
## Getting started
The project has been primarily built for the universal Windows platform (UWP), so you'll need the latest version of [Visual Studio 2019](https://www.visualstudio.com/) (including the community edition) and the latest Windows 10 SDK which you can install as part of the Visual Studio installer.

## License
[ImageSharp](https://github.com/SixLabors/ImageSharp) is licensed under the [Apache 2.0 License.](Imagesharp-LICENSE)
## Download
Get the latest version in the [Microsoft Store.](https://www.microsoft.com/store/apps/9PF0S24CX0D4)

## Dependencies and References
[Yugen Toolkit](https://github.com/emiliano84/Yugen.Toolkit)
[ImageSharp](https://github.com/SixLabors/ImageSharp) is licensed under the [Apache 2.0 License.](Imagesharp-LICENSE)

## Special Thanks
- Icon: [Yoshi](https://github.com/yoshiask)
- UI: [Leisvan](https://twitter.com/leisvanCT)
- Code Help: [Sergio](https://github.com/Sergio0694)
49 changes: 48 additions & 1 deletion Yugen.Mosaic.Uwp/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</Setter>
</Style>

<Style x:Key="ProgressRingStyle1"
<Style x:Key="YugenProgressRingStyle"
TargetType="ProgressRing">
<Setter Property="Background"
Value="Transparent" />
Expand Down Expand Up @@ -238,6 +238,53 @@
</Setter>
</Style>

<Style x:Key="YugenHyperlinkButtonStyle"
TargetType="HyperlinkButton">
<Setter Property="Foreground"
Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
</Style>

<Style x:Key="YugenBodyTextBlockStyle"
BasedOn="{StaticResource BodyTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Foreground"
Value="{ThemeResource AppForegroundBrush}" />
</Style>

<Style x:Key="YugenCaptionTextBlockStyle"
BasedOn="{StaticResource CaptionTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Foreground"
Value="{ThemeResource AppForegroundBrush}" />
</Style>

<Style x:Key="YugenSubtitleTextBlockStyle"
BasedOn="{StaticResource SubtitleTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Foreground"
Value="{ThemeResource AppForegroundBrush}" />
</Style>

<Style x:Key="YugenTitleTextBlockStyle"
BasedOn="{StaticResource TitleTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Foreground"
Value="{ThemeResource AppForegroundBrush}" />
</Style>

<Style x:Key="YugenBaseTextBlockStyle"
BasedOn="{StaticResource BaseTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Foreground"
Value="{ThemeResource AppForegroundBrush}" />
</Style>

<Style x:Key="YugenRadioButtonStyle"
TargetType="RadioButton">
<Setter Property="Foreground"
Value="{ThemeResource AppForegroundBrush}" />
</Style>

</ResourceDictionary>

</ResourceDictionary.MergedDictionaries>
Expand Down
1 change: 0 additions & 1 deletion Yugen.Mosaic.Uwp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using Yugen.Mosaic.Uwp.Extensions;
using Yugen.Mosaic.Uwp.Services;
using Yugen.Mosaic.Uwp.Views;
using Yugen.Toolkit.Standard.Extensions;
Expand Down
103 changes: 52 additions & 51 deletions Yugen.Mosaic.Uwp/Controls/SettingsDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,100 +12,101 @@
<ContentDialog.Resources>
<Thickness x:Key="ContentDialogPadding">0</Thickness>
<converters:EnumToBooleanConverter x:Key="EnumToBooleanConverter"
EnumType="ElementTheme" />
EnumType="ElementTheme" />
</ContentDialog.Resources>

<ContentDialog.DataContext>
<vm:SettingsViewModel />
</ContentDialog.DataContext>

<Grid Padding="15,15,15,30"
<Grid Padding="16,16,16,32"
Background="{ThemeResource AppDeepBackgroundBrush}">

<StackPanel Orientation="Vertical"
Spacing="15"
Spacing="16"
MaxWidth="360">

<Grid>
<TextBlock Text="Settings"

<TextBlock x:Uid="SettingsTitleTextBlock"
Style="{ThemeResource TitleTextBlockStyle}"
Foreground="{ThemeResource AppForegroundBrush}"
HorizontalAlignment="Left"
Margin="5,0,0,0" />
Margin="4,0,0,0" />
<Button Style="{StaticResource SoftRevealButtonStyle}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Command="{x:Bind HideCommand}">
<FontIcon Glyph="" />
</Button>

</Grid>

<StackPanel Spacing="5"
Padding="15,0,15,0">
<TextBlock Text="Theme"
Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource SubtitleTextBlockStyle}" />
<RadioButton Content="Light"
<StackPanel Spacing="4"
Padding="16,0">

<TextBlock x:Uid="SettingsThemeTextBlock"
Style="{StaticResource YugenSubtitleTextBlockStyle}" />
<RadioButton x:Uid="SettingsThemeLightTextBlock"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Light, Mode=OneWay}"
Foreground="{ThemeResource AppForegroundBrush}">
Style="{ThemeResource YugenRadioButtonStyle}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Light</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>
<RadioButton Content="Dark"
<RadioButton x:Uid="SettingsThemeDarkTextBlock"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Dark, Mode=OneWay}"
Foreground="{ThemeResource AppForegroundBrush}">
Style="{ThemeResource YugenRadioButtonStyle}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Dark</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>
<RadioButton Content="Default"
<RadioButton x:Uid="SettingsThemeDefaultTextBlock"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Default, Mode=OneWay}"
Foreground="{ThemeResource AppForegroundBrush}">
Style="{ThemeResource YugenRadioButtonStyle}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Default</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>

</StackPanel>

<StackPanel Spacing="5"
Padding="15,0,15,0">

<TextBlock Text="About"
Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource SubtitleTextBlockStyle}" />

<TextBlock Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource CaptionTextBlockStyle}">
<Run Text="{x:Bind ViewModel.AppName}"
FontWeight="SemiBold" />
<LineBreak />
<Run Text="{x:Bind ViewModel.AppVersion}" />
</TextBlock>

<TextBlock Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource CaptionTextBlockStyle}">
<Run Text="Developed by"
FontWeight="SemiBold" />
<LineBreak />
<Run Text="{x:Bind ViewModel.Publisher}" />
</TextBlock>
<StackPanel Spacing="4"
Padding="16,0">

<TextBlock Foreground="{ThemeResource AppForegroundBrush}"
Style="{StaticResource CaptionTextBlockStyle}">
<Run Text="Colaborators"
FontWeight="SemiBold" />
<LineBreak />
<Run Text="{x:Bind ViewModel.Collaborator[0]}" />
<LineBreak />
<Run Text="{x:Bind ViewModel.Collaborator[1]}" />
</TextBlock>

<HyperlinkButton Content="Rate and review"
Command="{x:Bind ViewModel.LaunchRateAndReviewCommand}" />
<TextBlock x:Uid="SettingsAboutTextBlock"
Style="{StaticResource YugenSubtitleTextBlockStyle}" />

<TextBlock x:Uid="SettingsAppNameTextBlock"
Style="{StaticResource YugenBodyTextBlockStyle}" />
<TextBlock Style="{StaticResource YugenCaptionTextBlockStyle}"
Text="{x:Bind ViewModel.AppVersion}" />

<TextBlock x:Uid="SettingsDevelopedTextBlock"
Margin="0,4,0,0"
Style="{StaticResource YugenBodyTextBlockStyle}"/>
<HyperlinkButton x:Uid="SettingsDevelopedHyperlink"
Content="{x:Bind ViewModel.Publisher}"
Margin="0,-8,0,0"
Style="{ThemeResource YugenHyperlinkButtonStyle}"/>

<TextBlock x:Uid="SettingsUITextBlock"
Style="{StaticResource YugenBodyTextBlockStyle}" />
<HyperlinkButton x:Uid="SettingsUIHyperlink"
Margin="0,-8,0,0"
Style="{ThemeResource YugenHyperlinkButtonStyle}" />

<TextBlock x:Uid="SettingsIconTextBlock"
Style="{StaticResource YugenBodyTextBlockStyle}" />
<HyperlinkButton x:Uid="SettingsIconHyperlink"
Margin="0,-8,0,0"
Style="{ThemeResource YugenHyperlinkButtonStyle}"/>

<HyperlinkButton x:Uid="SettingsRateHyperlink"
NavigateUri="{x:Bind ViewModel.RateAndReviewUri}"
Style="{ThemeResource YugenHyperlinkButtonStyle}"/>

</StackPanel>

Expand Down
99 changes: 99 additions & 0 deletions Yugen.Mosaic.Uwp/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,54 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="MainAddMasterTextBlock.Text" xml:space="preserve">
<value>Click here to choose a Master image</value>
</data>
<data name="MainAddTilesTextBlock.Text" xml:space="preserve">
<value>Add Tiles</value>
</data>
<data name="MainGenerateButton.Content" xml:space="preserve">
<value>Generate</value>
</data>
<data name="MainHeightTextBlock.Text" xml:space="preserve">
<value>H:</value>
</data>
<data name="MainHelpTextBlock.Text" xml:space="preserve">
<value>Help</value>
</data>
<data name="MainMasterImageTextBlock.Text" xml:space="preserve">
<value>Master Image</value>
</data>
<data name="MainMosaicTypeTextBlock.Text" xml:space="preserve">
<value>MosaicType</value>
</data>
<data name="MainOutputPropertiesTextBlock.Text" xml:space="preserve">
<value>Output Properties</value>
</data>
<data name="MainResetButton.Content" xml:space="preserve">
<value>Reset</value>
</data>
<data name="MainSaveButton.Content" xml:space="preserve">
<value>Save</value>
</data>
<data name="MainSettingsTextBlock.Text" xml:space="preserve">
<value>Settings</value>
</data>
<data name="MainShowGridCheckBox.Content" xml:space="preserve">
<value>Show Grid</value>
</data>
<data name="MainTileProperties.Text" xml:space="preserve">
<value>Tile Properties</value>
</data>
<data name="MainTilesListTextBlock.Text" xml:space="preserve">
<value>Tiles list</value>
</data>
<data name="MainTitleTextBlock.Text" xml:space="preserve">
<value>Yugen Mosaic</value>
</data>
<data name="MainWidthTextBlock.Text" xml:space="preserve">
<value>W:</value>
</data>
<data name="OnboardingStageAddTilesDescription" xml:space="preserve">
<value>Then add images. Yugen Mosaic will use them as tiles to build your mosaic. The more tiles you choose, the better result you will get!</value>
</data>
Expand Down Expand Up @@ -163,4 +211,55 @@
<data name="OnboardingStageTilePropertiesTitle" xml:space="preserve">
<value>Set the tile properties</value>
</data>
<data name="SettingsAboutTextBlock.Text" xml:space="preserve">
<value>About</value>
</data>
<data name="SettingsAppNameTextBlock.Text" xml:space="preserve">
<value>Yugen Mosaic</value>
</data>
<data name="SettingsDevelopedHyperlink.Content" xml:space="preserve">
<value />
</data>
<data name="SettingsDevelopedHyperlink.NavigateUri" xml:space="preserve">
<value>http://www.yugenapps.com</value>
</data>
<data name="SettingsDevelopedTextBlock.Text" xml:space="preserve">
<value>Developed By</value>
</data>
<data name="SettingsIconHyperlink.Content" xml:space="preserve">
<value>Yoshi</value>
</data>
<data name="SettingsIconHyperlink.NavigateUri" xml:space="preserve">
<value>https://github.com/yoshiask</value>
</data>
<data name="SettingsIconTextBlock.Text" xml:space="preserve">
<value>Icon</value>
</data>
<data name="SettingsRateHyperlink.Content" xml:space="preserve">
<value>Rate and review</value>
</data>
<data name="SettingsThemeDarkTextBlock.Content" xml:space="preserve">
<value>Dark</value>
</data>
<data name="SettingsThemeDefaultTextBlock.Content" xml:space="preserve">
<value>System Default</value>
</data>
<data name="SettingsThemeLightTextBlock.Content" xml:space="preserve">
<value>Light</value>
</data>
<data name="SettingsThemeTextBlock.Text" xml:space="preserve">
<value>Theme</value>
</data>
<data name="SettingsTitleTextBlock.Text" xml:space="preserve">
<value>Settings</value>
</data>
<data name="SettingsUIHyperlink.Content" xml:space="preserve">
<value>Leisvan</value>
</data>
<data name="SettingsUIHyperlink.NavigateUri" xml:space="preserve">
<value>https://twitter.com/leisvanCT</value>
</data>
<data name="SettingsUITextBlock.Text" xml:space="preserve">
<value>UI</value>
</data>
</root>
13 changes: 2 additions & 11 deletions Yugen.Mosaic.Uwp/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,21 @@ namespace Yugen.Mosaic.Uwp.ViewModels
{
public class SettingsViewModel : BaseViewModel
{
private const string STORE_REVIEWFORMAT = "ms-windows-store:REVIEW?PFN={0}";
private ElementTheme _elementTheme = ThemeSelectorService.Theme;
private ICommand _launchRateAndReviewCommand;
private ICommand _switchThemeCommand;
//This may change if the app gets localized
public string AppName => "Yugen Mosaic";

public string AppVersion => SystemHelper.AppVersion;

public string[] Collaborator => new[] { "Leisvan", "Yoshi" };
public string Publisher => SystemHelper.Publisher;
public string RateAndReviewUri => $"ms-windows-store:REVIEW?PFN={Package.Current.Id.FamilyName}";

public ElementTheme ElementTheme
{
get => _elementTheme;
set => Set(ref _elementTheme, value);
}

public string Publisher => SystemHelper.Publisher;

public ICommand LaunchRateAndReviewCommand => _launchRateAndReviewCommand ?? (_launchRateAndReviewCommand = new AsyncRelayCommand(LaunchRateAndReviewCommandBehavior));
public ICommand SwitchThemeCommand => _switchThemeCommand ?? (_switchThemeCommand = new AsyncRelayCommand<ElementTheme>(SwitchThemeCommandBehavior));

private async Task LaunchRateAndReviewCommandBehavior() => await Launcher.LaunchUriAsync(new Uri(string.Format(STORE_REVIEWFORMAT, Package.Current.Id.FamilyName)));

private async Task SwitchThemeCommandBehavior(ElementTheme param)
{
ElementTheme = param;
Expand Down
Loading

0 comments on commit ccacb25

Please sign in to comment.