Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I added support for Android X #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ buildscript {
maven {
url "https://plugins.gradle.org/m2/"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-beta1'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "com.github.dcendents:android-maven-gradle-plugin:1.4.1"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
}
Expand All @@ -17,6 +18,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
51 changes: 25 additions & 26 deletions example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
compileSdkVersion 29

signingConfigs {

def pathToProperties = "keyz/signing.properties"
if (!(file(pathToProperties)).exists()) {
throw new GradleException("You have to specify a valid signing properties file.")
}
Properties props = new Properties()
props.load(new FileInputStream(file(pathToProperties)))

release {
keyAlias props['keyAlias']
keyPassword props['keyPassword']
storePassword props['storePassword']
storeFile file('keyz/keystore.jks')
}

}
// signingConfigs {
//
// def pathToProperties = "keyz/signing.properties"
// if (!(file(pathToProperties)).exists()) {
// throw new GradleException("You have to specify a valid signing properties file.")
// }
// Properties props = new Properties()
// props.load(new FileInputStream(file(pathToProperties)))
//
// release {
// keyAlias props['keyAlias']
// keyPassword props['keyPassword']
// storePassword props['storePassword']
// storeFile file('keyz/keystore.jks')
// }
//
// }

defaultConfig {
applicationId "com.futuremind.recyclerviewfastscroll.example"
Expand All @@ -32,17 +31,17 @@ android {
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.release
// signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':fastscroll')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':fastscroll')
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.futuremind.recyclerviewfastscroll.example;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import com.google.android.material.tabs.TabLayout;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;

import com.futuremind.recyclerviewfastscroll.example.adapters.ExampleFragmentsAdapter;

Expand All @@ -14,8 +14,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

ViewPager pager = (ViewPager) findViewById(R.id.pager);
TabLayout tabs = (TabLayout) findViewById(R.id.tab_layout);
ViewPager pager = findViewById(R.id.pager);
TabLayout tabs = findViewById(R.id.tab_layout);

pager.setAdapter(new ExampleFragmentsAdapter(this, getSupportFragmentManager()));
tabs.setupWithViewPager(pager);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.futuremind.recyclerviewfastscroll.example.adapters;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.futuremind.recyclerviewfastscroll.example.adapters;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import com.futuremind.recyclerviewfastscroll.example.R;
import com.futuremind.recyclerviewfastscroll.example.fragments.CustomViewFragment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.support.annotation.AnimatorRes;
import android.support.annotation.Nullable;
import androidx.annotation.AnimatorRes;
import androidx.annotation.Nullable;
import android.view.View;

import com.futuremind.recyclerviewfastscroll.viewprovider.ViewBehavior;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.futuremind.recyclerviewfastscroll.example.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -23,8 +23,8 @@ public abstract class ExampleFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View layout = LayoutInflater.from(getActivity()).inflate(getLayoutId(), container, false);

RecyclerView recyclerView = (RecyclerView) layout.findViewById(R.id.recyclerview);
fastScroller = (FastScroller) layout.findViewById(R.id.fastscroll);
RecyclerView recyclerView = layout.findViewById(R.id.recyclerview);
fastScroller = layout.findViewById(R.id.fastscroll);

recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
CountriesAdapter adapter = new CountriesAdapter(getActivity());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.futuremind.recyclerviewfastscroll.example.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
4 changes: 2 additions & 2 deletions example/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
android:orientation="vertical"
tools:context=".MainActivity">

<android.support.design.widget.TabLayout
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorHeight="4dp"
app:tabIndicatorColor="#455099"/>

<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Expand Down
2 changes: 1 addition & 1 deletion example/src/main/res/layout/fragment_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion example/src/main/res/layout/fragment_horizontal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:padding="16dp"
android:background="#cacaca">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="0dp"
Expand Down
2 changes: 1 addition & 1 deletion example/src/main/res/layout/fragment_styled.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
10 changes: 4 additions & 6 deletions fastscroll/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
compileSdkVersion 29

resourcePrefix "fastscroll__"

defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
targetSdkVersion 29
versionCode rootProject.versionCode
versionName rootProject.versionName
}
Expand Down Expand Up @@ -143,8 +142,7 @@ bintray {
}
}


dependencies {
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:recyclerview-v7:$supportVersion"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.widget.TextViewCompat;
import android.support.v7.widget.RecyclerView;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.widget.TextViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.futuremind.recyclerviewfastscroll;

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

import java.util.ArrayList;
import java.util.List;

/**
* Created by Michal on 04/08/16.
* Responsible for updating the handle / bubble position when user scrolls the {@link android.support.v7.widget.RecyclerView}.
* Responsible for updating the handle / bubble position when user scrolls the {@link RecyclerView}.
*/
public class RecyclerViewScrollListener extends RecyclerView.OnScrollListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class Utils {

public static float getViewRawY(View view) {
int[] location = new int[2];
location[0] = 0;
location[1] = (int) view.getY();
((View)view.getParent()).getLocationInWindow(location);
return location[1];
Expand All @@ -20,7 +19,6 @@ public static float getViewRawY(View view) {
public static float getViewRawX(View view) {
int[] location = new int[2];
location[0] = (int) view.getX();
location[1] = 0;
((View)view.getParent()).getLocationInWindow(location);
return location[0];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.futuremind.recyclerviewfastscroll.viewprovider;

import android.graphics.drawable.InsetDrawable;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.futuremind.recyclerviewfastscroll.viewprovider;

import android.content.Context;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.animation.AnimatorInflater;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.support.annotation.AnimatorRes;
import androidx.annotation.AnimatorRes;
import android.view.View;

import com.futuremind.recyclerviewfastscroll.R;
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=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 @@
#Wed Dec 28 11:50:15 CET 2016
#Sun Jun 23 18:48:06 IRDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip