Skip to content

Instantly share code, notes, and snippets.

View Cheesebaron's full-sized avatar
🧀
Send cheese please

Tomasz Cielecki Cheesebaron

🧀
Send cheese please
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="App1.App1" android:versionCode="1"
android:versionName="1.0" android:installLocation="auto">
<application android:label="App1" android:icon="@drawable/Icon"></application>
<uses-permission android:name="android.permission.READ_CONTACTS" />
</manifest>
<cheesebaron.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Your main content inside here -->
[Activity(Label = "Pseudo MultiColumn", MainLauncher = true, Icon = "@drawable/icon")]
public class SuperAwesomeActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.main);
@Cheesebaron
Cheesebaron / JavaHolder.cs
Last active March 15, 2023 19:30
C# to Java object wrapper
using System;
public class JavaHolder : Java.Lang.Object
{
public readonly object Instance;
public JavaHolder(object instance)
{
Instance = instance;
}
@Cheesebaron
Cheesebaron / Chemical.cs
Last active March 15, 2023 19:30
Custom Adapter with Filter
namespace SearchViewSample
{
public class Chemical
{
public string Name { get; set; }
public int DrawableId { get; set; }
}
}
@Cheesebaron
Cheesebaron / Main.axml
Last active March 15, 2023 19:30
Small sample showing how to use SearchView with the Support v7 ActionBar. See the tutorial here: http://youtu.be/4FvObC44bhM
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@+id/listView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
private NSObject _notification;
private float _scrollAmount;
private double _animationDuration;
private UIViewAnimationCurve _animationCurve;
public override void ViewDidLoad()
{
...
_notification = UIKeyboard.Notifications.ObserveWillShow((s, e) =>
@Cheesebaron
Cheesebaron / DroidExtensions.cs
Created January 17, 2014 09:01
IMenuItem disabled color change.
public static class DroidExtensions
{
public static IMenuItem SetEnabled(this IMenuItem item, bool enabled, Context context, int iconId)
{
return item.SetEnabled(enabled, context, iconId, Color.Gray);
}
public static IMenuItem SetEnabled(this IMenuItem item, bool enabled, Context context, int iconId, Color disabledColor)
{
var resIcon = context.Resources.GetDrawable(iconId);
@Cheesebaron
Cheesebaron / calc.py
Created December 19, 2013 17:59
Just a stupid calculator
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 19 18:15:29 2013
@author: Tomasz
"""
import math, os
class Calc():
public class MvxActionBarActivity
: MvxActionBarEventSourceActivity
, IMvxAndroidView
{
public MvxActionBarActivity()
{
BindingContext = new MvxAndroidBindingContext(this, this);
this.AddEventListeners();
}