Skip to content

Instantly share code, notes, and snippets.

View pictos's full-sized avatar
🐒
Creating tools for you

Pedro Jesus pictos

🐒
Creating tools for you
  • Brasil
  • 05:25 (UTC -03:00)
View GitHub Profile
@pictos
pictos / testando
Last active July 18, 2017 05:15
Teste
package com.example.pedroj.bluettohsc;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
@pictos
pictos / BaseViewModel.cs
Created July 20, 2017 00:45
BaseViewModel
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace DeleteList.ViewModel
{
public class BaseViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
@pictos
pictos / MainViewModel.cs
Created July 20, 2017 00:49
View Model principal
using DeleteList.Model;
using System.Collections.ObjectModel;
using Xamarin.Forms;
namespace DeleteList.ViewModel
{
public class MainViewModel : BaseViewModel
{
public Command DeletarCommand { get; }
public ObservableCollection<Lista> Lista { get; }
@pictos
pictos / MainPage.xaml
Created July 20, 2017 00:56
View Delelete Item
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:DeleteList"
x:Class="DeleteList.MainPage">
<StackLayout>
<ListView ItemsSource="{Binding Lista}" SelectedItem="{Binding ItemSelecionado}">
<ListView.ItemTemplate>
@pictos
pictos / DirecaoServico.cs
Created November 23, 2017 14:42
Serviço para usar o DirectionsAPI
using Newtonsoft.Json;
using RouteMap.Model;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace RouteMap.Services
{
public class DirecaoServico
{
@pictos
pictos / MapCustomRender.cs
Created November 23, 2017 14:50
Classe CustomRender do Xamarin.Forms.Map
using System.Collections.Generic;
using Xamarin.Forms;
using Xamarin.Forms.Maps;
namespace RouteMap.CustomRender
{
public class MapCustomRender : Map
{
public static readonly BindableProperty CoordenadasRotaProperty =
@pictos
pictos / MapCustomRenderAndroid.cs
Created November 23, 2017 14:52
Custom Render do Android
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
@pictos
pictos / MapaPage.xaml
Created November 23, 2017 14:57
View do Mapa
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps"
xmlns:CustomMap="clr-namespace:RouteMap.CustomRender;assembly=RouteMap"
x:Class="RouteMap.Views.MapaPage">
<ContentPage.Content>
<StackLayout Padding="30">
<Entry Placeholder="Origem" Text="{Binding Origem}"/>
<Entry Placeholder="Destino" Text="{Binding Destino}"/>
using RouteMap.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.Maps;
using Xamarin.Forms.Xaml;
namespace RouteMap.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MapaPage : ContentPage
{
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms.Maps;
namespace RouteMap.Model
{
public class GooglePoints
{
public static IEnumerable<Position> Decode(string encodedPoints)