INSERT GRAPHIC HERE (include hyperlink in image)
Subtitle or Short Description Goes Here
ideally one sentence >
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; |
/** | |
* Text view that allows changing the letter spacing of the text. | |
* | |
* @author Pedro Barros (pedrobarros.dev at gmail.com) | |
* @since May 7, 2013 | |
*/ | |
public static class LetterSpacingTextView extends TextView { | |
private float spacing = Spacing.NORMAL; | |
private CharSequence originalText = ""; |
// app module build.gradle | |
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion rootProject.compileSdkVersion | |
buildToolsVersion rootProject.buildToolsVersion | |
defaultConfig { | |
applicationId "com.segunfamisa.gradleextraproperties" | |
minSdkVersion rootProject.minSdkVersion | |
targetSdkVersion rootProject.targetSdkVersion |
public class MaxHeightLinearLayout extends LinearLayout { | |
private int maxHeightDp; | |
public MaxHeightLinearLayout(Context context) { | |
super(context); | |
} | |
public MaxHeightLinearLayout(Context context, AttributeSet attrs) { | |
super(context, attrs); |
package com.tinmegali.daggerwithkotlin.room | |
import android.arch.persistence.room.Database | |
import android.arch.persistence.room.RoomDatabase | |
import android.arch.persistence.room.TypeConverters | |
import com.tinmegali.daggerwithkotlin.room.daos.NoteDAO | |
import com.tinmegali.daggerwithkotlin.room.daos.UserDAO | |
import com.tinmegali.daggerwithkotlin.room.entities.Note | |
import com.tinmegali.daggerwithkotlin.room.entities.User |
Remember not to snooze, get some natural light on your face, and turn on as many lights as you can to signal to your body that it’s time to be awake. If you don’t shower immediately, try washing your face right after getting up to help your eyes feel more awake, too.
/* | |
* Copyright (C) 2017 The Android Open Source Project | |
* | |
* 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 |
/* | |
You need to call the below method once. It register the callback and fire it when there is a change in network state. | |
Here I used a Global Static Variable, So I can use it to access the network state in anyware of the application. | |
*/ | |
// You need to pass the context when creating the class | |
public CheckNetwork(Context context) { | |
this.context = context; | |
} |