Skip to content

Instantly share code, notes, and snippets.

View conceptdev's full-sized avatar
💭
🐵monkeying around

Craig Dunn conceptdev

💭
🐵monkeying around
View GitHub Profile
using System;
using System.Collections.Generic;
using Android.App;
using Android.Views;
using Android.Widget;
namespace ContentControls {
public class AutoAdapter : ArrayAdapter, IFilterable
{
LayoutInflater inflater;
@conceptdev
conceptdev / AppDelegate.cs
Created March 30, 2012 23:57
CoreImage quick'n'dirty sample: Contrast/Saturation/Brightness editing (screenshot http://twitpic.com/93gfty)
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace ColorControl {
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
@conceptdev
conceptdev / AppleTileSource
Created March 8, 2012 03:45
Caulker Tile Source for maptiles used in iOS5 iPhoto
public class AppleTileSource : TileSource {
public AppleTileSource() {
Name = "Apple";
FileExtension = ".jpg";
}
public override string GetTileUrl(TileName name) {
return string.Format("http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=de_DE&z={0}&x={1}&y={2}&v=9",
name.Zoom,
name.X, name.Y);
}
@conceptdev
conceptdev / gist:1935358
Created February 28, 2012 21:46
NSURLConnectionDownloadDelegate binding II
[Export("connection:didWriteData:totalBytesWritten:expectedTotalBytes:")]
public void DidWriteData (NSUrlConnection connection, long bytesWrittenA, int totalBytesWrittenA, int totalBytesWrittenB, int expectedTotalBytesA, int expectedTotalBytesB) {
Console.WriteLine ("bytesWrittenA:"+bytesWrittenA);
// Console.WriteLine ("bytesWrittenB:"+bytesWrittenB);
Console.WriteLine ("totalBytesWrittenA:"+totalBytesWrittenA);
Console.WriteLine ("totalBytesWrittenB:"+totalBytesWrittenB);
Console.WriteLine ("expectedTotalBytesA:"+expectedTotalBytesA);
Console.WriteLine ("expectedTotalBytesB:"+expectedTotalBytesB);
}
@conceptdev
conceptdev / gist:1935253
Created February 28, 2012 21:24
NSURLConnectionDownloadDelegate binding
THE OBJECTIVE-C
- (void)connection:(NSURLConnection *)connection didWriteData:(long long)bytesWritten totalBytesWritten:(long long)totalBytesWritten expectedTotalBytes:(long long)expectedTotalBytes
THE MT BINDING
[Export("connection:didWriteData:totalBytesWritten:expectedTotalBytes:")]
public void DidWriteData (NSUrlConnection connection, long bytesWritten, long totalBytesWritten, long expectedTotalBytes) {
@conceptdev
conceptdev / HelloWorldActivity.cs
Created May 31, 2011 11:08
MonoDroid 'hello world' examples (simple, layout-less sample app)
using Android.App;
using Android.OS;
using Android.Widget;
namespace Demo
{
[Activity(Label = "HelloWorld", MainLauncher = true)]
public class HelloWorldActivity : Activity
{
int count = 0;
@conceptdev
conceptdev / CoverFlow.cs
Created March 6, 2011 04:37
MonoDroid port of a CoverFlow-showing Activity for Android http://twitpic.com/46n72l
/*
* ORIGINAL (JAVA) CODE LICENCE
*
* Copyright (C) 2010 Neil Davies
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@conceptdev
conceptdev / LargeImageScroller.cs
Created March 1, 2011 03:35
Custom Android View in MonoDroid: pan around an image larger than the screen
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;
@conceptdev
conceptdev / MyGallery.cs
Created February 28, 2011 23:42
Custom Android Gallery in MonoDroid: one-view-at-a-time scrolling
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;
using MonoTouch.Foundation;
using MonoTouch.CoreLocation;
using MonoTouch.ObjCRuntime;
using System;
/// <summary>
/// Helper class intended SOLELY to provide access to
/// CLLocationManager:locationServicesEnabled
/// that works on MonoTouch versions 2.x and 3.x (iOS3 and iOS4)
/// </summary>
/// <remarks>