Skip to content
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

[REFACTOR/#123] feature 모듈 세분화 #124

Merged
merged 19 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ dependencies {
implementation(project(":core"))
implementation(project(":data"))
implementation(project(":domain"))
implementation(project(":presentation"))
implementation(project(":feature:auth"))
implementation(project(":feature:buy"))
implementation(project(":feature:main"))
implementation(project(":feature:sell"))
implementation(project(":feature:setting"))

KotlinDependencies.run {
implementation(kotlin)
Expand Down
62 changes: 26 additions & 36 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
tools:targetApi="31">

<activity
android:name="co.orange.presentation.splash.SplashActivity"
android:name="co.orange.main.splash.SplashActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
Expand All @@ -29,133 +29,123 @@
</activity>

<activity
android:name="co.orange.presentation.main.MainActivity"
android:name="co.orange.main.main.MainActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.detail.DetailActivity"
android:name="co.orange.main.detail.DetailActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.buy.progress.BuyProgressActivity"
android:name="co.orange.main.search.SearchActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.buy.push.BuyPushActivity"
android:name="co.orange.main.push.PushActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.buy.finished.BuyFinishedActivity"
android:name="co.orange.main.main.profile.ReportActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.buy.info.BuyInfoActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.search.SearchActivity"
android:name="co.orange.buy.progress.BuyProgressActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.setting.SettingActivity"
android:name="co.orange.buy.finished.BuyFinishedActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.delivery.DeliveryActivity"
android:name="co.orange.buy.info.BuyInfoActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.bank.BankActivity"
android:name="co.orange.setting.setting.SettingActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.setting.AccountActivity"
android:name="co.orange.setting.delivery.DeliveryActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.sell.onboarding.SellOnboardingActivity"
android:name="co.orange.setting.bank.BankActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.sell.progress.SellProgressActivity"
android:name="co.orange.setting.account.AccountActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.push.PushActivity"
android:name="co.orange.setting.history.HistoryActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.sell.finished.SellFinishedActivity"
android:name="co.orange.setting.delivery.address.AddressActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.sell.info.SellInfoActivity"
android:name="co.orange.setting.bank.add.BankAddActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.sell.confirm.SellConfirmActivity"
android:name="co.orange.sell.onboarding.SellOnboardingActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.auth.login.LoginActivity"
android:name="co.orange.sell.progress.SellProgressActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.auth.signup_x.SignUpActivity"
android:exported="false"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />

<activity
android:name="co.orange.presentation.auth.submit.SubmitActivity"
android:name="co.orange.sell.finished.SellFinishedActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.history.HistoryActivity"
android:name="co.orange.sell.info.SellInfoActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.auth.phone.PhoneActivity"
android:name="co.orange.sell.confirm.SellConfirmActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.delivery.address.AddressActivity"
android:name="co.orange.auth.login.LoginActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.bank.add.BankAddActivity"
android:name="co.orange.auth.phone.PhoneActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.main.profile.ReportActivity"
android:name="co.orange.auth.submit.SubmitActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="co.orange.presentation.delivery.address.AddressWebActivity"
android:name="co.orange.setting.delivery.address.AddressWebActivity"
android:exported="true">
<intent-filter>
<action android:name="co.orange.presentation.address.ADDRESS" />
Expand All @@ -180,7 +170,7 @@
</activity>

<service
android:name="co.orange.presentation.config.DdanziMessagingService"
android:name="co.orange.main.config.DdanziMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/co/orange/ddanzi/MyApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.appcompat.app.AppCompatDelegate
import co.orange.ddanzi.BuildConfig.NATIVE_APP_KEY
import com.kakao.sdk.common.KakaoSdk
import dagger.hilt.android.HiltAndroidApp
import kr.genti.presentation.BuildConfig
import timber.log.Timber

@HiltAndroidApp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import android.content.Context
import android.content.Intent
import android.os.Handler
import android.os.Looper
import co.orange.auth.login.LoginActivity
import co.orange.core.extension.toast
import co.orange.domain.entity.request.ReissueRequestModel
import co.orange.domain.repository.AuthRepository
import co.orange.domain.repository.UserRepository
import co.orange.presentation.auth.login.LoginActivity
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.runBlocking
import okhttp3.Interceptor
Expand Down Expand Up @@ -76,7 +76,7 @@ class AuthInterceptor
private fun Request.Builder.newAuthBuilder() = this.addHeader(AUTHORIZATION, "$BEARER ${userRepository.getAccessToken()}")

companion object {
private const val CODE_TOKEN_EXPIRED = 403
private const val CODE_TOKEN_EXPIRED = 401
private const val TOKEN_EXPIRED_ERROR = "토큰이 만료되었어요\n다시 로그인 해주세요"
private const val BEARER = "Bearer"
private const val AUTHORIZATION = "Authorization"
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/java/co/orange/ddanzi/di/module/NavigationModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package co.orange.ddanzi.di.module

import co.orange.core.navigation.NavigationManager
import co.orange.ddanzi.di.navigate.NavigationManagerImpl
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object NavigationModule {
@Provides
@Singleton
fun provideNavigationManager(navigationManagerImpl: NavigationManagerImpl): NavigationManager = navigationManagerImpl
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
package co.orange.ddanzi.di.navigate

import android.content.Context
import android.content.Intent
import co.orange.auth.login.LoginActivity
import co.orange.buy.finished.BuyFinishedActivity
import co.orange.buy.progress.BuyProgressActivity
import co.orange.core.navigation.NavigationManager
import co.orange.main.detail.DetailActivity
import co.orange.main.main.MainActivity
import co.orange.main.push.PushActivity
import co.orange.sell.finished.SellFinishedActivity
import co.orange.sell.info.SellInfoActivity
import co.orange.sell.onboarding.SellOnboardingActivity
import co.orange.setting.bank.BankActivity
import co.orange.setting.delivery.DeliveryActivity
import co.orange.setting.history.HistoryActivity
import co.orange.setting.setting.SettingActivity
import javax.inject.Inject

class NavigationManagerImpl
@Inject
constructor() : NavigationManager {
/** To Main Module**/
override fun toMainViewWIthClearing(context: Context) {
Intent(context, MainActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
context.startActivity(this)
}
}

override fun toDetailView(
context: Context,
productId: String,
) {
context.startActivity(DetailActivity.createIntent(context, productId))
}

override fun toPushViewWithIntent(
context: Context,
isBuying: Boolean,
orderId: String?,
itemId: String?,
productName: String?,
productImage: String?,
salePrice: Int?,
) {
context.startActivity(
PushActivity.createIntent(
context,
isBuying,
orderId,
itemId,
productName,
productImage,
salePrice,
),
)
}

/** To Auth Module**/

override fun toLoginView(context: Context) {
context.startActivity(Intent(context, LoginActivity::class.java))
}

/** To Setting Module**/

override fun toSettingView(context: Context) {
context.startActivity(Intent(context, SettingActivity::class.java))
}

override fun toHistoryView(
context: Context,
type: Int,
) {
context.startActivity(HistoryActivity.createIntent(context, type))
}

override fun toDeliveryView(context: Context) {
context.startActivity(Intent(context, DeliveryActivity::class.java))
}

override fun toBankView(context: Context) {
context.startActivity(Intent(context, BankActivity::class.java))
}

/** To Buy Module**/

override fun toBuyProgressView(
context: Context,
productId: String,
optionList: ArrayList<Int>,
) {
context.startActivity(BuyProgressActivity.createIntent(context, productId, optionList))
}

override fun toBuyFinishedView(
context: Context,
orderId: String,
) {
context.startActivity(BuyFinishedActivity.createIntent(context, orderId))
}

/** To Sell Module**/

override fun toSellOnboardingView(context: Context) {
context.startActivity(Intent(context, SellOnboardingActivity::class.java))
}

override fun toSellFinishedView(
context: Context,
itemId: String,
productName: String,
productImage: String,
salePrice: Int,
) {
context.startActivity(
SellFinishedActivity.createIntent(
context,
itemId,
productName,
productImage,
salePrice,
),
)
}

override fun toSellInfoView(
context: Context,
itemId: String,
) {
context.startActivity(SellInfoActivity.createIntent(context, itemId))
}
}
Loading
Loading