Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
Expand Down Expand Up @@ -93,6 +92,9 @@
<AndroidResource Include="Resources\drawable\xamarin_logo.png" />
<AndroidResource Include="Resources\drawable\tab_about.png" />
<AndroidResource Include="Resources\drawable\tab_feed.png" />
<AndroidResource Include="Resources\drawable\promo1.png" />
<AndroidResource Include="Resources\drawable\promo2.png" />
<AndroidResource Include="Resources\drawable\qrcode.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable-hdpi\" />
Expand All @@ -102,7 +104,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CollectionViewChallenge\CollectionViewChallenge.csproj">
<Project>{BA39825E-3CF8-4A31-B120-782B2A651542}</Project>
<Project>{9A9DDEE5-8C48-4274-82D7-22EB79C97206}</Project>
<Name>CollectionViewChallenge</Name>
</ProjectReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.CollectionViewChallenge">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" />
<application android:label="CollectionViewChallenge.Android"></application>
</manifest>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" />
<application android:label="CollectionViewChallenge.Android"></application>
</manifest>
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 @@ -123,6 +123,9 @@
<BundleResource Include="Resources\xamarin_logo%402x.png" />
<BundleResource Include="Resources\xamarin_logo%403x.png" />
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
<BundleResource Include="Resources\promo1.png" />
<BundleResource Include="Resources\promo2.png" />
<BundleResource Include="Resources\qrcode.png" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -139,7 +142,7 @@
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\CollectionViewChallenge\CollectionViewChallenge.csproj">
<Project>{BA39825E-3CF8-4A31-B120-782B2A651542}</Project>
<Project>{9A9DDEE5-8C48-4274-82D7-22EB79C97206}</Project>
<Name>CollectionViewChallenge</Name>
</ProjectReference>
</ItemGroup>
Expand Down
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 @@ -12,7 +12,7 @@ public App()
{
InitializeComponent();

MainPage = new AppShell();
MainPage = new CollectionViewChallengePage();
}

protected override void OnStart()
Expand Down
15 changes: 7 additions & 8 deletions CollectionViewChallenge/CollectionViewChallenge/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
RouteScheme="app"
Route="CollectionViewChallenge"
FlyoutBehavior="Disabled"
Title="CollectionViewChallenge"
x:Class="CollectionViewChallenge.AppShell">

<!--
Expand Down Expand Up @@ -52,16 +51,16 @@
-->
<Shell.Resources>
<ResourceDictionary>
<Color x:Key="NavigationPrimary">#2196F3</Color>
<Color x:Key="NavigationPrimary">White</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.ShellDisabledColor" Value="White" />
<Setter Property="Shell.ShellUnselectedColor" Value="White" />
<Setter Property="Shell.ShellTabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
<Setter Property="Shell.ShellTabBarForegroundColor" Value="White"/>
<Setter Property="Shell.ShellTabBarUnselectedColor" Value="#95FFFFFF"/>
<Setter Property="Shell.ShellTabBarUnselectedColor" Value="White"/>
<Setter Property="Shell.ShellTabBarTitleColor" Value="White"/>
</Style>
<Style TargetType="ShellItem" BasedOn="{StaticResource BaseStyle}" />
Expand All @@ -70,9 +69,9 @@

<!-- Your Pages -->
<ShellItem>
<ShellSection Title="CollectionView" Icon="tab_feed.png">
<ShellContent Title="CollectionView">
<local:CollectionViewChallengePage Title="CollectionView"/>
<ShellSection Icon="tab_feed.png">
<ShellContent>
<local:CollectionViewChallengePage />
</ShellContent>
</ShellSection>
</ShellItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
<ItemGroup>
<Folder Include="Models\" />
<Folder Include="ViewModels\" />
<Folder Include="Models\" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace CollectionViewChallenge.Models
{
public class Categoria
{
public string Nome { get; private set; }
public string Foto { get; private set; }

public Categoria(string nome, string foto)
{
Nome = nome;
Foto = foto;
}
}
}
18 changes: 18 additions & 0 deletions CollectionViewChallenge/CollectionViewChallenge/Models/Promocao.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace CollectionViewChallenge.Models
{
public class Promocao
{
public string Id { get; private set; }
public string Descricao { get; private set; }
public string Foto { get; private set; }

public Promocao(string descricao, string foto)
{
Id = Guid.NewGuid().ToString();
Descricao = descricao;
Foto = foto;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace CollectionViewChallenge.Models
{
public class Restaurante
{
public string Nome { get; private set; }
public string Foto { get; private set; }

public Restaurante(string nome, string foto)
{
Nome = nome;
Foto = foto;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.ObjectModel;
using CollectionViewChallenge.Models;

namespace CollectionViewChallenge.ViewModels
{
public class CollectionViewChallangePageViewModel
{
public ObservableCollection<Promocao> Promocoes { get; set; }
public ObservableCollection<Categoria> Categorias { get; set; }
public ObservableCollection<Restaurante> Restaurantes { get; set; }
public ObservableCollection<Restaurante> UltimosRestaurantes { get; set; }

public CollectionViewChallangePageViewModel()
{
Promocoes = new ObservableCollection<Promocao>()
{
new Promocao(@"Opções a partir de R$10 sem taxas", "promo1.png"),
new Promocao(@"Cortesia do restaurante para você", "promo2.png"),
new Promocao(@"Populares perto de você", "promo1.png"),
new Promocao(@"Pra comer leve e gostoso", "promo2.png"),
new Promocao(@"Delicia pra refrescar", "promo1.png")
};

Categorias = new ObservableCollection<Categoria>()
{
new Categoria("Brasileira", "http://lorempixel.com/output/food-q-c-270-200-2.jpg"),
new Categoria("Lanche", "http://lorempixel.com/output/food-q-c-270-200-9.jpg"),
new Categoria("Saudável", "http://lorempixel.com/output/food-q-c-270-200-5.jpg"),
new Categoria("Chinesa", "http://lorempixel.com/output/food-q-c-270-200-1.jpg"),
new Categoria("Japonesa", "http://lorempixel.com/output/food-q-c-270-200-4.jpg"),
new Categoria("Italiana", "http://lorempixel.com/output/food-q-c-270-200-3.jpg")
};

Restaurantes = new ObservableCollection<Restaurante>()
{
new Restaurante("Habibs", "https://www.gad.com.br/wp-content/uploads/2018/09/small_S_L_cmyk_neg_logo.png"),
new Restaurante("Mc Donalds", "http://imagensemoldes.com.br/wp-content/uploads/2018/03/Mc-Donald%C2%B4s-Logo-Vetor-PNG-300x233.png"),
new Restaurante("Burguer King", "https://upload.wikimedia.org/wikipedia/pt/thumb/c/cf/Logotipo_do_Burger_King.svg/1024px-Logotipo_do_Burger_King.svg.png"),
new Restaurante("Pizza Hut", "http://viagemdeincentivo.com.br/wp-content/uploads/2014/07/logo-pizza-hut.png"),
new Restaurante("Bobs", "https://viacafegardenshopping.com.br/wp-content/uploads/2015/11/Bobs-Logo.jpg")
};
}
}
}
Loading