Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
styling and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
wojta committed Mar 15, 2018
1 parent b528aff commit c0044ef
Show file tree
Hide file tree
Showing 19 changed files with 5,656 additions and 848 deletions.
8 changes: 5 additions & 3 deletions Example/Example.Android/MainActivity.cs
Expand Up @@ -12,14 +12,16 @@ namespace Example.Droid
[Activity(Label = "Example", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;

base.OnCreate(bundle);
base.OnCreate(savedInstanceState);

global::Xamarin.Forms.Forms.Init(this, bundle);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
TwinTechsForms.NControl.Android.SvgImageViewRenderer.Init();
XFGloss.Droid.Library.Init(this, savedInstanceState);
LoadApplication(new App());
}
}
Expand Down
6,328 changes: 5,544 additions & 784 deletions Example/Example.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Example/Example.iOS/AppDelegate.cs
Expand Up @@ -24,7 +24,8 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());

TwinTechsForms.NControl.iOS.SvgImageViewRenderer.Init();
XFGloss.iOS.Library.Init();
return base.FinishedLaunching(app, options);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Example/Example/App.xaml
Expand Up @@ -10,7 +10,7 @@
<Color x:Key="LightBackgroundColor">#FAFAFA</Color>
<Color x:Key="DarkBackgroundColor">#C0C0C0</Color>
<Color x:Key="MediumGrayTextColor">#4d4d4d</Color>
<Color x:Key="LightTextColor">#999999</Color>
<Color x:Key="PrimaryTextColor">#D8000000</Color>

<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="{StaticResource Primary}" />
Expand Down
1 change: 0 additions & 1 deletion Example/Example/App.xaml.cs
Expand Up @@ -13,7 +13,6 @@ public App ()
{
InitializeComponent();


MainPage = new RootPage();
}

Expand Down
7 changes: 7 additions & 0 deletions Example/Example/Example.csproj
Expand Up @@ -6,6 +6,7 @@

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="2.5.0.280555" />
<PackageReference Include="TwinTechsForms.NControl.SvgImageView" Version="0.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -35,6 +36,12 @@
<Compile Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="Views\DrawerMenuPage.xaml.cs">
<DependentUpon>DrawerMenuPage.xaml</DependentUpon>
</Compile>
<Compile Update="Views\DrawerMenuHeaderV.xaml.cs">
<DependentUpon>DrawerMenuHeaderV.xaml</DependentUpon>
</Compile>
<Compile Update="Views\DrawerMenuHeader.xaml.cs">
<DependentUpon>DrawerMenuHeader.xaml</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 13 additions & 7 deletions Example/Example/Resources/StringResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Example/Example/Resources/StringResources.resx
Expand Up @@ -24,4 +24,7 @@
<data name="NavAuth">
<value>Auth</value>
</data>
<data name="Home">
<value>Home!!!</value>
</data>
</root>
4 changes: 4 additions & 0 deletions Example/Example/Resources/ic_auth.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Example/Example/Resources/ic_home.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Example/Example/Resources/ic_http.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Example/Example/Resources/ic_label.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Example/Example/Resources/ic_phonelink_lock.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions Example/Example/Views/DrawerMenuHeader.xaml
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Example.Views.DrawerMenuHeader" >
<ContentView.Content>
<Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="{DynamicResource Primary}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="10" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="80" />
<RowDefinition Height="Auto" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Label Grid.Column="1" Grid.Row="2" Text="AppName" Style="{DynamicResource SubtitleStyle}" />
</Grid>
</ContentView.Content>
</ContentView>
14 changes: 14 additions & 0 deletions Example/Example/Views/DrawerMenuHeader.xaml.cs
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms;

