Skip to content

Instantly share code, notes, and snippets.

View Ankhee's full-sized avatar

IgorSapijaszko Ankhee

View GitHub Profile
@bowmanb
bowmanb / RxJavaCollectExample.java
Last active February 22, 2020 14:07
RxJava collect() example. Converting a list of phrases into a list of their IDs only.
@Override
public void onNext(ArrayList<Phrase> phrases) {
ArrayList<Integer> phraseIDs = new ArrayList<>();
Observable
.from(phrases)
.collect(phraseIDs, new Action2<ArrayList<Integer>, Phrase>() {
@Override
public void call(ArrayList<Integer> integers, Phrase phrase) {
integers.add(phrase.getId());
}
@TomTasche
TomTasche / AndroidManifest.xml
Last active May 11, 2023 20:00
OAuth flow using the AccountManager on Android
<!-- ... -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- ... -->
@fjfish
fjfish / SearchableAdapter.java
Created June 30, 2012 15:48
Simple String Adapter for Android ListView that has a filter that gives whatever it finds and ignores word boundaries
package com.yourco.yourapp;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;