Skip to content

Commit d0ecbfe

Browse files
Merge pull request #3 from mobile-simformsolutions/feature/UNT-T5346_create_saperate_module
UNT-T5356 created separate module
2 parents cb501e9 + abfd2c0 commit d0ecbfe

File tree

33 files changed

+409
-18
lines changed

33 files changed

+409
-18
lines changed

PullToRefresh/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99
buildToolsVersion "30.0.3"
1010

1111
defaultConfig {
12-
applicationId "com.example.pulltorefresh"
12+
applicationId "com.simform.pulltorefresh"
1313
minSdkVersion 16
1414
targetSdkVersion 30
1515
versionCode 1
@@ -44,9 +44,9 @@ dependencies {
4444
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
4545
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
4646

47-
// Lottie
48-
implementation 'com.airbnb.android:lottie:3.7.0'
49-
5047
// Coroutines
5148
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
49+
50+
// SSPullToRefresh
51+
implementation project(':sspulltorefresh')
5252
}
6 KB
Binary file not shown.

PullToRefresh/app/src/main/java/com/simform/demo/MainActivity.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import android.os.Bundle
66
import android.view.ViewGroup
77
import android.widget.Toast
88
import androidx.recyclerview.widget.LinearLayoutManager
9-
import com.airbnb.lottie.LottieDrawable
109
import com.example.pulltorefresh.R
11-
import com.simform.refresh.DefaultAnimationView
12-
import com.simform.refresh.SSDragDistanceConverter
1310
import com.simform.refresh.SSPullToRefreshLayout
1411
import kotlinx.android.synthetic.main.activity_main.cpr
1512
import kotlinx.android.synthetic.main.activity_main.rv
@@ -28,7 +25,7 @@ class MainActivity : AppCompatActivity() {
2825
title = "SSPullToRefresh"
2926

3027
setUpRecyclerView()
31-
cpr.setOnRefreshListener(object : SSPullToRefreshLayout.OnRefreshListener {
28+
cpr.setOnRefreshListener(object : com.simform.refresh.SSPullToRefreshLayout.OnRefreshListener {
3229
override fun onRefresh() {
3330
GlobalScope.launch {
3431
delay(3000)
@@ -41,14 +38,14 @@ class MainActivity : AppCompatActivity() {
4138
}
4239
})
4340

44-
cpr.setDragDistanceConverter(SSDragDistanceConverter())
41+
cpr.setDragDistanceConverter(com.simform.refresh.SSDragDistanceConverter())
4542
cpr.setLottieAnimation("lottie_isometric-plane.json")
4643
cpr.setRefreshView(
47-
DefaultAnimationView(this),
44+
com.simform.refresh.DefaultAnimationView(this),
4845
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,300)
4946
)
50-
cpr.setRepeatMode(LottieDrawable.RESTART)
51-
cpr.setRepeatCount(ValueAnimator.INFINITE)
47+
cpr.setRepeatMode(SSPullToRefreshLayout.RepeatMode.REPEAT)
48+
cpr.setRepeatCount(SSPullToRefreshLayout.RepeatCount.INFINITE)
5249
cpr.setRefreshStyle(SSPullToRefreshLayout.RefreshStyle.NORMAL)
5350
}
5451

PullToRefresh/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
rootProject.name = "PullToRefresh"
22
include ':app'
3+
include ':sspulltorefresh'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
plugins {
2+
id 'com.android.library'
3+
id 'kotlin-android'
4+
}
5+
6+
android {
7+
compileSdkVersion 30
8+
buildToolsVersion "30.0.3"
9+
10+
defaultConfig {
11+
12+
minSdkVersion 16
13+
targetSdkVersion 30
14+
versionCode 1
15+
versionName "1.0"
16+
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18+
}
19+
20+
buildTypes {
21+
release {
22+
minifyEnabled false
23+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24+
}
25+
}
26+
compileOptions {
27+
sourceCompatibility JavaVersion.VERSION_1_8
28+
targetCompatibility JavaVersion.VERSION_1_8
29+
}
30+
kotlinOptions {
31+
jvmTarget = '1.8'
32+
}
33+
}
34+
35+
dependencies {
36+
37+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
38+
implementation 'androidx.core:core-ktx:1.5.0'
39+
implementation 'androidx.appcompat:appcompat:1.3.0'
40+
implementation 'com.google.android.material:material:1.3.0'
41+
testImplementation 'junit:junit:4.+'
42+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
43+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
44+
45+
// Lottie
46+
implementation 'com.airbnb.android:lottie:3.7.0'
47+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.simform.refresh
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.simform.refresh", appContext.packageName)
23+
}
24+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.simform.refresh">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/Theme.PullToRefresh" />
12+
13+
</manifest>

0 commit comments

Comments
 (0)