Skip to content

Commit bd0f3cb

Browse files
authored
TOP-103 채팅 소켓 연결 및 기본 디자인 수정 (#132)
* TOP-103 채팅 리스트 조회 및 상세 이전 데이터 조회 * TOP-103 채팅 디자인 수정 * feat:TOP-103 채팅 라이브러리 도입 * feat:TOP-103 채팅 연동 * feat:TOP-103 내 채팅, 상대방 채팅 코드 개선 * feat:TOP-103 스크롤 하단으로 움직이게 만들기 * feat:TOP-103 채팅 디자인 수정 * feat:TOP-103 상세 채팅 화면 바텀 네비게이션 안보이도록 수정 * feat:TOP-103 ON_START에서 채팅 리스트에서 바텀시트 보이도록 수정 * feat:TOP-103 채팅 텍스트 있을시 색상 변경 * feat:TOP-103 imepadding 추가
1 parent 74c7d91 commit bd0f3cb

87 files changed

Lines changed: 2936 additions & 387 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:tools="http://schemas.android.com/tools"
3-
xmlns:android="http://schemas.android.com/apk/res/android">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
44

55
<uses-permission android:name="android.permission.INTERNET" />
66
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -17,13 +17,14 @@
1717
android:networkSecurityConfig="@xml/network_security_config"
1818
android:roundIcon="@mipmap/ic_falling_launcher_round"
1919
android:supportsRtl="true"
20-
android:theme="@style/Theme.THT">
20+
android:theme="@style/Theme.THT"
21+
android:usesCleartextTraffic="true">
2122
<activity
2223
android:name=".SplashActivity"
23-
android:screenOrientation="portrait"
2424
android:exported="true"
25-
tools:ignore="LockedOrientationActivity"
26-
android:theme="@style/Theme.App.Starting">
25+
android:screenOrientation="portrait"
26+
android:theme="@style/Theme.App.Starting"
27+
tools:ignore="LockedOrientationActivity">
2728
<intent-filter>
2829
<action android:name="android.intent.action.MAIN" />
2930

@@ -33,9 +34,10 @@
3334
</intent-filter>
3435
</activity>
3536
<activity
36-
android:screenOrientation="portrait"
3737
android:name=".HomeActivity"
3838
android:exported="false"
39+
android:screenOrientation="portrait"
40+
android:windowSoftInputMode="adjustResize"
3941
tools:ignore="LockedOrientationActivity" />
4042
<activity
4143
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"

app/src/main/java/com/tht/tht/AppModule.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.tht.tht
22

33
import android.app.Application
4+
import com.tht.tht.navigation.BottomNavigationProviderImpl
45
import dagger.Module
56
import dagger.Provides
67
import dagger.hilt.InstallIn
78
import dagger.hilt.android.qualifiers.ApplicationContext
89
import dagger.hilt.components.SingletonComponent
10+
import tht.core.navigation.BottomNavigationProvider
911

1012
@Module
1113
@InstallIn(SingletonComponent::class)
@@ -14,4 +16,7 @@ object AppModule {
1416
@ApplicationContext
1517
@Provides
1618
fun provideApplicationContext(application: Application) = application
19+
20+
@Provides
21+
fun provideApplication(): BottomNavigationProvider = BottomNavigationProviderImpl()
1722
}

app/src/main/java/com/tht/tht/HomeActivity.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
44
import android.content.Context
55
import android.content.Intent
66
import android.os.Bundle
7+
import android.view.View
78
import androidx.activity.viewModels
89
import androidx.fragment.app.Fragment
910
import androidx.lifecycle.Lifecycle
@@ -53,18 +54,22 @@ class HomeActivity : BaseActivity<HomeViewModel, ActivityHomeBinding>(), Fragmen
5354
)
5455
true
5556
}
57+
5658
R.id.menu_heart -> {
5759
showFragment(LikeFragment.TAG)
5860
true
5961
}
62+
6063
R.id.menu_chat -> {
6164
showFragment(ChatFragment.TAG)
6265
true
6366
}
67+
6468
R.id.menu_my -> {
6569
showFragment(MyPageFragment.TAG)
6670
true
6771
}
72+
6873
else -> false
6974
}
7075
}
@@ -101,6 +106,15 @@ class HomeActivity : BaseActivity<HomeViewModel, ActivityHomeBinding>(), Fragmen
101106
}
102107
}
103108

