Skip to content

Instantly share code, notes, and snippets.

View rdelrosario's full-sized avatar

Rendy Del Rosario rdelrosario

View GitHub Profile
<?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="ZoomScrollViewSample.MainPage"
BackgroundColor="Black">
<ContentPage.Content>
<ScrollView>
<StackLayout>
<Image Margin="0,30,0,0" Source="monkey" HeightRequest="60" HorizontalOptions="Center"/>
<Label Margin="40" FontSize="10" VerticalTextAlignment="Center" TextColor="White" Text="Monkeys are haplorhine primates, a group generally possessing tails and consisting of about 260 known living species. There are two distinct lineages of monkeys: New World Monkeys and catarrhines. Apes emerged within the catarrhines with the Old World monkeys as a sister group, so cladistically they are monkeys as well. However, traditionally apes are not considered monkeys, rendering this grouping paraphyletic. The equivalent monophyletic clade are the simians. Many monkey species are tr
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
using System;
using AVFoundation;
using Foundation;
using OverlayCameraSample.Controls;
using OverlayCameraSample.iOS.Controls;
using OverlayCameraSample.iOS.Renderers;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using OverlayCameraSample.iOS.Extensions;
using System;
using OverlayCameraSample.Controls;
using OverlayCameraSample.Droid.Renderers;
using OverlayCameraSample.Droid.Views;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using static OverlayCameraSample.Droid.Views.BaseCameraView;
using Android.OS;
[assembly: ExportRenderer(typeof(CameraPreview), typeof(CameraPreviewRenderer))]
@rdelrosario
rdelrosario / DraggableViewRenderer.cs
Created August 23, 2017 01:51
Android DraggableViewRenderer
using AView = Android.Views;
using Android.Runtime;
using Android.Views;
using DragViewSample.Droid.Renderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using DragViewSample;
using System.ComponentModel;
[assembly: ExportRenderer(typeof(DraggableView), typeof(DraggableViewRenderer))]
@rdelrosario
rdelrosario / DraggableViewRenderer.cs
Created August 23, 2017 01:57
iOS DraggableViewRenderer
using Foundation;
using UIKit;
using Xamarin.Forms;
using DragViewSample;
using DragViewSample.iOS.Renderers;
using Xamarin.Forms.Platform.iOS;
using System.ComponentModel;
using CoreGraphics;
[assembly: ExportRenderer(typeof(DraggableView), typeof(DraggableViewRenderer))]
@rdelrosario
rdelrosario / Sample.xaml
Created August 23, 2017 13:00
DraggrableView Sample XAML
<?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:DragViewSample"
x:Class="DragViewSample.MainPage">
<AbsoluteLayout>
<ListView AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0,0,1,1"
SeparatorColor="Transparent" x:Name="list"
Margin="0,20,0,0"
@rdelrosario
rdelrosario / DraggableView.cs
Created August 23, 2017 13:22
DraggableView
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Xamarin.Forms;
namespace DragViewSample
{
public partial class DraggableView : ContentView
@rdelrosario
rdelrosario / TitleAlignment.cs
Last active November 30, 2017 22:11
Android - Title Alignment
void UpdateTitleViewLayoutAlignment(LinearLayout titleViewLayout, Android.Widget.TextView titleTextView, Android.Widget.TextView subTitleTextView, CustomNavigationPage.TitleAlignment alignment)
{
var titleViewParams = titleViewLayout.LayoutParameters as Android.Widget.FrameLayout.LayoutParams;
var titleTextViewParams = titleTextView.LayoutParameters as LinearLayout.LayoutParams;
var subTitleTextViewParams = subTitleTextView.LayoutParameters as LinearLayout.LayoutParams;
switch (alignment)
{
case CustomNavigationPage.TitleAlignment.Start:
titleViewParams.Gravity = GravityFlags.Start | GravityFlags.CenterVertical;
@rdelrosario
rdelrosario / TitleBackground..cs
Created November 30, 2017 22:15
Android - Title Background
void UpdateTitleViewLayoutBackground(LinearLayout titleViewLayout, string backgroundResource, Android.Graphics.Drawables.Drawable defaultBackground)
{
if (!string.IsNullOrEmpty(backgroundResource))
{
titleViewLayout?.SetBackgroundResource(this.Context.Resources.GetIdentifier(backgroundResource, "drawable", Android.App.Application.Context.PackageName));
}
else
{
titleViewLayout?.SetBackground(defaultBackground);
}