Skip to content

Instantly share code, notes, and snippets.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

package com.materialdesign.chris.materialdesignexperimenting;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewAnimationUtils;
package com.example.appli;
import android.app.Activity;
import android.content.Intent;
import android.test.ActivityInstrumentationTestCase2;
import com.example.appli.TestUtils;
public class MainActivityTest extends ActivityInstrumentationTestCase2<TestActivity> {
/*
* Copyright (C) 2014 I.C.N.H GmbH
*
* 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 (C) 2014 Chris Banes
*
* 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
@Module(
complete = false,
library = true,
overrides = true
)
public final class DebugApiModule {
@Provides @Singleton ApiEndpoint provideApiEndpoint(Locale locale, @ApiEndpointMarker StringPreference apiEndpoint,
@NetworkIgnoreLocale BooleanPreference ignoreLocale) {
return (ignoreLocale.get())
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Subscriber;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.functions.Func2;
import rx.observables.ConnectableObservable;
import java.util.ArrayList;
import java.util.List;
package com.firebase.client;
import com.firebase.client.core.Constants;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
public class RxFirebase {
public class CustomMatchers {
public static Matcher<View> withBackground(final int resourceId) {
return new TypeSafeMatcher<View>() {
@Override
public boolean matchesSafely(View view) {
return sameBitmap(view.getContext(), view.getBackground(), resourceId);
}
@Override