Skip to content

Commit

Permalink
Merge pull request #19 from SSU-Plector/feat/#14-dev-detail-ui
Browse files Browse the repository at this point in the history
[Feat/#14 dev_detail_UI]: 개발자 상세 페이지 ui 구현
  • Loading branch information
kangyuri1114 authored Apr 1, 2024
2 parents 82991db + 6b50884 commit d1b6c3f
Show file tree
Hide file tree
Showing 30 changed files with 747 additions and 21 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ dependencies {
implementation(project(":core:designsystem"))
implementation(project(":core:common"))
implementation(project(":feature:projects"))
implementation(project(":feature:devInfo"))
implementation(project(":feature:mypage"))

KotlinDependencies.run {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/zucchini/ssuplector/InitActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.zucchini.ssuplector.databinding.ActivityInitBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint

class InitActivity : AppCompatActivity() {
private lateinit var binding: ActivityInitBinding

Expand Down
5 changes: 5 additions & 0 deletions core/designsystem/src/main/res/drawable/back_button_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#373130"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M17.77,3.77l-1.77,-1.77l-10,10l10,10l1.77,-1.77l-8.23,-8.23z"/>
</vector>
11 changes: 11 additions & 0 deletions core/designsystem/src/main/res/drawable/contents_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="340dp"
android:height="56dp"
android:viewportWidth="340"
android:viewportHeight="56">
<path
android:strokeWidth="1"
android:pathData="M10,0.5L330,0.5A9.5,9.5 0,0 1,339.5 10L339.5,46A9.5,9.5 0,0 1,330 55.5L10,55.5A9.5,9.5 0,0 1,0.5 46L0.5,10A9.5,9.5 0,0 1,10 0.5z"
android:fillColor="#ffffff"
android:strokeColor="#90BD83"/>
</vector>
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/drawable/image_default.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="141dp"
android:height="137dp"
android:viewportWidth="141"
android:viewportHeight="137">
<path
android:pathData="M10,0L131,0A10,10 0,0 1,141 10L141,127A10,10 0,0 1,131 137L10,137A10,10 0,0 1,0 127L0,10A10,10 0,0 1,10 0z"
android:fillColor="#D9D9D9"/>
</vector>
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/drawable/stack_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="84dp"
android:height="33dp"
android:viewportWidth="84"
android:viewportHeight="33">
<path
android:pathData="M0,10C0,4.477 4.477,0 10,0H73.535C79.057,0 83.535,4.477 83.535,10V23C83.535,28.523 79.057,33 73.535,33H10C4.477,33 0,28.523 0,23V10Z"
android:fillColor="#EDF6EA"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.zucchini.domain.model

data class DevDetailProjectInfo(
val image: Int? = null,
val name: String = "",
val description: String = "",
val sorted: String = "",
)
1 change: 1 addition & 0 deletions feature/devInfo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dependencies {
implementation(project(":core:designsystem"))
implementation(project(":core:common"))


KotlinDependencies.run {
implementation(kotlin)
implementation(coroutines)
Expand Down
8 changes: 8 additions & 0 deletions feature/devInfo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity
android:name="com.zucchini.projects.DevDetailActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
</application>

</manifest>
5 changes: 5 additions & 0 deletions feature/devInfo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<resources>
<string name="top_app_bar_developer">개발자 찾기</string>
<string name="dev_detail_top_bar">개발자 상세 페이지</string>
<string name="github">Github</string>
<string name="kakao_id">카카오톡 아이디</string>
<string name="email">이메일</string>
<string name="tv_navigate_to_project"><u>프로젝트 보러가기&#8599;</u></string>
</resources>
1 change: 0 additions & 1 deletion feature/projects/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies {
implementation(project(":domain"))
implementation(project(":core:designsystem"))
implementation(project(":core:common"))
implementation(project(":feature:devInfo"))
implementation(project(":feature:mypage"))

KotlinDependencies.run {
Expand Down
6 changes: 6 additions & 0 deletions feature/projects/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />

<activity
android:name="com.zucchini.projects.DevDetailActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.zucchini.projects

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import com.zucchini.feature.projects.databinding.ActivityDevDetailBinding
import com.zucchini.projects.adapter.DevDetailProjectAdapter

class DevDetailActivity : AppCompatActivity() {
private lateinit var binding: ActivityDevDetailBinding
override fun onCreate(savedInstanceState: Bundle?) {
binding = ActivityDevDetailBinding.inflate(layoutInflater)
super.onCreate(savedInstanceState)
setContentView(binding.root)

initProjectAdapter()
}

private fun initProjectAdapter() {
val projectAdapter = DevDetailProjectAdapter()
binding.rvDevProject.layoutManager = LinearLayoutManager(this)
binding.rvDevProject.adapter = projectAdapter
projectAdapter.submitList(DevProjectsDummy.devProjectsInfoList)
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.zucchini.feature.devInfo
package com.zucchini.projects

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager
import com.zucchini.feature.devInfo.adapter.DeveloperInfoAdapter
import com.zucchini.feature.devInfo.databinding.FragmentDevInfoBinding
import com.zucchini.feature.projects.databinding.FragmentDevInfoBinding
import com.zucchini.projects.adapter.DeveloperInfoAdapter

class DevInfoFragment : Fragment() {
private var _binding: FragmentDevInfoBinding? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.zucchini.projects

import com.zucchini.domain.model.DevDetailProjectInfo
import com.zucchini.feature.projects.R

object DevProjectsDummy {
val devProjectsInfoList = listOf(
DevDetailProjectInfo(
image = com.zucchini.core.designsystem.R.drawable.project_profile_default,
name = "프로젝트임둥",
description = "가나다아다ㅏ라ㅏ랒아ㅗㅓ 야호",
sorted = "서비스",
),
DevDetailProjectInfo(
image = com.zucchini.core.designsystem.R.drawable.project_profile_default,
name = "프로젝트임둥3333",
description = "가나다아다ㅏ라ㅏ랒아ㅗㅓ 야호",
sorted = "게임",
),
DevDetailProjectInfo(
image = com.zucchini.core.designsystem.R.drawable.project_profile_default,
name = "프로젝트임둥222",
description = "가나다아다ㅏ라ㅏ랒아ㅗㅓ 야호ㅇㅇㅇㅇㅇㅇㅇㅇㅇㅇㅇㅇㅇㅇ",
sorted = "IoT",
),
)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.zucchini.feature.devInfo
package com.zucchini.projects

import com.zucchini.domain.model.DeveloperInfo
import com.zucchini.feature.projects.R

object DeveloperInfoDummy {
val developerInfoList = listOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.zucchini.projects.adapter

import android.content.Intent
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat.startActivity
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.zucchini.domain.model.DevDetailProjectInfo
import com.zucchini.feature.projects.R
import com.zucchini.feature.projects.databinding.ItemDevDetailProjectsBinding
import com.zucchini.projects.DevDetailActivity
import com.zucchini.view.ItemDiffCallback

class DevDetailProjectAdapter :
ListAdapter<DevDetailProjectInfo, DevDetailProjectAdapter.DevDetailProjectInfoViewHolder>(
ItemDiffCallback<DevDetailProjectInfo>(
onItemsTheSame = { old, new -> old == new },
onContentsTheSame = { old, new -> old == new },
),
) {

override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int,
): DevDetailProjectInfoViewHolder {
val inflater = LayoutInflater.from(parent.context)
val binding = ItemDevDetailProjectsBinding.inflate(inflater, parent, false)
return DevDetailProjectInfoViewHolder(binding)
}

override fun onBindViewHolder(holder: DevDetailProjectInfoViewHolder, position: Int) {
holder.bind(getItem(position))
}

inner class DevDetailProjectInfoViewHolder(private val binding: ItemDevDetailProjectsBinding) :
RecyclerView.ViewHolder(binding.root) {
fun bind(devDetailProjectInfo: DevDetailProjectInfo) {
binding.run {
ivProjectProfile.setImageResource(
devDetailProjectInfo.image ?: R.drawable.developer_default_image,
)
tvProjectName.text = devDetailProjectInfo.name
tvProjectDescription.text = devDetailProjectInfo.description
tvSortedProject.text = devDetailProjectInfo.sorted
tvNavigateToProject.setOnClickListener {
val intent = Intent(binding.root.context, DevDetailActivity::class.java)
startActivity(binding.root.context, intent, null)
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.zucchini.feature.devInfo.adapter
package com.zucchini.projects.adapter

import android.content.Intent
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat.startActivity
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.zucchini.domain.model.DeveloperInfo
import com.zucchini.feature.devInfo.R
import com.zucchini.feature.devInfo.databinding.ItemDeveloperBinding
import com.zucchini.feature.projects.R
import com.zucchini.feature.projects.databinding.ItemDeveloperBinding
import com.zucchini.projects.DevDetailActivity
import com.zucchini.view.ItemDiffCallback

class DeveloperInfoAdapter :
Expand All @@ -33,13 +36,21 @@ class DeveloperInfoAdapter :
inner class DeveloperInfoViewHolder(private val binding: ItemDeveloperBinding) :
RecyclerView.ViewHolder(binding.root) {
fun bind(developerInfo: DeveloperInfo) {
binding.ivProjectProfile.setImageResource(
developerInfo.image ?: R.drawable.developer_default_image,
)
binding.tvDeveloperName.text = developerInfo.name
binding.tvDeveloperField.text = developerInfo.field
binding.tvDeveloperGithub.text = "Github: ${developerInfo.githubId}"
binding.tvDeveloperClicked.text = "조회수 +${developerInfo.clicked}"
binding.run {
ivProjectProfile.setImageResource(
developerInfo.image
?: R.drawable.developer_default_image,
)
tvDeveloperName.text = developerInfo.name
tvDeveloperField.text = developerInfo.field
tvDeveloperGithub.text = "Github: ${developerInfo.githubId}"
tvDeveloperClicked.text = "조회수 +${developerInfo.clicked}"

root.setOnClickListener {
val intent = Intent(binding.root.context, DevDetailActivity::class.java)
startActivity(binding.root.context, intent, null)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ProjectsAdapter : ListAdapter<ProjectInfo, ProjectsAdapter.ProjectsViewHol
RecyclerView.ViewHolder(binding.root) {
fun bind(projectInfo: ProjectInfo) {
binding.ivProjectProfile.setImageResource(
projectInfo.image ?: R.drawable.project_profile_default,
projectInfo.image ?: com.zucchini.core.designsystem.R.drawable.project_profile_default,
)
binding.tvProjectName.text = projectInfo.name
binding.tvProjectDescription.text = projectInfo.description
Expand Down
Loading

0 comments on commit d1b6c3f

Please sign in to comment.