Skip to content

Commit

Permalink
[feat]: 유동적인 리스트 크기 분기 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
kangyuri1114 committed May 29, 2024
1 parent 644912e commit 26901b1
Showing 1 changed file with 56 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class ProjectDetailActivity : AppCompatActivity() {
it?.imageLink
?: R.drawable.project_profile_default,
)
val projectGithubLink = it?.githubLink ?: getString(com.zucchini.feature.projects.R.string.github_default_link)
val projectGithubLink = it?.githubLink
?: getString(com.zucchini.feature.projects.R.string.github_default_link)

tvProjectName.text = it?.name
tvProjectSorted.text = it?.category
Expand All @@ -89,15 +90,60 @@ class ProjectDetailActivity : AppCompatActivity() {
tvAppLink.text = it?.appLink
tvLandingLink.text = it?.infoPageLink
tvWebLink.text = it?.webLink
tvDevStackLanguage1.text = it?.languageList?.get(0) ?: ""
tvDevStackLanguage2.text = it?.languageList?.get(1) ?: ""
tvDevStackLanguage3.text = it?.languageList?.get(2) ?: ""
tvDevStackCooperation1.text = it?.devToolList?.get(0) ?: ""
tvDevStackCooperation2.text = it?.devToolList?.get(1) ?: ""
tvDevStackCooperation3.text = it?.devToolList?.get(2) ?: ""
tvDevStackTech1.text = it?.techStackList?.get(0) ?: ""
tvDevStackTech2.text = it?.techStackList?.get(1) ?: ""
tvDevStackTech3.text = it?.techStackList?.get(2) ?: ""

if (it?.languageList?.size == 0 || it?.techStackList == null) {
tvDevStackLanguage1.visibility = android.view.View.INVISIBLE
tvDevStackLanguage2.visibility = android.view.View.INVISIBLE
tvDevStackLanguage3.visibility = android.view.View.INVISIBLE
} else if (it.languageList?.size == 1) {
tvDevStackLanguage1.text = it.languageList?.get(0) ?: ""
tvDevStackLanguage2.visibility = android.view.View.INVISIBLE
tvDevStackLanguage3.visibility = android.view.View.INVISIBLE
} else if (it.languageList?.size == 2) {
tvDevStackLanguage1.text = it.languageList?.get(0) ?: ""
tvDevStackLanguage2.text = it.languageList?.get(1) ?: ""
tvDevStackLanguage3.visibility = android.view.View.INVISIBLE
} else if (it.languageList?.size == 3) {
tvDevStackLanguage1.text = it.languageList?.get(0) ?: ""
tvDevStackLanguage2.text = it.languageList?.get(1) ?: ""
tvDevStackLanguage3.text = it.languageList?.get(2) ?: ""
}

if (it?.devToolList?.size == 0 || it?.techStackList == null) {
tvDevStackCooperation1.visibility = android.view.View.INVISIBLE
tvDevStackCooperation2.visibility = android.view.View.INVISIBLE
tvDevStackCooperation3.visibility = android.view.View.INVISIBLE
} else if (it.devToolList?.size == 1) {
tvDevStackCooperation1.text = it.devToolList?.get(0) ?: ""
tvDevStackCooperation2.visibility = android.view.View.INVISIBLE
tvDevStackCooperation3.visibility = android.view.View.INVISIBLE
} else if (it.devToolList?.size == 2) {
tvDevStackCooperation1.text = it.devToolList?.get(0) ?: ""
tvDevStackCooperation2.text = it.devToolList?.get(1) ?: ""
tvDevStackCooperation3.visibility = android.view.View.INVISIBLE
} else if (it.devToolList?.size == 3) {
tvDevStackCooperation1.text = it.devToolList?.get(0) ?: ""
tvDevStackCooperation2.text = it.devToolList?.get(1) ?: ""
tvDevStackCooperation3.text = it.devToolList?.get(2) ?: ""
}

if (it?.techStackList?.size == 0 || it?.techStackList == null) {
tvDevStackTech1.visibility = android.view.View.INVISIBLE
tvDevStackTech2.visibility = android.view.View.INVISIBLE
tvDevStackTech3.visibility = android.view.View.INVISIBLE
} else if (it.techStackList?.size == 1) {
tvDevStackTech1.text = it.techStackList?.get(0) ?: ""
tvDevStackTech2.visibility = android.view.View.INVISIBLE
tvDevStackTech3.visibility = android.view.View.INVISIBLE
} else if (it.techStackList?.size == 2) {
tvDevStackTech1.text = it.techStackList?.get(0) ?: ""
tvDevStackTech2.text = it.techStackList?.get(1) ?: ""
tvDevStackTech3.visibility = android.view.View.INVISIBLE
} else if (it.techStackList?.size == 3) {
tvDevStackTech1.text = it.techStackList?.get(0) ?: ""
tvDevStackTech2.text = it.techStackList?.get(1) ?: ""
tvDevStackTech3.text = it.techStackList?.get(2) ?: ""
}

navigateToProjectGithubLink(projectGithubLink)
}
Expand Down

0 comments on commit 26901b1

Please sign in to comment.