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
IMediaPicker media; | |
btnTakePic.Clicked += async delegate | |
{ | |
try | |
{ | |
progressStack.IsVisible = progressStack.IsEnabled = true; | |
App.Self.Uploaded = 0; | |
var mediaFile = await media.TakePhotoAsync(new CameraMediaStorageOptions { DefaultCamera = CameraDevice.Front, MaxPixelDimension = 400 }); | |
Device.BeginInvokeOnMainThread(async () => |
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 static class DateTimeUtils | |
{ | |
public static DateTime NSDateToDateTime(this NSDate date) | |
{ | |
var reference = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(2001, 1, 1, 0, 0, 0)); | |
return reference.AddSeconds(date.SecondsSinceReferenceDate); | |
} | |
public static NSDate DateTimeToNSDate(this DateTime date) | |
{ |
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
/* App.ScreenSize is obtained from the platform by DI */ | |
// this code is completely untested! | |
public class MyGrid : ContentPage | |
{ | |
public class MyGrid() | |
{ | |
var grid = new Grid | |
{ | |
WidthRequest = App.ScreenSize.Width |
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
yourPCLNamespace.App.ScreenSize = new Size(bounds.Width, bounds.Height); |
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
async Task Scroller(StackLayout layout, ScrollView scroll, int position) | |
{ | |
await Task.Delay(layout.Children.Count * 10).ContinueWith((y) => | |
{ | |
if (y.IsCompleted) | |
{ | |
var selected = layout.Children[position]; | |
Device.BeginInvokeOnMainThread(async () => await scroll.ScrollToAsync((StackLayout)selected, ScrollToPosition.Center, true)); | |
} | |
}); |
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"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:orientation="vertical" | |
style="@style/lightbox_dialog"> | |
<LinearLayout | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:gravity="center_vertical|center_horizontal"> |
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
<?php | |
if(isset($_GET['url'])) | |
{ | |
echo "in"; | |
$url = $_GET['url']; | |
echo $url; | |
$images = glob($url."*.{jpg,jpeg,png,gif}", GLOB_BRACE); |
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 NavigationService : INavigationService | |
{ | |
readonly Dictionary<string, Type> _pagesByKey = new Dictionary<string, Type>(); | |
NavigationPage _navigation; | |
public string CurrentPageKey | |
{ | |
get | |
{ | |
lock (_pagesByKey) |
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
/* you need the xamarin permissions to use this /* | |
static readonly int REQUEST_WRITESETTINGS = 2, REQUEST_EXTERNAL = 4, REQUEST_WIFI = 5, REQUEST_WAKELOCK = 6, REQUEST_CONTACTS; | |
static string[] PERMISSIONS_SETTINGS = { Manifest.Permission.WriteSettings }; | |
static string[] PERMISSIONS_STORAGE = { Manifest.Permission_group.Storage }; | |
static string[] PERMISSIONS_WIFISTATE = { Manifest.Permission.AccessWifiState }; | |
static string[] PERMISSIONS_WAKELOCK = { Manifest.Permission.WakeLock }; | |
static string[] PERMISSIONS_CONTACTS = { Manifest.Permission.ReadContacts }; |