Skip to content

Instantly share code, notes, and snippets.

@aubryll
aubryll / Private route usage
Created Aug 2, 2020
Keycloak react private route that accepts a route with params, possible answer to this question https://github.com/the-glue/react-router-keycloak/issues/7
View Private route usage
<PrivateRoute exact path="/props-through-render" render={(props) => <PropsPage {...props} title={`Props through render`} />} />
@aubryll
aubryll / ListAdapterWithHeader.java
Created Nov 24, 2019
This is the Java version of NickHolcombe's ListAdapterWithHeader which was originally wrote in Kotlin, after spending countless hours online looking for a way to add a header to my PagedListAdapter I finally found a solution https://gist.github.com/NickHolcombe/0e1c27892d6b73271f10e12268f40187 except it was in Kotlin, I managed to rewrite it in …
View ListAdapterWithHeader.java
import androidx.recyclerview.widget.AsyncDifferConfig;
import androidx.recyclerview.widget.AsyncListDiffer;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;