namespace Example.Views
{
public partial class DrawerMenuHeader : ContentView
{
public DrawerMenuHeader()
{
InitializeComponent();
}
}
}
68 changes: 24 additions & 44 deletions Example/Example/Views/DrawerMenuPage.xaml
@@ -1,45 +1,25 @@
<?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="Example.Views.DrawerMenuPage"
Title="Master">
<StackLayout>
<ListView x:Name="MenuItemsListView"
SeparatorVisibility="None"
HasUnevenRows="true"
ItemsSource="{Binding MenuItems}">
<ListView.Header>
<Grid BackgroundColor="#03A9F4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="80"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<Label
Grid.Column="1"
Grid.Row="2"
Text="AppName"
Style="{DynamicResource SubtitleStyle}"/>
</Grid>
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="15,10" HorizontalOptions="FillAndExpand">
<Label VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center"
Text="{Binding Title}"
FontSize="24"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
<?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="Example.Views.DrawerMenuPage" xmlns:controls="clr-namespace:TwinTechsForms.NControl;assembly=TwinTechsForms.NControl.SvgImageView" xmlns:masterpages="clr-namespace:Example.Views" xmlns:xfg="clr-namespace:XFGloss;assembly=XFGloss" Title="Master">
<StackLayout>
<ListView x:Name="MenuItemsListView" SeparatorVisibility="None" HasUnevenRows="true" ItemsSource="{Binding MenuItems}">
<ListView.Header>
<masterpages:DrawerMenuHeaderV HorizontalOptions="Fill" HeightRequest="164" />
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Margin="16,16" HorizontalOptions="FillAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="56" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--<controls:SvgImageView VerticalOptions="Start" SvgAssembly="{Binding SvgAssembly}" SvgPath="ic_label.svg" WidthRequest="24" HeightRequest="24" />-->
<Label Text="XX" Grid.Column="1" VerticalOptions="Start" />
<Label Grid.Column="2" VerticalOptions="FillAndExpand" VerticalTextAlignment="Center" FontAttributes="Bold" Text="{Binding Title}" FontSize="14" TextColor="{DynamicResource PrimaryTextColor}" />
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>
4 changes: 2 additions & 2 deletions Example/Example/Views/Pages/HomePage.xaml
Expand Up @@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Example.Views.Pages.HomePage"
Title="Detail">
<StackLayout Padding="10">
<Label Text="Welcome to AeroGear Xamarin Example!"/>
<StackLayout Padding="10" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Label Text="{DynamicResource Home}" HorizontalOptions="Center" VerticalOptions="Center"/>
</StackLayout>
</ContentPage>
4 changes: 2 additions & 2 deletions Example/Example/Views/RootPage.xaml.cs
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Example.Resources;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

Expand All @@ -16,6 +16,7 @@ public RootPage()
{
InitializeComponent();
DrawerMenuPage.ListView.ItemSelected += ListView_ItemSelected;
Title = StringResources.AppName;
}

/// <summary>
Expand All @@ -28,7 +29,6 @@ private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e
return;

var page = (Page)Activator.CreateInstance(item.TargetType);
page.Title = item.Title;

Detail = new NavigationPage(page);
IsPresented = false;
Expand Down
3 changes: 0 additions & 3 deletions aerogear-xamarin-sdk.sln
Expand Up @@ -10,9 +10,6 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.iOS", "Example\Example.iOS\Example.iOS.csproj", "{00023BF2-7D9E-439C-8942-54D3F21E2710}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "Example\Example\Example.csproj", "{F40048C7-7FA6-4BDF-9D0E-F3DEB847C63C}"
ProjectSection(ProjectDependencies) = postProject
{F3CEAF1A-1384-4754-9DB7-513B720A56F2} = {F3CEAF1A-1384-4754-9DB7-513B720A56F2}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AeroGear.Mobile.Core.Tests", "AeroGear.Mobile.Core.Tests\AeroGear.Mobile.Core.Tests.csproj", "{8EDF4429-251A-416D-BB68-93F227191BCF}"
EndProject
Expand Down

0 comments on commit c0044ef

Please sign in to comment.