Skip to content

Commit

Permalink
Revert "resolve issue valkriaine#9"
Browse files Browse the repository at this point in the history
This reverts commit abad13d
  • Loading branch information
valkriaine committed Jul 28, 2021
1 parent 689ca82 commit 90e0b62
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 47 deletions.
5 changes: 0 additions & 5 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions bouncy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'maven-publish'

def libraryGroupId = 'com.factor'
def libraryArtifactId = 'bouncy'
def libraryVersion = '1.61'
def libraryVersion = '1.7'


task androidJavadocs(type: Javadoc) {
Expand Down Expand Up @@ -59,10 +59,10 @@ bintray {
vcsUrl = 'https://github.com/Valkriaine/bouncy.git'
publicDownloadNumbers = true
version {
name = '1.61'
desc = '1.61 release'
name = '1.7'
desc = '1.7 release'
released = new Date()
vcsTag = '1.61'
vcsTag = '1.7'
}
}
}
Expand All @@ -74,8 +74,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 30
versionCode 8
versionName "1.61"
versionCode 9
versionName "1.7"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
18 changes: 7 additions & 11 deletions bouncy/src/main/java/com/factor/bouncy/BouncyRecyclerView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BouncyRecyclerView(context: Context, attrs: AttributeSet?) : RecyclerView(

var flingAnimationSize = 0.5f

var orientation : Int? = VERTICAL
var orientation : Int? = 1
set(value)
{
field = value
Expand Down Expand Up @@ -110,26 +110,22 @@ class BouncyRecyclerView(context: Context, attrs: AttributeSet?) : RecyclerView(
private fun setupDirection(orientation : Int?)
{

if (stiffness > 0F)
when (orientation)
{
when (orientation)
{
HORIZONTAL -> spring = SpringAnimation(this, SpringAnimation.TRANSLATION_X)
.setSpring(SpringForce()
HORIZONTAL -> spring = SpringAnimation(this, SpringAnimation.TRANSLATION_X)
.setSpring(SpringForce()
.setFinalPosition(0f)
.setDampingRatio(dampingRatio)
.setStiffness(stiffness))

VERTICAL -> spring = SpringAnimation(this, SpringAnimation.TRANSLATION_Y)
.setSpring(SpringForce()
VERTICAL -> spring = SpringAnimation(this, SpringAnimation.TRANSLATION_Y)
.setSpring(SpringForce()
.setFinalPosition(0f)
.setDampingRatio(dampingRatio)
.setStiffness(stiffness))

}
}

Log.wtf("stiffness", "stiffness: $stiffness")
Log.wtf("orientation", "orientation: $orientation")
}

init {
Expand Down
15 changes: 7 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.21"
ext.kotlin_version = "1.4.21"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.android.tools.build:gradle:4.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id "com.jfrog.artifactory" version "4.24.14"
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete){
task clean(type: Delete) {
delete rootProject.buildDir
}
}
19 changes: 7 additions & 12 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
buildToolsVersion "30.0.2"

defaultConfig {
minSdkVersion 14
Expand All @@ -21,24 +21,19 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation project(path: ':bouncy')
}
1 change: 1 addition & 0 deletions example/src/main/java/com/factor/example/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ class MainActivity : AppCompatActivity()


findViewById<BouncyRecyclerView>(R.id.rc).adapter = MyAdapter(30)
findViewById<BouncyRecyclerView>(R.id.rc).layoutManager = GridLayoutManager(this, 2, GridLayoutManager.VERTICAL, false)
}
}
1 change: 0 additions & 1 deletion example/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<com.factor.bouncy.BouncyRecyclerView
android:id="@+id/rc"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:allow_item_swipe="true"
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ org.gradle.jvmargs=-Xmx2048m
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=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 @@
#Wed Jul 28 07:51:13 CST 2021
#Tue Jan 12 12:08:21 PST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 90e0b62

Please sign in to comment.