Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some hacking around visual, shell and collectionview #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ Thumbs.db
!nuget/**/*
!/nuget/**/*
!/nuget/

*.idea
2 changes: 1 addition & 1 deletion VisualChallenge/VisualChallenge.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected override void OnCreate(Bundle savedInstanceState)

base.OnCreate(savedInstanceState);

global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
global::Xamarin.Forms.FormsMaterial.Init(this, savedInstanceState);
LoadApplication(new App());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>4.0.0.293082-pre8</Version>
</PackageReference>
<PackageReference Include="LiveXAML">
<Version>2.1.70</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down
1 change: 1 addition & 0 deletions VisualChallenge/VisualChallenge.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary options)
global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
global::Xamarin.Forms.Forms.Init();
global::Xamarin.Forms.FormsMaterial.Init();

LoadApplication(new App());

return base.FinishedLaunching(app, options);
Expand Down
68 changes: 36 additions & 32 deletions VisualChallenge/VisualChallenge.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,41 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleDisplayName</key>
<string>VisualChallenge</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.VisualChallenge</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>CFBundleName</key>
<string>VisualChallenge</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleDisplayName</key>
<string>VisualChallenge</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.VisualChallenge</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>CFBundleName</key>
<string>VisualChallenge</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
<BundleResource Include="Resources\xamarin_logo%402x.png" />
<BundleResource Include="Resources\xamarin_logo%403x.png" />
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
<BundleResource Include="Resources\3bar%402x.png" />
<BundleResource Include="Resources\3bar.png" />
<BundleResource Include="Resources\zaloguj_white.png" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -136,6 +139,9 @@
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>4.0.0.293082-pre8</Version>
</PackageReference>
<PackageReference Include="LiveXAML">
<Version>2.1.70</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions VisualChallenge/VisualChallenge/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public App()
InitializeComponent();

MainPage = new AppShell();

MainPage.SetValue(NavigationPage.BarTextColorProperty, Color.White);
}

protected override void OnStart()
Expand Down
136 changes: 106 additions & 30 deletions VisualChallenge/VisualChallenge/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,116 @@
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:VisualChallenge"
RouteHost="companyname.com"
xmlns:pages="clr-namespace:VisualChallenge.Pages;assembly=VisualChallenge"

RouteHost="xamarin.com"
RouteScheme="app"
Route="VisualChallenge"
FlyoutBehavior="Disabled"

FlyoutBehavior="Flyout"
Title="VisualChallenge"
FlyoutHeaderBehavior="Default"
x:Name="self"

FlyoutBackgroundColor="Black"

x:Class="VisualChallenge.AppShell"

Visual="Material"

>

<!--
Styles and Resources
-->
<Shell.Resources>
<ResourceDictionary>
<Color x:Key="NavigationPrimary">#2196F3</Color>
<Style x:Key="BaseStyle" TargetType="Element">
<Setter Property="Shell.ShellBackgroundColor" Value="{StaticResource NavigationPrimary}" />
<Setter Property="Shell.ShellForegroundColor" Value="White" />
<Setter Property="Shell.ShellTitleColor" Value="White" />
<Setter Property="Shell.ShellDisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.ShellUnselectedColor" Value="#95FFFFFF" />
<Setter Property="Shell.ShellTabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
<Setter Property="Shell.ShellTabBarForegroundColor" Value="White"/>
<Setter Property="Shell.ShellTabBarUnselectedColor" Value="#95FFFFFF"/>
<Setter Property="Shell.ShellTabBarTitleColor" Value="White"/>
</Style>
<Style TargetType="ShellItem" BasedOn="{StaticResource BaseStyle}" />
</ResourceDictionary>
</Shell.Resources>

<FlyoutItem>
<Tab>
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
</Tab>
</FlyoutItem>


<Shell.ItemTemplate>
<DataTemplate>

<ContentView>

<StackLayout BackgroundColor="#161A20"
Orientation="Horizontal"
Margin="0,3,0,3"
>

<Image Source="{Binding FlyoutIcon}"
WidthRequest="28"
HeightRequest="28"/>

<Label Text="{Binding Title}"
FontAttributes="Bold"
VerticalOptions="Center"
TextColor="White"/>

</StackLayout>

</ContentView>

</DataTemplate>
</Shell.ItemTemplate>



<ShellItem Title="Strona Główna"

Shell.ShellBackgroundColor="#4982AB"
Shell.ShellTitleColor="White"
Shell.ShellForegroundColor="White"

FlyoutIcon="{local:ImageResource VisualChallenge.Images.glowna.png}">

<ShellContent ContentTemplate="{DataTemplate pages:MainPage}"/>
</ShellItem>

