Skip to content

Instantly share code, notes, and snippets.

View runemart's full-sized avatar
🐘
https://androiddev.social/@Kvisten

Rune M. Andersen runemart

🐘
https://androiddev.social/@Kvisten
View GitHub Profile
@runemart
runemart / PC
Last active March 9, 2020 16:55
Corsair Carbide 100R Silent Edition 645 helt ny
Noctua NH-U12S CPU Kjøler 549 helt ny
Intel Core i7-7700K Kaby Lake CPU 2898 2 år
MSI Z270 Tomahawk, Socket-1151 1399 2 år
HyperX Fury DDR4 2400MHz 16GB 1779 2 år
Crucial 250 GB SSD ca 500 mange år
Corsair TX750W PSU ca 800 mange år
Nvidia GTX 560 Ti ca 1500 mange år
@runemart
runemart / RecyclerViewAdapterBase.java
Created February 19, 2016 08:47
RecyclerView for AndroidAnnotations
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public abstract class RecyclerViewAdapterBase<D, V extends View & ViewWrapper.Binder<D>> extends RecyclerView.Adapter<ViewWrapper<D, V>> {
<?php
require_once('BartebussAPI.class.php');
class TripAPI extends BartebussAPI {
public function __construct(){
parent::__construct();
}
@runemart
runemart / WrappingGridView.java
Created March 26, 2014 11:57
A GridView that uses the necessary height to wrap all of it's children, instead of scrolling
// http://www.jayway.com/2012/10/04/how-to-make-the-height-of-a-gridview-wrap-its-content/
public class WrappingGridView extends GridView {
public WrappingGridView(Context context) {
super(context);
}
public WrappingGridView(Context context, AttributeSet attrs) {
super(context, attrs);
@runemart
runemart / TwoKeyHashMap.java
Created March 26, 2014 11:54
Generic HashMap that takes two keys
public class TwoKeyHashMap<K1, K2, V> extends HashMap<K1, HashMap<K2, V>> {
public void put(K1 key_1, K2 key_2, V value) {
if (containsKey(key_1))
get(key_1).put(key_2, value);
else {
HashMap<K2, V> inner = new HashMap<>();
inner.put(key_2, value);
put(key_1, inner);
}
@runemart
runemart / GCMActivity
Created March 14, 2014 08:41
Android GCM activity (requires AndroidAnnotations)
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.preference.PreferenceManager;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.gcm.GoogleCloudMessaging;
import org.androidannotations.annotations.AfterInject;