Skip to content

Instantly share code, notes, and snippets.

View Pujolsluis's full-sized avatar
🙈
Let's Mobile

Luis Pujols Pujolsluis

🙈
Let's Mobile
View GitHub Profile
@Pujolsluis
Pujolsluis / backup_rules.xml
Last active July 6, 2019 09:05
backup rules for android auto backup sample
<full-backup-content>
<include domain="database" path="string"/>
<exclude domain="sharedpref" path="."/>
</full-backup-content>
@Pujolsluis
Pujolsluis / AndroidManifest.xml
Created July 6, 2019 09:09
setting android auto backup rules file in manifest
<application ...
android:fullBackupContent="@xml/backup_rules">
</application>
@Pujolsluis
Pujolsluis / AndroidManifest.xml
Last active July 6, 2019 09:10
opt out of autobackup feature android
<manifest ... >
...
<application android:allowBackup="false" ... >
...
</application>
</manifest>
@Pujolsluis
Pujolsluis / MainPage.xaml
Created July 19, 2019 18:26
MainPage xaml for the Xamarin.Forms UI Challenge - Fincus App
<?xml version="1.0" encoding="UTF-8" ?>
<ContentPage x:Class="FicusUIChallenge.Views.MainPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:behaviors="clr-namespace:FicusUIChallenge.Helpers.Behaviors"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.UseSafeArea="true"
xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"
>
<ContentPage.Content>
@Pujolsluis
Pujolsluis / BaseBehavior.cs
Created July 19, 2019 18:37
Base generic behavior for Xamarin Forms UI Challenge Ficus
using System;
using Xamarin.Forms;
namespace FicusUIChallenge.Helpers.Behaviors
{
public class BaseBehavior<T> : Behavior<T> where T : BindableObject
{
public T AssociatedObject { get; private set; }
protected override void OnAttachedTo(T bindable)
@Pujolsluis
Pujolsluis / ViewTappedButtonBehavior.cs
Created July 19, 2019 18:39
ViewTappedButton behavior implementation
using System;
using System.Linq;
using System.Windows.Input;
using Xamarin.Forms;
namespace FicusUIChallenge.Helpers.Behaviors
{
public class ViewTappedButtonBehavior : BehaviorBase<View>
{
public event EventHandler Clicked;
@Pujolsluis
Pujolsluis / MainPage.xaml
Created July 19, 2019 18:41
behavior header
xmlns:behaviors="clr-namespace:FicusUIChallenge.Helpers.Behaviors"
@Pujolsluis
Pujolsluis / MainPage.xaml
Created July 19, 2019 18:43
Add behavior to element
<Image WidthRequest="24"
HeightRequest="24"
Source="ic_more.png"
HorizontalOptions="EndAndExpand"
VerticalOptions="Center">
<Image.Behaviors>
<behaviors:ViewTappedButtonBehavior Command="{Binding OnMoreCommand}" />
</Image.Behaviors>
</Image>
@Pujolsluis
Pujolsluis / TimelinePage.xaml
Created July 19, 2019 19:08
TimelinePage for the Xamarin.Forms Challenge App Ficus
<?xml version="1.0" encoding="UTF-8" ?>
<ContentPage x:Class="FicusUIChallenge.Views.TimeLinePage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:behaviors="clr-namespace:FicusUIChallenge.Helpers.Behaviors"
xmlns:controls="clr-namespace:FicusUIChallenge.Controls"
xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"
xmlns:converters="clr-namespace:FicusUIChallenge.Converters"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.UseSafeArea="true">
@Pujolsluis
Pujolsluis / IPrintService.cs
Created July 29, 2019 17:20
Interface for Xamarin Forms PrintService
using System;
using System.IO;
namespace FormsPrintSample.Services
{
public interface IPrintService
{
bool PrintImage(Stream img);
bool PrintPdfFile(Stream file);
}