Skip to content

Instantly share code, notes, and snippets.

View nodoid's full-sized avatar

Paul Johnson nodoid

  • Shining Knight Software
  • Merseyside, UK
View GitHub Profile
@nodoid
nodoid / gist:5da70ca571d9f9ee05c0
Last active August 29, 2015 14:23
Scroll on TextField enter
txtEmail.EditingDidBegin += delegate
{
UIUtils.SetKeyboardEditorWithCloseButton(txtEmail, UIKeyboardType.Default);
UIUtils.AnimateTextField(View, true);
};
txtEmail.EditingDidEnd += delegate
{
UIUtils.AnimateTextField(View, false);
};
@nodoid
nodoid / gist:6824538d40e120298c9e
Last active August 29, 2015 14:16
Using Get/Post
private T callService<T>(string method, string json, string auth, bool post = false, List<string> headers = null) where T : new()
{
string url = string.Format("{0}/{1}", _configuration.BaseUrl, method);
var request = WebRequest.Create(url) as HttpWebRequest;
request.Method = !post ? "GET" : "POST";
request.Accept = "application/json";
request.ContentType = "application/json";
request.Headers["Authorization"] = auth;
if (headers != null)
{
@nodoid
nodoid / Android styled button
Created February 26, 2015 21:17
Styling an android button
// in Resources/drawable
// I've called this RoundedButton.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" >
<shape android:shape="rectangle" >
<corners android:radius="3dip" />
<stroke android:width="1dip" android:color="#5e7974" />
<gradient android:angle="-90" android:startColor="#345953" android:endColor="#689a92" />
@nodoid
nodoid / uipickerview example
Created February 26, 2015 15:22
UIPickerViews
// place this in your controller
// View is the view the control sits in
// txtSelect is the name of the textbox the spinner "sits" in - as soon as you select
// the textbox, the UIPickerView fires up
// information is a List<string>
txtSelect.EditingDidBegin += delegate
{
txtSelect.InputView = PickerUI.CreateDropList(View, new UIPickerView(), txtSelect, information);
};