Skip to content

Commit

Permalink
MOCACONG v2 RELEASED
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiyooong committed Jan 4, 2024
1 parent 2b03b9a commit 20a6242
Show file tree
Hide file tree
Showing 75 changed files with 848 additions and 636 deletions.
17 changes: 14 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ plugins {
id 'org.jetbrains.kotlin.android'
id 'com.google.dagger.hilt.android'
id 'kotlin-kapt'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}

kapt {
correctErrorTypes true
}

android {
Expand All @@ -21,8 +27,8 @@ android {
applicationId "com.konkuk.mocacong"
minSdk 25
targetSdk 33
versionCode 2
versionName "1.0.1"
versionCode 3
versionName "2.0.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -100,7 +106,7 @@ dependencies {

//hilt
implementation 'com.google.dagger:hilt-android:2.48.1'
annotationProcessor 'com.google.dagger:hilt-compiler:2.48.1'
kapt 'com.google.dagger:hilt-compiler:2.48.1'

//DataStore
implementation "androidx.datastore:datastore-preferences:1.0.0"
Expand All @@ -110,4 +116,9 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:logging-interceptor")

//Firebase BoM
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'

}
29 changes: 29 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "922499845818",
"project_id": "mocacong-54f51",
"storage_bucket": "mocacong-54f51.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:922499845818:android:dfbbb72ee44af09b07bc83",
"android_client_info": {
"package_name": "com.konkuk.mocacong"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDq9jay2XQk27KqIMegBHWp28Au6jGd7uk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
40 changes: 0 additions & 40 deletions app/src/main/java/com/konkuk/mocacong/objects/KakaoLocalClient.kt

This file was deleted.

24 changes: 0 additions & 24 deletions app/src/main/java/com/konkuk/mocacong/objects/NetworkManager.kt

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/java/com/konkuk/mocacong/objects/NetworkUtil.kt

This file was deleted.

82 changes: 0 additions & 82 deletions app/src/main/java/com/konkuk/mocacong/objects/Utils.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, layoutRes)
binding.lifecycleOwner = this
initViewModel()
afterViewCreated()
}

Expand All @@ -31,8 +30,6 @@ abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
startActivity(intent)
}


open fun initViewModel() {}
abstract fun afterViewCreated()

// 토스트 생성
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ import androidx.fragment.app.activityViewModels
import com.konkuk.mocacong.R
import com.konkuk.mocacong.databinding.FragmentCafeDetailBinding
import com.konkuk.mocacong.presentation.base.BaseFragment
import com.konkuk.mocacong.presentation.detail.comment.WriteCommentFragment
import com.konkuk.mocacong.presentation.main.MainPage
import com.konkuk.mocacong.presentation.main.MainViewModel
import com.konkuk.mocacong.presentation.main.mypage.MypageViewModel

class CafeDetailFragment : BaseFragment<FragmentCafeDetailBinding>() {
override val TAG: String = "DetailFragment"
override val layoutRes: Int = R.layout.fragment_cafe_detail
private val mainViewModel: MainViewModel by activityViewModels()
private val detailViewModel: CafeDetailViewModel by activityViewModels()
private val mypageViewModel: MypageViewModel by activityViewModels()

override fun afterViewCreated() {
binding.vm = detailViewModel
binding.mypageVm = mypageViewModel
detailViewModel.requestCafeDetailInfo()
initLayout()
}
Expand Down Expand Up @@ -48,6 +52,8 @@ class CafeDetailFragment : BaseFragment<FragmentCafeDetailBinding>() {
mainViewModel.goto(MainPage.COMMENTS)
}

binding

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ import com.konkuk.mocacong.data.entities.BasicPlaceInfo
import com.konkuk.mocacong.presentation.models.CafeCommentsUiModel
import com.konkuk.mocacong.presentation.models.CafeDetailUiModel
import com.konkuk.mocacong.remote.models.request.ReviewRequest
import com.konkuk.mocacong.remote.models.response.CafeImage
import com.konkuk.mocacong.remote.models.response.CafeImageResponse
import com.konkuk.mocacong.remote.models.response.MyReviewResponse
import com.konkuk.mocacong.remote.repositories.CafeDetailRepository
import com.konkuk.mocacong.util.ApiState
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import okhttp3.MultipartBody
import javax.inject.Inject

class CafeDetailViewModel(private val cafeDetailRepository: CafeDetailRepository) : ViewModel() {
@HiltViewModel
class CafeDetailViewModel @Inject constructor(private val cafeDetailRepository: CafeDetailRepository) : ViewModel() {
val TAG = "CafeDetailViewModel"
lateinit var cafeId: String

Expand Down Expand Up @@ -175,6 +179,7 @@ class CafeDetailViewModel(private val cafeDetailRepository: CafeDetailRepository
}
}

var currentImage: CafeImage? = null


fun deleteComment(id: Long) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import com.konkuk.mocacong.R
import com.konkuk.mocacong.data.entities.Review
Expand Down Expand Up @@ -34,10 +35,19 @@ class ReviewButtonGroup @JvmOverloads constructor(

binding = LayoutReviewBtnBinding.inflate(LayoutInflater.from(context), this, true)
setLevelText()
setRequiredIcon()
setClickListeners()

}

private fun setRequiredIcon() {
if (category == "desk" || category == "power") {
binding.requiredIcon.visibility = View.VISIBLE
invalidate()
requestLayout()
}
}

@SuppressLint("DiscouragedApi")
private fun setLevelText() {
val resourceId = resources.getIdentifier(category, "array", context.packageName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.konkuk.mocacong.presentation.detail
package com.konkuk.mocacong.presentation.detail.comment

import android.content.Context
import android.util.AttributeSet
Expand All @@ -17,21 +17,20 @@ class CafeCommentView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyleAttr) {

private var binding: LayoutCafeCommentBinding

init {
binding = LayoutCafeCommentBinding.bind(
LayoutInflater.from(context).inflate(R.layout.layout_cafe_comment, this, false)
)
addView(binding.root)
}

fun setComment(comment: Comment?){
if(comment==null) binding.root.visibility = View.GONE
fun setComment(comment: Comment?) {
if (comment == null) binding.root.visibility = View.GONE
else {
binding.root.visibility = View.VISIBLE
if(comment.isMe) binding.commentMenuBtn.visibility = View.VISIBLE
else binding.commentMenuBtn.visibility = View.GONE

binding.profileImg.clipToOutline = true
binding.commentMenuBtn.visibility = View.GONE
if (comment.imgUrl.isNullOrBlank()) binding.profileImg.setImageResource(R.drawable.img_no_profile)
else Glide.with(context).load(comment.imgUrl).into(binding.profileImg)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.konkuk.mocacong.presentation.detail
package com.konkuk.mocacong.presentation.detail.comment

import android.view.LayoutInflater
import android.view.View
Expand Down
Loading

0 comments on commit 20a6242

Please sign in to comment.