-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/jaino/#35 #36
Changes from all commits
8c6050b
7762d60
3673ed6
51574b6
439ea81
51d168e
830e4fa
7fc195e
b7fbe78
8b99f10
f7e13c3
37a5c7a
7e53c6e
75ce27a
520fa2c
0829da8
997ec44
84b63e1
8c19a23
ae4f680
20f69df
c4f75c4
a246ba7
6c10d3a
5418b19
9c09787
c0b4214
b7bd047
2dac9f6
b67b922
e08ea2c
d4309fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.wap.wapp.plugin | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.VersionCatalogsExtension | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.gradle.kotlin.dsl.getByType | ||
|
||
class AndroidNavigationPlugin: Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("androidx.navigation.safeargs") | ||
} | ||
|
||
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs") | ||
|
||
dependencies{ | ||
"implementation"(libs.findLibrary("androidx-navigation-fragment-ktx").get()) | ||
"implementation"(libs.findLibrary("androidx-navigation-ui-ktx").get()) | ||
"implementation"(libs.findLibrary("androidx-navigation-compose").get()) | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.wap.wapp.core.commmon.extensions | ||
|
||
import com.google.firebase.auth.FirebaseAuthException | ||
import com.google.firebase.firestore.FirebaseFirestoreException | ||
import java.net.UnknownHostException | ||
|
||
fun Throwable.toSupportingText(): String { | ||
return when (this) { | ||
is UnknownHostException -> { | ||
"๋คํธ์ํฌ ์ฐ๊ฒฐ์ด ์ํํ์ง ์์ต๋๋ค." | ||
} | ||
is FirebaseAuthException -> { | ||
this.toSupportingText() | ||
} | ||
is FirebaseFirestoreException -> { | ||
this.toSupportingText() | ||
} | ||
else -> { | ||
"์ ์ ์๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ์์ต๋๋ค." | ||
} | ||
} | ||
} | ||
Comment on lines
+7
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ์ฌ๊ธฐ์ ์์ธ ์ฒ๋ฆฌ๋ฅผ ๋ฐ๊ณ ์์๊พผ์. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๋น๋น๋น๋น๋น ์ฌ๊ธฐ์ ์์ธ ๋ ํผ๋ฐ์ค ์์ด์ฉ |
||
|
||
fun FirebaseAuthException.toSupportingText(): String { | ||
return when (this.errorCode) { | ||
"ERROR_WEB_CONTEXT_CANCELED", "ERROR_USER_CANCELLED" -> { | ||
"๋ค์ ์๋ํด ์ฃผ์ธ์." | ||
} | ||
else -> { | ||
"์ ์ ์๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ์์ต๋๋ค." | ||
} | ||
} | ||
} | ||
|
||
fun FirebaseFirestoreException.toSupportingText(): String { | ||
return when (this.code.value()) { | ||
7 -> { | ||
"์ ๊ทผ ๊ถํ์ด ์์ต๋๋ค." | ||
} | ||
16 -> { | ||
"ํ์์ด ๋ง๋ฃ๋์์ต๋๋ค. ๋ค์ ๋ก๊ทธ์ธ ํด์ฃผ์ธ์." | ||
} | ||
else -> { | ||
"์ ์ ์๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ์์ต๋๋ค." | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.wap.wapp.core.network.di | ||
|
||
import com.google.firebase.auth.FirebaseAuth | ||
import com.google.firebase.auth.ktx.auth | ||
import com.google.firebase.firestore.FirebaseFirestore | ||
import com.google.firebase.firestore.ktx.firestore | ||
import com.google.firebase.ktx.Firebase | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object FirebaseModule { | ||
@Provides | ||
@Singleton | ||
fun providesFirebaseAuth(): FirebaseAuth = Firebase.auth | ||
|
||
@Provides | ||
@Singleton | ||
fun providesFirestore(): FirebaseFirestore = Firebase.firestore | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
package com.wap.wapp.core.network.di | ||
|
||
import com.google.firebase.auth.FirebaseAuth | ||
import com.google.firebase.auth.ktx.auth | ||
import com.google.firebase.firestore.FirebaseFirestore | ||
import com.google.firebase.firestore.ktx.firestore | ||
import com.google.firebase.ktx.Firebase | ||
import com.wap.wapp.core.network.source.user.UserDataSource | ||
import com.wap.wapp.core.network.source.user.UserDataSourceImpl | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object NetworkModule { | ||
@Provides | ||
@Singleton | ||
fun providesFirebaseAuth(): FirebaseAuth = Firebase.auth | ||
abstract class NetworkModule { | ||
|
||
@Provides | ||
@Binds | ||
@Singleton | ||
fun providesFirestore(): FirebaseFirestore = Firebase.firestore | ||
abstract fun bindsUserDataSource( | ||
userDataSourceImpl: UserDataSourceImpl, | ||
): UserDataSource | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฃ์กํฉ๋๋ค..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํํ ์ฝ๋ ๋ฆฌ๋ทฐ ๋ ๊ฒ์ฌํ์ง ๋ชปํ ์ํ์๋ ์ฑ ์์ด ์์ต๋๋ค ํํ