<ShellItem Title="Wykopalisko"
FlyoutIcon="{local:ImageResource VisualChallenge.Images.wykopalisko.png}"
Shell.ShellBackgroundColor="#4982AB"
Shell.ShellTitleColor="White"
Shell.ShellForegroundColor="White">

<ShellContent ContentTemplate="{DataTemplate pages:NotImplementedPage}" />
</ShellItem>

<ShellItem Title="Hity"
FlyoutIcon="{local:ImageResource VisualChallenge.Images.hity.png}"
Shell.ShellBackgroundColor="#4982AB"
Shell.ShellTitleColor="White"
Shell.ShellForegroundColor="White">

<ShellContent ContentTemplate="{DataTemplate pages:NotImplementedPage}" />
</ShellItem>

<ShellItem Title="Mikroblog"
FlyoutIcon="{local:ImageResource VisualChallenge.Images.mikroblog.png}"
Shell.ShellBackgroundColor="#4982AB"
Shell.ShellTitleColor="White"
Shell.ShellForegroundColor="White">

<ShellContent ContentTemplate="{DataTemplate pages:NotImplementedPage}" />
</ShellItem>

<ShellItem Title="Szukaj"
FlyoutIcon="{local:ImageResource VisualChallenge.Images.szukaj.png}"
Shell.ShellBackgroundColor="#4982AB"
Shell.ShellTitleColor="White"
Shell.ShellForegroundColor="White">

<ShellContent ContentTemplate="{DataTemplate pages:NotImplementedPage}" />
</ShellItem>

<ShellItem Title="Zaloguj się"
FlyoutIcon="{local:ImageResource VisualChallenge.Images.zaloguj.png}"
Shell.ShellBackgroundColor="#4982AB"
Shell.ShellTitleColor="White"
Shell.ShellForegroundColor="White">

<ShellContent ContentTemplate="{DataTemplate pages:LoginPage}" />
</ShellItem>

<ShellItem Title="Styl nocny"
FlyoutIcon="{local:ImageResource VisualChallenge.Images.nocny.png}"
Shell.ShellBackgroundColor="#4982AB"
Shell.ShellTitleColor="White"
Shell.ShellForegroundColor="White">

<ShellContent ContentTemplate="{DataTemplate pages:NotImplementedPage}" />
</ShellItem>

</Shell>
26 changes: 26 additions & 0 deletions VisualChallenge/VisualChallenge/ImageResourceExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Reflection;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace VisualChallenge
{
[ContentProperty(nameof(Source))]
public class ImageResourceExtension : IMarkupExtension
{
public string Source { get; set; }

public object ProvideValue(IServiceProvider serviceProvider)
{
if (Source == null)
{
return null;
}

// Do your translation lookup here, using whatever method you require
var imageSource = ImageSource.FromResource(Source, typeof(ImageResourceExtension).GetTypeInfo().Assembly);

return imageSource;
}
}
}
Binary file added VisualChallenge/VisualChallenge/Images/FB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VisualChallenge/VisualChallenge/Images/glowna.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VisualChallenge/VisualChallenge/Images/hity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VisualChallenge/VisualChallenge/Images/nocny.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VisualChallenge/VisualChallenge/Images/szukaj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions VisualChallenge/VisualChallenge/Pages/LoginPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="VisualChallenge.Pages.LoginPage"
xmlns:visualChallenge="clr-namespace:VisualChallenge;assembly=VisualChallenge"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.UseSafeArea="true"
Title="Zaloguj się">
<StackLayout>

<StackLayout Orientation="Horizontal"
HorizontalOptions="Center"
Margin="0,20,0,20">

<Image Grid.Column="1"
Source="{visualChallenge:ImageResource VisualChallenge.Images.FB.png}"/>

<Label Text="ZALOGUJ SIE PRZEZ FACEBOOK"
VerticalOptions="Center"
FontSize="Small"
TextColor="#415894"/>

</StackLayout>

<BoxView Grid.Column="0"
Color="#DCDBDC"
HeightRequest="1"
VerticalOptions="End"
HorizontalOptions="FillAndExpand"
Grid.ColumnSpan="4"/>

<Entry Margin="10,10,10,0"
Placeholder="Login lub e-mail"
BackgroundColor="Transparent"/>

<Entry Margin="10,10,10,0"
Placeholder="Hasło"
BackgroundColor="Transparent"/>

<Button Text="ZALOGUJ SIĘ PRZEZ WYKOP"
Padding="10"
BackgroundColor="#3072A0"
Margin="10"/>

</StackLayout>


</ContentPage>
15 changes: 15 additions & 0 deletions VisualChallenge/VisualChallenge/Pages/LoginPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;

using Xamarin.Forms;

namespace VisualChallenge.Pages
{
public partial class LoginPage : ContentPage
{
public LoginPage()
{
InitializeComponent();
}
}
}
Loading