We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a7a5a6 commit ceeec79Copy full SHA for ceeec79
app/src/main/java/com/runnect/runnect/util/extension/ActivityExt.kt
@@ -1,8 +1,25 @@
1
package com.runnect.runnect.util.extension
2
3
import android.app.Activity
4
+import android.content.Intent
5
import com.runnect.runnect.R
6
7
+/**
8
+ * 애니메이션과 함께 새로운 액티비티를 시작합니다.
9
+ *
10
+ * @param intentBuilder 새로 시작할 액티비티의 [Intent]
11
+ * @param withFinish 현재 액티비티를 종료할 지 여부
12
+ */
13
+inline fun <reified T : Activity> Activity.startActivityWithAnimation(
14
+ intentBuilder: Intent.() -> Intent = { this },
15
+ withFinish: Boolean = false,
16
+) {
17
+ startActivity(intentBuilder(Intent(this, T::class.java)))
18
+ applyScreenEnterAnimation()
19
+
20
+ if (withFinish) finish()
21
+}
22
23
fun Activity.navigateToPreviousScreenWithAnimation() {
24
finish()
25
applyScreenExitAnimation()
0 commit comments