This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.mockito.Mock; | |
import static org.mockito.Mockito.when; | |
@Mock | |
private Context mockApplicationContext; | |
@Mock | |
private Resources mockContextResources; | |
@Mock | |
private SharedPreferences mockSharedPreferences; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix. | |
All Clickable Views: | |
----------- | |
* ripple effect (Lollipop only) -- "colorControlHighlight" | |
Status Bar: | |
------------ | |
* background (Lollipop only) - "colorPrimaryDark" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LICENSE: USE IT IF YOU NEED IT, BUT PLEASE MENTION AT LEAST MY NAME, THANKS! | |
// (Juraj Suchán, juraj.suchan@gmail.com) | |
// | |
// PREFACE: | |
// So i've been building client application for one local "closed community" | |
// nyx.cz for year and a half where the displayed content is standard html code. | |
// | |
// There is Html.fromHtml to the rescue for that! But unfortunatelly, anyone who tried it | |
// have to deal with custom Html.ImageGetter implementation. | |
// This interface contains only one method, with only one paramter (url) and it's completelly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LICENSE: USE IT IF YOU NEED IT, BUT PLEASE MENTION AT LEAST MY NAME, THANKS! | |
// (Juraj Suchán, juraj.suchan@gmail.com) | |
// | |
package sk.virtualvoid.nyxdroid.utils; | |
import java.io.File; | |
import java.lang.ref.WeakReference; | |
import java.util.Collections; | |
import java.util.Map; | |
import java.util.WeakHashMap; |