Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

buildscript {
repositories {
google() // here
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:3.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -14,16 +19,21 @@ buildscript {

allprojects {
repositories {
google() // here
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
}

ext {
compileSdkVersion = 23
buildToolsVersion = '23.0.2'
supportLibsVersion = '23.1.1'
targetSdkVersion = 22
minSdkVersion = 11
versionCode = 13
versionName = "0.4.3"
compileSdkVersion = 28
buildToolsVersion = '28.0.3'
supportLibsVersion = '28.0.0'
targetSdkVersion = 28
minSdkVersion = 14
versionCode = 14
versionName = "0.4.4"
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=jacobtabak
POM_DEVELOPER_NAME=Jacob Tabak
POM_DEVELOPER_NAME=Jacob Tabak
android.useAndroidX=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Dec 12 10:27:39 CST 2014
#Wed Oct 24 22:25:20 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6 changes: 3 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ android {
versionName rootProject.ext.versionName as String
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile "com.android.support:recyclerview-v7:${rootProject.supportLibsVersion}"
compile 'androidx.recyclerview:recyclerview:1.0.0'
}

apply from: 'gradle-maven-push.gradle'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.timehop.stickyheadersrecyclerview;

import android.graphics.Rect;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
Expand All @@ -11,6 +9,9 @@
import com.timehop.stickyheadersrecyclerview.calculation.DimensionCalculator;
import com.timehop.stickyheadersrecyclerview.util.OrientationProvider;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

/**
* Calculates the position and location of header views
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.timehop.stickyheadersrecyclerview;

import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

import androidx.recyclerview.widget.RecyclerView;

public interface StickyRecyclerHeadersAdapter<VH extends RecyclerView.ViewHolder> {
/**
* Get the ID of the header associated with this item. For example, if your headers group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import android.graphics.Canvas;
import android.graphics.Rect;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.SparseArray;
import android.view.View;

Expand All @@ -14,6 +12,9 @@
import com.timehop.stickyheadersrecyclerview.util.LinearLayoutOrientationProvider;
import com.timehop.stickyheadersrecyclerview.util.OrientationProvider;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

public class StickyRecyclerHeadersDecoration extends RecyclerView.ItemDecoration {

private final StickyRecyclerHeadersAdapter mAdapter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.timehop.stickyheadersrecyclerview;

import android.support.v7.widget.RecyclerView;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.SoundEffectConstants;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

public class StickyRecyclerHeadersTouchListener implements RecyclerView.OnItemTouchListener {
private final GestureDetector mTapDetector;
private final RecyclerView mRecyclerView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.timehop.stickyheadersrecyclerview.caching;

import android.support.v7.widget.RecyclerView;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

/**
* Implemented by objects that provide header views for decoration
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.timehop.stickyheadersrecyclerview.caching;

import android.support.v4.util.LongSparseArray;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersAdapter;
import com.timehop.stickyheadersrecyclerview.util.OrientationProvider;

import androidx.collection.LongSparseArray;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

/**
* An implementation of {@link HeaderProvider} that creates and caches header views
*/
Expand All @@ -24,6 +25,7 @@ public HeaderViewCache(StickyRecyclerHeadersAdapter adapter,
mOrientationProvider = orientationProvider;
}


@Override
public View getHeader(RecyclerView parent, int position) {
long headerId = mAdapter.getHeaderId(position);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import android.graphics.Canvas;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;

import com.timehop.stickyheadersrecyclerview.calculation.DimensionCalculator;
import com.timehop.stickyheadersrecyclerview.util.OrientationProvider;

import androidx.recyclerview.widget.RecyclerView;

/**
* Responsible for drawing headers to the canvas provided by the item decoration
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.timehop.stickyheadersrecyclerview.util;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

/**
* OrientationProvider for ReyclerViews who use a LinearLayoutManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.timehop.stickyheadersrecyclerview.util;

import android.support.v7.widget.RecyclerView;

import androidx.recyclerview.widget.RecyclerView;

/**
* Interface for getting the orientation of a RecyclerView from its LayoutManager
Expand Down
6 changes: 3 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ android {
versionName rootProject.ext.versionName as String
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile project(':library')
compile "com.android.support:appcompat-v7:${rootProject.supportLibsVersion}"
compile 'androidx.appcompat:appcompat:1.0.0'
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.timehop.stickyheadersrecyclerview.sample;

import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

import androidx.recyclerview.widget.RecyclerView;


/**
* Adapter holding a list of animal names of type String. Note that each item must be unique.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;


public class DividerDecoration extends RecyclerView.ItemDecoration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -22,6 +19,10 @@

import java.security.SecureRandom;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

public class MainActivity extends AppCompatActivity {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.timehop.stickyheadersrecyclerview.sample;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener {
private OnItemClickListener mListener;

Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

</LinearLayout>

<android.support.v7.widget.RecyclerView
<androidx.appcompat.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down