This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using SQLite.Net.Interop; | |
namespace MeuDB | |
{ | |
public interface IConfig | |
{ | |
string DiretorioDB { get; } | |
ISQLitePlatform Plataforma { get; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sing System; | |
using SQLite.Net.Attributes; | |
namespace MeuDB | |
{ | |
public class Contato | |
{ | |
[PrimaryKey, AutoIncrement] | |
public int Id { | |
get; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using Xamarin.Forms; | |
using System.Collections.Generic; | |
namespace MeuDB | |
{ | |
public class AcessoDados : IDisposable | |
{ | |
private SQLite.Net.SQLiteConnection _conexao; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:me="clr-namespace:MyNavigarion;assembly=MyNavigarion" | |
x:Class="MyNavigarion.UITabbedPage"> | |
<TabbedPage.Children> | |
<ContentPage BackgroundColor="Aqua" Title="Pagina 1" Icon="a.png"> | |
<ContentPage.Content> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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="MyNavigarion.UIContentPage"> | |
<ContentPage.Content> | |
<StackLayout Spacing="20" Padding="20"> | |
<Entry Placeholder="Teste"></Entry> | |
<Button Text="Salvar" Clicked="OnClicked"></Button> | |
</StackLayout> | |
</ContentPage.Content> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:me="clr-namespace:MyNavigarion;assembly=MyNavigarion" | |
x:Class="MyNavigarion.UICarouselPage"> | |
<CarouselPage.Children> | |
<ContentPage BackgroundColor="Aqua" Title="Pagina 1"> | |
<ContentPage.Content> | |
<Label Text="Pagina 1" TextColor="White"></Label> | |
</ContentPage.Content> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GitHubApi | |
{ | |
public async Task<List<string>> GetAsync(string user) | |
{ | |
string url = string.Format("https://api.github.com/users/{0}/repos", user); | |
var client = new HttpClient(); | |
client.DefaultRequestHeaders.Add("User-Agent", "Other"); | |
var response = await client.GetAsync(url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void ViewDidLoad () | |
{ | |
base.ViewDidLoad (); | |
btnSearch.TouchUpInside += async (object sender, EventArgs e) => { | |
var github = new Shared.GitHubApi(); | |
var repositories = await github.GetAsync(txtUser.Text); | |
lvwRepositories.Source = new TableViewSource(repositories); | |
lvwRepositories.ReloadData(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TableViewSource : UITableViewSource | |
{ | |
private List<string> _repositories; | |
public TableViewSource(List<string> repositories) | |
{ | |
_repositories = repositories; | |
} | |
public override int RowsInSection (UITableView tableview, int section) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyApp | |
{ | |
[Activity (Label = "MyApp", MainLauncher = true, Icon = "@drawable/icon")] | |
public class MainActivity : Activity | |
{ | |
protected override void OnCreate (Bundle bundle) | |
{ | |
base.OnCreate (bundle); | |
// Set our view from the "main" layout resource |