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
@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>
@Cheesebaron
Cheesebaron / Main.xml
Created June 10, 2013 21:04
Just a simple PopupMenu sample.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/MyButton"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Click Me!" />
<ImageView
@Cheesebaron
Cheesebaron / solaziredcsharp.sty
Created December 8, 2014 01:12
A solarized light theme for LaTeX C# code listings
\usepackage{listings}
\usepackage{etoolbox}
\usepackage{color}
\definecolor{base0}{RGB}{131,148,150}
\definecolor{base01}{RGB}{88,110,117}
\definecolor{base2}{RGB}{238,232,213}
\definecolor{sgreen}{RGB}{133,153,0}
\definecolor{sblue}{RGB}{38,138,210}
\definecolor{scyan}{RGB}{42,161,151}
@Cheesebaron
Cheesebaron / WebViewLocationActivity.cs
Last active March 30, 2021 20:51
WebView Location prompt sample
using Android;
using Android.App;
using Android.Content;
using Android.Webkit;
using Android.OS;
[assembly: UsesPermission(Name = Manifest.Permission.AccessFineLocation)]
[assembly: UsesPermission(Name = Manifest.Permission.Internet)]
namespace WebViewLocation
@Cheesebaron
Cheesebaron / Activity1.cs
Last active September 15, 2020 14:21
Sample showing how to use Spannables to replace text with Images in Mono for Android.
using Android.App;
using Android.Text;
using Android.Text.Style;
using Android.Widget;
using Android.OS;
namespace MonoDroid.TextViewWithImages
{
[Activity(Label = "Text with Images", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
@Cheesebaron
Cheesebaron / AwesomeView.cs
Last active June 6, 2020 10:51
Bindable SwipeRefreshLayout
[Activity(Label = "Awesome!")]
public class ValidationView
: MvxActivity<AwesomeViewModel>
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
RequestWindowFeature(WindowFeatures.ActionBar);
SetContentView(Resource.Layout.awesome_layout);
@Cheesebaron
Cheesebaron / DummyFragment.cs
Created September 6, 2014 15:43
Removing Fragments from ViewPager
public class DummyFragment : Fragment
{
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var view = inflater.Inflate(Resource.Layout.dummy_frag, container, false);
var tv = view.FindViewById<TextView>(Resource.Id.textView1);
tv.Text = "" + Arguments.GetInt("number", -1);
return view;
}
}