Skip to content

Commit

Permalink
kuring-187 쿠링봇 UI 구현 (#297)
Browse files Browse the repository at this point in the history
* feature: 쿠링봇 화면 composable 추가

* feature: 쿠링봇 activity 추가

* feature: 쿠링봇 activity를 manifest에 등록

* feature: KuringNavigator에 쿠링봇 화면 추가

* feature: 쿠링봇으로 이동하는 FAB 추가

* refactor: 불필요한 null indicator 제거
  • Loading branch information
mwy3055 authored Aug 8, 2024
1 parent 7d3e232 commit 04d0c2f
Show file tree
Hide file tree
Showing 10 changed files with 539 additions and 16 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ dependencies {
implementation(projects.feature.onboarding)
implementation(projects.feature.splash)
implementation(projects.feature.main)
implementation(projects.feature.kuringbot)

implementation(libs.androidx.startup.runtime)
testImplementation(libs.kotlinx.coroutines.test)
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
android:name=".main.search.SearchActivity"
android:exported="false"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".kuringbot.KuringBotActivity"
android:exported="false"
android:windowSoftInputMode="adjustResize" />

<provider
android:name="androidx.startup.InitializationProvider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.ku_stacks.ku_ring.domain.mapper.toWebViewNotice
import com.ku_stacks.ku_ring.edit_departments.EditDepartmentsActivity
import com.ku_stacks.ku_ring.edit_subscription.EditSubscriptionActivity
import com.ku_stacks.ku_ring.feedback.feedback.FeedbackActivity
import com.ku_stacks.ku_ring.kuringbot.KuringBotActivity
import com.ku_stacks.ku_ring.main.MainActivity
import com.ku_stacks.ku_ring.main.search.SearchActivity
import com.ku_stacks.ku_ring.notice_detail.NoticeWebActivity
Expand Down Expand Up @@ -90,4 +91,8 @@ class KuringNavigatorImpl @Inject constructor() : KuringNavigator {
activity.startActivity(intent)
OssLicensesMenuActivity.setActivityTitle(activity.getString(R.string.open_source_license))
}

override fun navigateToKuringBot(context: Context) {
KuringBotActivity.start(context)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class PreferenceUtil(@ApplicationContext context: Context) {
get() = prefs.getString(START_DATE, "")
set(value) = prefs.edit().putString(START_DATE, value).apply()

var fcmToken: String?
get() = prefs.getString(FCM_TOKEN, "")
var fcmToken: String
get() = prefs.getString(FCM_TOKEN, "") ?: ""
set(value) = prefs.edit().putString(FCM_TOKEN, value).apply()

var subscription: Set<String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ interface KuringNavigator {
fun navigateToOnboarding(activity: Activity)
fun navigateToSplash(activity: Activity)
fun navigateToOssLicensesMenu(activity: Activity)
fun navigateToKuringBot(context: Context)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.ku_stacks.ku_ring.kuringbot

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import com.ku_stacks.ku_ring.designsystem.kuringtheme.KuringTheme
import com.ku_stacks.ku_ring.kuringbot.compose.KuringBotScreen
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class KuringBotActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
KuringTheme {
KuringBotScreen(
onBackButtonClick = ::finish,
modifier = Modifier.fillMaxSize(),
)
}
}
}

companion object {
fun start(context: Context) {
val intent = Intent(context, KuringBotActivity::class.java)
context.startActivity(intent)
}
}

}
Loading

0 comments on commit 04d0c2f

Please sign in to comment.