Skip to content

Instantly share code, notes, and snippets.

View dbeattie71's full-sized avatar

Derek Beattie dbeattie71

  • Nebraska
  • 22:02 (UTC -05:00)
View GitHub Profile
@dbeattie71
dbeattie71 / FixedFragmentStatePagerAdapter.cs
Last active December 5, 2015 04:11
FragmentStatePager ports
//From here:
//https://github.com/adamsp/FragmentStatePagerIssueExample/blob/master/app/src/main/java/com/example/fragmentstatepagerissueexample/app/FixedFragmentStatePagerAdapter.java
using System;
using System.Collections.Generic;
using System.Linq;
using Android.OS;
using Android.Runtime;
using Android.Support.V4.App;
using Android.Support.V4.View;
@dbeattie71
dbeattie71 / expand-collapse.java
Created November 5, 2015 20:58 — forked from ZkHaider/expand-collapse.java
Simple Expand / Collapse RecyclerView Item
public static class ExampleViewHolder extends RecyclerView.ViewHolder
implements View.OnClickListener {
private int originalHeight = 0;
private boolean isViewExpanded = false;
private YourCustomView yourCustomView
public ExampleViewHolder(View v) {
super(v);
v.setOnClickListener(this);
/*
* Copyright 2015 Laurens Muller.
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
// Copyright 2012 Square, Inc.
package com.squareup.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
/** Maintains an aspect ratio based on either width or height. Disabled by default. */
public class AspectRatioImageView extends ImageView {
{
"result": [
{
"id": "site-81",
"name": "Site: Test Website",
"name2": "All Users",
"image": "http:\\/\\/assets-cloud.enjin.com\\/users\\/109\\/avatar\\/medium.1422923371.png",
"type": "site"
},
{

Results of some experiments to determine which Activity lifecycle methods get called in certain situations.

Scenario: Launch app from home, then return home

Launch:

  • activity.onCreate()
  • activity.onStart()
  • activity.onResume()
  • activity.onWindowFocusChanged(true)
public abstract class SearchFilterAdapterBase : MvxAdapter, IFilterable
{
protected SearchFilterAdapterBase(Context context)
: base(context) {}
protected SearchFilterAdapterBase(Context context, IMvxAndroidBindingContext bindingContext)
: base(context, bindingContext) {}
protected abstract Filter CreateFilter();
/// <summary>
/// Tint-aware version of MvxSpinner so that it's styled properly
/// with AppCompat V21
/// </summary>
public class MvxAppCompatSpinner : MvxSpinner, ITintableBackgroundView
{
private static readonly int[] TintAttrs =
{
Android.Resource.Attribute.Background,
Android.Resource.Attribute.PopupBackground
@dbeattie71
dbeattie71 / EditorCell.cs
Created April 25, 2015 23:41
Xamarin Forms customcell binding example
public class EditorCell : ViewCell
{
public static readonly BindableProperty TextProperty = BindableProperty.Create<EditorCell, string>(p => p.Text, null, BindingMode.TwoWay);
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
a8bms1vbgt1ljiq9t45j5raa16