Skip to content

Instantly share code, notes, and snippets.

@roubachof
roubachof / AnchorBottomSheetBehavior.DragCallback.cs
Last active May 12, 2019 19:07
Xamarin Android - Google maps bottom sheet behavior, a BottomSheetBehavior with an added state - Xamarin port of google BottomSheetStyle
using System;
using Android.Support.V4.View;
using Android.Support.V4.Widget;
using Android.Views;
using Debug = System.Diagnostics.Debug;
namespace SillyCompany
{
public enum AnchorBottomSheetState
@claudijo
claudijo / README.md
Last active July 24, 2023 03:52
An Android view for typewriting-like animations

TypewriterView

An Android view that can be used to sequentially animate typing and deleting one character at a time. Pausing and enqueuing arbitrary Runnables is also possible. Inspired by Devunwired @ Stackoverflow (see http://stackoverflow.com/questions/6700374/android-character-by-character-display-text-animation).

An EditText view has been used as base to get a blinking cursor. This has the drawback that the user could edit the text while it is animating. Minimum changes to the code are required to instead use a TextView as base if that is an issue.

Example

TypewriterView typewriterView = (TypewriterView) view.findViewById(R.id.typewriter);
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Markup;
using Cirrious.CrossCore.Wpf.Converters;
using Cirrious.MvvmCross.Localization;
@jorisvergeer
jorisvergeer / RoutedViewHost.cs
Created April 17, 2015 07:32
ReactiveUI RoutedViewHost for Xamarin-Android
using System;
using System.Reactive.Linq;
using Android.App;
using ReactiveUI;
namespace ReactiveUI
{
class RoutedViewHost : ReactiveObject
{
RoutingState _router;
@Shywim
Shywim / CursorRecyclerAdapter.java
Last active February 28, 2025 09:59
A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc.
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matthieu Harlé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@ishitcno1
ishitcno1 / UserPanelDialogFragment.java
Created March 7, 2014 09:14
A custom DialogFragment that can be positioned and set size. Make sure to use 9patch background. Ref: http://stackoverflow.com/questions/9698410/position-of-dialogfragment-in-android
public class UserPanelDialogFragment extends DialogFragment implements View.OnClickListener {
private boolean isLogin = false;
private TextView mRegister;
private TextView mLogin;
private TextView mFeedback;
private TextView mUserId;
private TextView mLogout;
@jerrellmardis
jerrellmardis / RoundedRelativeLayout.java
Last active May 11, 2018 06:22
A {@link android.widget.RelativeLayout} that supports rounded corners and proper child view clipping. Perfect for situations where you have full bleed images that you want clipped to the bounds of this layout.
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
/**
* A {@link android.widget.RelativeLayout} that supports rounded corners.
@philcleveland
philcleveland / rx_OAPHprop.snippet
Last active June 28, 2016 23:05
RxUI VS snippets
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Rx ObservableAsPropertyHelper</Title>
<Shortcut>rxOAPH</Shortcut>
<Description>Code snippet for a ReactiveUI ObservableAsPropertyHelper</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
@bjoernQ
bjoernQ / AndroidManifest.xml
Created October 14, 2013 13:02
Creating a System Overlay (Always on Top over all Apps) in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.mobilej.overlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application android:label="SystemOverlay" >
<activity
@EdVinyard
EdVinyard / IsOverride.cs
Created May 13, 2013 20:56
test if a method is an override; i.e., it overrides the implementation of the same method in a base class
using System.Reflection;
using NUnit.Framework;
public static class MethodInfoExtensions
{
public static bool IsOverride(this MethodInfo m)
{
return m.GetBaseDefinition().DeclaringType != m.DeclaringType;
}
}