109+
fun showBottomNav() {
110+
binding.bnvHome.visibility = View.VISIBLE
111+
}
112+
113+
fun hideBottomNav() {
114+
binding.bnvHome.visibility = View.GONE
115+
}
116+
117+
104118
override fun addFragmentBackStack(tag: String, bundle: Bundle?) {
105119
binding.root.hideSoftInput()
106120
with(supportFragmentManager) {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.tht.tht.navigation
2+
3+
import android.content.Context
4+
import com.tht.tht.HomeActivity
5+
import tht.core.navigation.BottomNavigationProvider
6+
7+
class BottomNavigationProviderImpl : BottomNavigationProvider {
8+
override fun show(context: Context) {
9+
(context as HomeActivity).showBottomNav()
10+
}
11+
12+
override fun hide(context: Context) {
13+
(context as HomeActivity).hideBottomNav()
14+
}
15+
}

app/src/main/res/xml/network_security_config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<network-security-config>
33
<domain-config cleartextTrafficPermitted="true">
44
<domain includeSubdomains="true">tht-talk.co.kr</domain>
5+
<domain includeSubdomains="true">3.34.157.62</domain>
56
</domain-config>
67
</network-security-config>

build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ subprojects {
4343
// run use ./gradlew assembleRelease -PcomposeCompilerReports=true --rerun-tasks
4444
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
4545
kotlinOptions {
46+
jvmTarget = "17"
4647
if (project.findProperty("composeCompilerReports") == "true") {
4748
val metricsOutputDir = "${rootProject.file(".").absolutePath}/compose-report/compose-metrics"
4849
val reportOutputDir = "${rootProject.file(".").absolutePath}/compose-report/compose-reports"
@@ -56,3 +57,10 @@ subprojects {
5657
}
5758
}
5859
}
60+
61+
//configurations.all {
62+
// resolutionStrategy {
63+
// force("org.jetbrains.kotlin:kotlin-stdlib:1.9.0")
64+
// force ("org.jetbrains.kotlin:kotlin-reflect:1.9.0")
65+
// }
66+
//}

core/compose-ui/src/main/java/com/example/compose_ui/component/image/ThtImage.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ package com.example.compose_ui.component.image
22

33
import androidx.compose.foundation.Image
44
import androidx.compose.foundation.layout.size
5+
import androidx.compose.foundation.shape.RoundedCornerShape
56
import androidx.compose.runtime.Composable
67
import androidx.compose.ui.Modifier
8+
import androidx.compose.ui.draw.clip
79
import androidx.compose.ui.layout.ContentScale
810
import androidx.compose.ui.platform.LocalContext
911
import androidx.compose.ui.unit.DpSize
12+
import androidx.compose.ui.unit.dp
1013
import coil.compose.AsyncImagePainter
1114
import coil.compose.rememberAsyncImagePainter
1215
import coil.request.ImageRequest
@@ -32,7 +35,9 @@ fun ThtImage(
3235

3336
else -> {
3437
Image(
35-
modifier = modifier.size(size),
38+
modifier = modifier
39+
.size(size)
40+
.clip(RoundedCornerShape(12.dp)),
3641
painter = painter,
3742
contentDescription = null,
3843
contentScale = ContentScale.Crop,

core/compose-ui/src/main/java/com/example/compose_ui/component/text/headline/Headline.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.ui.graphics.Shadow
88
import androidx.compose.ui.text.AnnotatedString
99
import androidx.compose.ui.text.font.FontWeight
1010
import androidx.compose.ui.text.style.TextAlign
11+
import androidx.compose.ui.text.style.TextOverflow
1112
import androidx.compose.ui.unit.TextUnit
1213
import com.example.compose_ui.component.font.rememberPretendardFontStyle
1314
import com.example.compose_ui.extensions.dpTextUnit
@@ -104,7 +105,9 @@ fun ThtHeadline4(
104105
fontWeight: FontWeight,
105106
color: Color,
106107
textAlign: TextAlign = TextAlign.Center,
107-
shadow: Shadow? = null
108+
shadow: Shadow? = null,
109+
maxLines: Int = 1,
110+
overflow: TextOverflow = TextOverflow.Ellipsis
108111
) {
109112
Text(
110113
modifier = modifier,
@@ -116,6 +119,8 @@ fun ThtHeadline4(
116119
shadow = shadow
117120
),
118121
color = color,
122+
overflow = overflow,
123+
maxLines = maxLines,
119124
)
120125
}
121126

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package tht.core.navigation
2+
3+
import android.content.Context
4+
5+
interface BottomNavigationProvider {
6+
fun show(context: Context)
7+
fun hide(context: Context)
8+
}

data/src/main/java/com/tht/tht/data/constant/THTApiConstant.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ object THTApiConstant {
4949

5050
object Chat {
5151
const val CHAT_LIST = "/chat/rooms"
52+
53+
const val CHAT_DETAIL_INFORMATION = "/chat/room/{chat-room-idx}"
54+
55+
const val CHAT_DETAIL_HISTORY = "/chat/history"
5256
}
5357

5458
object Setting {

0 commit comments

Comments
 (0)