Skip to content

Commit

Permalink
Merge branch 'develop' into 58-add-todays-match-no-match-수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Eouls committed Sep 21, 2024
2 parents 5138ebb + 320f17a commit d9e9290
Show file tree
Hide file tree
Showing 50 changed files with 478 additions and 434 deletions.
8 changes: 7 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
id("com.google.devtools.ksp")
id("dagger.hilt.android.plugin")
id("androidx.navigation.safeargs.kotlin")
id("com.google.android.gms.oss-licenses-plugin")
}

val properties = Properties().apply{
Expand All @@ -22,7 +23,7 @@ android {
applicationId = "umc.everyones.lck"
minSdk = 26
targetSdk = 34
versionCode = 1
versionCode = 4
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -39,13 +40,15 @@ android {
}

release {
manifestPlaceholders += mapOf()
isMinifyEnabled = false
manifestPlaceholders["NAVER_CLIENT_ID"] = properties["NAVER_CLIENT_ID"] as String
manifestPlaceholders["KAKAO_APP_KEY"] = properties["KAKAO_APP_KEY"] as String
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("debug")
}
}
compileOptions {
Expand Down Expand Up @@ -136,4 +139,7 @@ dependencies {

//kakao Login
implementation ("com.kakao.sdk:v2-user:2.20.3") // 카카오 로그인 API 모듈
implementation("com.google.android.gms:play-services-oss-licenses:17.1.0")

implementation ("com.jakewharton.timber:timber:5.0.1")
}
10 changes: 9 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-keep class com.kakao.sdk.**.model.* { <fields>; }
-keep class * extends com.google.gson.TypeAdapter

# https://github.com/square/okhttp/pull/6792
-dontwarn org.bouncycastle.jsse.**
-dontwarn org.conscrypt.*
-dontwarn org.openjsse.**
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import com.kakao.sdk.common.KakaoSdk
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber
import umc.everyones.lck.util.network.NetworkConnectionChecker
// @HiltAndroidApp : Hilt 사용시 반드시 선행 되어야 하는 부분, 모든 의존성 주입의 시작점
@HiltAndroidApp
Expand All @@ -21,7 +22,9 @@ class EveryonesLCKApplication : Application(), DefaultLifecycleObserver {

val kakaoAppKey = getString(R.string.kakao_app_key)
KakaoSdk.init(context,kakaoAppKey)

if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
}

override fun onStop(owner: LifecycleOwner) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/umc/everyones/lck/di/WsModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ object WsModule {
@Singleton
fun provideWebSocketRequest(spf: SharedPreferences): Request {
return Request.Builder()
.addHeader("Authorization", "Bearer ${spf.getString("jwt", "")}")
.url(EveryonesLCKApplication.getString(R.string.ws_url))
.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,47 @@ abstract class BaseDialogFragment<V : ViewDataBinding>(@LayoutRes val layoutReso
_binding = null
}

protected open fun Context.dialogFragmentResize(dialogFragment: DialogFragment, width: Float, height: Float) {
protected open fun Context.dialogFragmentResize(dialogFragment: DialogFragment, width: Float) {
val windowManager = getSystemService(Context.WINDOW_SERVICE) as WindowManager
if (Build.VERSION.SDK_INT < 30) {

val display = windowManager.defaultDisplay
val size = Point()

display.getSize(size)

val window = dialogFragment.dialog?.window

val x = (size.x * width).toInt()
val y = (size.y * height).toInt()
window?.setLayout(x, y)
val params: ViewGroup.LayoutParams? = dialog?.window?.attributes
val deviceWidth = size.x
params?.width = (deviceWidth * width).toInt()
dialog?.window?.attributes = params as WindowManager.LayoutParams

} else {

val rect = windowManager.currentWindowMetrics.bounds
val x = (rect.width() * width).toInt()
val params: ViewGroup.LayoutParams? = dialog?.window?.attributes
params?.width = x
dialog?.window?.attributes = params as WindowManager.LayoutParams
}
}

val window = dialogFragment.dialog?.window
protected open fun Context.dialogFragmentResize(dialogFragment: DialogFragment, width: Float, height: Float) {
val windowManager = getSystemService(Context.WINDOW_SERVICE) as WindowManager
if (Build.VERSION.SDK_INT < 30) {
val display = windowManager.defaultDisplay
val size = Point()
display.getSize(size)
val params: ViewGroup.LayoutParams? = dialog?.window?.attributes
val deviceWidth = size.x
val deviceHeight = size.y
params?.width = (deviceWidth * width).toInt()
params?.height = (deviceHeight * height).toInt()
dialog?.window?.attributes = params as WindowManager.LayoutParams

} else {
val rect = windowManager.currentWindowMetrics.bounds
val x = (rect.width() * width).toInt()
val y = (rect.height() * height).toInt()

window?.setLayout(x, y)
val params: ViewGroup.LayoutParams? = dialog?.window?.attributes
params?.width = x
params?.height = y
dialog?.window?.attributes = params as WindowManager.LayoutParams
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ import umc.everyones.lck.util.extension.toCategoryPosition

@AndroidEntryPoint
class CommunityFragment : BaseFragment<FragmentCommunityBinding>(R.layout.fragment_community) {
private val readPostViewModel: ReadPostViewModel by viewModels()
private val writePostViewModel: WritePostViewModel by activityViewModels()
private val communityViewModel: CommunityViewModel by activityViewModels()
private val navigator by lazy {
findNavController()
}

private var _postListVPA: PostListVPA? = null
private val postListVPA get() = _postListVPA
Expand All @@ -41,7 +36,6 @@ class CommunityFragment : BaseFragment<FragmentCommunityBinding>(R.layout.fragme
val category = result.data?.getStringExtra("category") ?: ""
binding.vpCommunityPostList.currentItem = category.toCategoryPosition()
val isWriteDone = result.data?.getBooleanExtra("isWriteDone", false) ?: false
Log.d("iwd", isWriteDone.toString())
if (isWriteDone){
communityViewModel.refreshCategoryPage(category)
}
Expand Down Expand Up @@ -85,7 +79,7 @@ class CommunityFragment : BaseFragment<FragmentCommunityBinding>(R.layout.fragme

// 글 작성 화면으로 이동
private fun goToWritePost(){
binding.fabCommunityWriteBtn.setOnClickListener {
binding.fabCommunityWriteBtn.setOnSingleClickListener {
resultLauncher.launch(WritePostActivity.newIntent(requireContext()))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import timber.log.Timber
import umc.everyones.lck.domain.repository.community.CommunityRepository
import umc.everyones.lck.util.network.EventFlow
import umc.everyones.lck.util.network.MutableEventFlow
Expand All @@ -32,9 +33,9 @@ class CommunityViewModel @Inject constructor(
fun fetchCommunityList(postType: String, page: Int, size: Int){
viewModelScope.launch {
repository.fetchCommunityList(postType, page, size).onSuccess { response ->
Log.d("fetchCommunityList", response.toString())
Timber.d("fetchCommunityList", response.toString())
}.onFailure {
Log.d("fetchCommunityList error", it.stackTraceToString())
Timber.d("fetchCommunityList error", it.stackTraceToString())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import umc.everyones.lck.databinding.ItemCommunityPostBinding
import umc.everyones.lck.domain.model.community.CommunityListModel
import umc.everyones.lck.util.extension.setOnSingleClickListener

class PostListRVA(val readPost: (Long) -> Unit) : PagingDataAdapter<CommunityListModel.CommunityListElementModel, PostListRVA.PostViewHolder>(DiffCallback()) {

Expand Down Expand Up @@ -54,7 +55,7 @@ class PostListRVA(val readPost: (Long) -> Unit) : PagingDataAdapter<CommunityLis
}

// 게시글 postId 전달
root.setOnClickListener {
root.setOnSingleClickListener {
readPost(postListItem.postId)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package umc.everyones.lck.presentation.community.adapter
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import umc.everyones.lck.presentation.community.list.FreeAgentListFragment
import umc.everyones.lck.presentation.community.list.PostListFragment
import umc.everyones.lck.presentation.community.list.QuestionListFragment
import umc.everyones.lck.presentation.community.list.ReviewListFragment
import umc.everyones.lck.presentation.community.list.SmallTalkListFragment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ class SpinnerAdapter(context: Context, private val list: List<String>?) :
// 클릭 후 나타나는 텍스트뷰 설정
override fun getDropDownView(position: Int, convertView: View?, parent: ViewGroup): View {
var convertView = convertView
/*val params = LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
params.setMargins(0, 0, 12, 0)
convertView?.layoutParams = params*/
val binding = SpinnerInnerViewBinding.inflate(inflater, parent, false)
if (convertView == null) convertView = binding.root
if (list != null) {
Expand All @@ -62,8 +56,4 @@ class SpinnerAdapter(context: Context, private val list: List<String>?) :
}
return convertView
}

interface GetSpinnerTextListener{
fun getText(text: String)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WriteMediaRVA(val addMedia: () -> Unit) : ListAdapter<Uri, RecyclerView.Vi
inner class MediaAddViewHolder(private val binding: ItemMediaAddBinding) :
RecyclerView.ViewHolder(binding.root) {
fun bind(){
binding.layoutMediaAddBtn.setOnClickListener {
binding.layoutMediaAddBtn.setOnSingleClickListener {
addMedia()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collectLatest
import timber.log.Timber
import umc.everyones.lck.R
import umc.everyones.lck.databinding.FragmentPostListBinding
import umc.everyones.lck.presentation.base.BaseFragment
Expand All @@ -18,9 +19,6 @@ import umc.everyones.lck.presentation.party.adapter.ViewingPartyRVA
import umc.everyones.lck.util.extension.repeatOnStarted

class FreeAgentListFragment : BaseFragment<FragmentPostListBinding>(R.layout.fragment_post_list) {
private val navigator by lazy {
findNavController()
}
private val viewModel: CommunityViewModel by activityViewModels()
private var _postListRVA: PostListRVA? = null
private val postListRVA
Expand All @@ -44,7 +42,7 @@ class FreeAgentListFragment : BaseFragment<FragmentPostListBinding>(R.layout.fra

viewLifecycleOwner.repeatOnStarted {
viewModel.categoryNeedsRefresh.collect { categoryNeedsRefresh ->
Log.d("FreeAgent", categoryNeedsRefresh)
Timber.d("FreeAgent", categoryNeedsRefresh)
if (categoryNeedsRefresh == CATEGORY) {
postListRVA?.refresh()
binding.rvPostList.scrollToPosition(0)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collectLatest
import timber.log.Timber
import umc.everyones.lck.R
import umc.everyones.lck.databinding.FragmentPostListBinding
import umc.everyones.lck.presentation.base.BaseFragment
Expand All @@ -17,9 +18,6 @@ import umc.everyones.lck.presentation.community.read.ReadPostActivity
import umc.everyones.lck.util.extension.repeatOnStarted

class QuestionListFragment : BaseFragment<FragmentPostListBinding>(R.layout.fragment_post_list) {
private val navigator by lazy {
findNavController()
}
private val viewModel: CommunityViewModel by activityViewModels()
private var _postListRVA: PostListRVA? = null
private val postListRVA
Expand All @@ -43,7 +41,7 @@ class QuestionListFragment : BaseFragment<FragmentPostListBinding>(R.layout.frag

viewLifecycleOwner.repeatOnStarted {
viewModel.categoryNeedsRefresh.collect { categoryNeedsRefresh ->
Log.d("Question", categoryNeedsRefresh)
Timber.d("Question", categoryNeedsRefresh)
if (categoryNeedsRefresh == CATEGORY) {
postListRVA?.refresh()
binding.rvPostList.scrollToPosition(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collectLatest
import timber.log.Timber
import umc.everyones.lck.R
import umc.everyones.lck.databinding.FragmentPostListBinding
import umc.everyones.lck.presentation.base.BaseFragment
Expand All @@ -17,9 +18,6 @@ import umc.everyones.lck.presentation.community.read.ReadPostActivity
import umc.everyones.lck.util.extension.repeatOnStarted

class ReviewListFragment : BaseFragment<FragmentPostListBinding>(R.layout.fragment_post_list) {
private val navigator by lazy {
findNavController()
}
private val viewModel: CommunityViewModel by activityViewModels()
private var _postListRVA: PostListRVA? = null
private val postListRVA
Expand All @@ -43,7 +41,7 @@ class ReviewListFragment : BaseFragment<FragmentPostListBinding>(R.layout.fragm

viewLifecycleOwner.repeatOnStarted {
viewModel.categoryNeedsRefresh.collect { categoryNeedsRefresh ->
Log.d("Review", categoryNeedsRefresh)
Timber.d("Review", categoryNeedsRefresh)
if (categoryNeedsRefresh == CATEGORY) {
postListRVA?.refresh()
binding.rvPostList.scrollToPosition(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collectLatest
import timber.log.Timber
import umc.everyones.lck.R
import umc.everyones.lck.databinding.FragmentPostListBinding
import umc.everyones.lck.domain.model.community.CommunityListModel
Expand All @@ -19,9 +20,6 @@ import umc.everyones.lck.presentation.community.read.ReadPostViewModel
import umc.everyones.lck.util.extension.repeatOnStarted

class SmallTalkListFragment : BaseFragment<FragmentPostListBinding>(R.layout.fragment_post_list) {
private val navigator by lazy {
findNavController()
}
private val viewModel: CommunityViewModel by activityViewModels()
private var _postListRVA: PostListRVA? = null
private val postListRVA
Expand All @@ -45,7 +43,7 @@ class SmallTalkListFragment : BaseFragment<FragmentPostListBinding>(R.layout.fr

viewLifecycleOwner.repeatOnStarted {
viewModel.categoryNeedsRefresh.collect { categoryNeedsRefresh ->
Log.d("smallTalk", categoryNeedsRefresh)
Timber.d("smallTalk", categoryNeedsRefresh)
if (categoryNeedsRefresh == CATEGORY) {
postListRVA?.refresh()
binding.rvPostList.scrollToPosition(0)
Expand Down
Loading

0 comments on commit d9e9290

Please sign in to comment.