Skip to content

Commit f7fa034

Browse files
committed
fix gradle build library
1 parent b454357 commit f7fa034

4 files changed

Lines changed: 2 additions & 47 deletions

File tree

KtExt/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,5 @@ android {
3535
dependencies {
3636
implementation fileTree(dir: 'libs', include: ['*.jar'])
3737
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.0"
38-
implementation "androidx.appcompat:appcompat:1.3.0"
39-
implementation 'com.google.android.material:material:1.3.0'
40-
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-alpha02"
38+
implementation "androidx.appcompat:appcompat:1.3.1"
4139
}

KtExt/src/main/java/com/thuanpx/ktext/context/ActivityExt.kt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,15 @@ import androidx.annotation.NonNull
1717
import androidx.core.content.ContextCompat
1818
import androidx.fragment.app.Fragment
1919
import androidx.fragment.app.FragmentActivity
20-
import androidx.lifecycle.Lifecycle
21-
import androidx.lifecycle.LifecycleOwner
22-
import androidx.lifecycle.lifecycleScope
23-
import androidx.lifecycle.repeatOnLifecycle
2420
import com.thuanpx.ktext.AnimationType
2521
import com.thuanpx.ktext.Constant
2622
import com.thuanpx.ktext.SLIDE_TO_LEFT
27-
import kotlinx.coroutines.CoroutineScope
28-
import kotlinx.coroutines.flow.Flow
29-
import kotlinx.coroutines.launch
3023
import kotlin.reflect.KClass
3124

3225
/**
3326
* Created by ThuanPx on 3/15/20.
3427
*/
3528

36-
/**
37-
* Launches a new coroutine and repeats `block` every time the Activity's viewLifecycleOwner
38-
* is in and out of `minActiveState` lifecycle state.
39-
* Source: https://medium.com/androiddevelopers/repeatonlifecycle-api-design-story-8670d1a7d333
40-
*/
41-
inline fun FragmentActivity.launchAndRepeatWithViewLifecycle(
42-
minActiveState: Lifecycle.State = Lifecycle.State.STARTED,
43-
crossinline block: suspend CoroutineScope.() -> Unit
44-
) {
45-
this.lifecycleScope.launch {
46-
this@launchAndRepeatWithViewLifecycle.lifecycle.repeatOnLifecycle(minActiveState) {
47-
block()
48-
}
49-
}
50-
}
5129

5230
fun <T : Activity> FragmentActivity.goTo(
5331
cls: KClass<T>,

KtExt/src/main/java/com/thuanpx/ktext/context/FragmentExt.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,12 @@ import androidx.annotation.IdRes
88
import androidx.fragment.app.Fragment
99
import androidx.fragment.app.FragmentManager
1010
import androidx.fragment.app.FragmentTransaction
11-
import androidx.lifecycle.Lifecycle
12-
import androidx.lifecycle.lifecycleScope
13-
import androidx.lifecycle.repeatOnLifecycle
1411
import com.thuanpx.ktext.*
15-
import kotlinx.coroutines.CoroutineScope
16-
import kotlinx.coroutines.launch
1712

1813
/**
1914
* Created by ThuanPx on 3/15/20.
2015
*/
2116

22-
/**
23-
* Launches a new coroutine and repeats `block` every time the Fragment's viewLifecycleOwner
24-
* is in and out of `minActiveState` lifecycle state.*
25-
* Source: https://medium.com/androiddevelopers/repeatonlifecycle-api-design-story-8670d1a7d333
26-
*/
27-
inline fun Fragment.launchAndRepeatWithViewLifecycle(
28-
minActiveState: Lifecycle.State = Lifecycle.State.STARTED,
29-
crossinline block: suspend CoroutineScope.() -> Unit
30-
) {
31-
viewLifecycleOwner.lifecycleScope.launch {
32-
viewLifecycleOwner.lifecycle.repeatOnLifecycle(minActiveState) {
33-
block()
34-
}
35-
}
36-
}
3717

3818
fun Fragment.replaceFragment(
3919
@IdRes containerId: Int,

app/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ android {
3232
dependencies {
3333
implementation fileTree(dir: 'libs', include: ['*.jar'])
3434
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.0"
35-
implementation "androidx.appcompat:appcompat:1.3.0"
36-
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-alpha02"
35+
implementation "androidx.appcompat:appcompat:1.3.1"
3736
implementation project(':KtExt')
3837
}

0 commit comments

Comments
 (0)