Skip to content

Commit

Permalink
Merge pull request #39 from SSU-Plector/feat/#35-detail-detail
Browse files Browse the repository at this point in the history
[Feat/#35 detail detail] 미구현 항목 구현
  • Loading branch information
kangyuri1114 authored May 29, 2024
2 parents e159375 + 70d705b commit d3449bc
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.zucchini.projects.developer

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand All @@ -13,7 +11,6 @@ import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.zucchini.domain.model.KeywordList
import com.zucchini.feature.projects.R
import com.zucchini.feature.projects.databinding.FragmentDevInfoBinding
import com.zucchini.projects.adapter.PageIndicatorAdapter
import com.zucchini.projects.developer.adapter.DeveloperInfoAdapter
Expand Down Expand Up @@ -43,7 +40,6 @@ class DevInfoFragment : Fragment() {
initKeywordAdapter()
initDeveloperAdapter()
initPageIndicator()
navigateToSubmitForms()
collectDevelopersList()
observePageChanges()

Expand Down Expand Up @@ -114,14 +110,6 @@ class DevInfoFragment : Fragment() {
}
}

private fun navigateToSubmitForms() {
binding.floatingActionButton.setOnClickListener {
val developerFormUri = getString(R.string.developer_form)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(developerFormUri))
startActivity(intent)
}
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class MypageFragment : Fragment() {

private fun navigateToWebDocs() {
binding.tvTermsOfUse.setOnClickListener {
val privacyRuleUrl = getString(R.string.service_docs_uri)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(privacyRuleUrl))
val serviceUsePolicy = getString(R.string.service_use_docs_uri)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(serviceUsePolicy))
startActivity(intent)
}
binding.tvPrivacyPolicy.setOnClickListener {
val privacyRuleUrl = getString(R.string.service_docs_uri)
val privacyRuleUrl = getString(R.string.privacy_docs_uri)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(privacyRuleUrl))
startActivity(intent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ class ProjectDetailActivity : AppCompatActivity() {
}

navigateToProjectGithubLink(projectGithubLink)
navigateToProjectLandingPageLink(it?.infoPageLink)
navigateToProjectAppLink(it?.appLink)
navigateToProjectWebLink(it?.webLink)
}
}

Expand All @@ -158,4 +161,31 @@ class ProjectDetailActivity : AppCompatActivity() {
startActivity(intent)
}
}

private fun ActivityProjectDetailBinding.navigateToProjectLandingPageLink(
projectLandingPageLink: String?,
) {
tvLandingLink.setOnClickListener {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(projectLandingPageLink))
startActivity(intent)
}
}

private fun ActivityProjectDetailBinding.navigateToProjectAppLink(
projectAppLink: String?,
) {
tvAppLink.setOnClickListener {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(projectAppLink))
startActivity(intent)
}
}

private fun ActivityProjectDetailBinding.navigateToProjectWebLink(
projectWebLink: String?,
) {
tvWebLink.setOnClickListener {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(projectWebLink))
startActivity(intent)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.zucchini.projects.projects

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand All @@ -10,6 +12,7 @@ import androidx.fragment.app.viewModels
import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import com.zucchini.core.designsystem.R
import com.zucchini.domain.model.KeywordList
import com.zucchini.domain.model.SortOption
import com.zucchini.feature.projects.databinding.FragmentProjectsBinding
Expand Down Expand Up @@ -49,6 +52,7 @@ class ProjectsFragment : Fragment() {
collectPageState()
collectProjectList()
searchWithSearchString()
initSubmitProjectButton()

return binding.root
}
Expand Down Expand Up @@ -151,6 +155,15 @@ class ProjectsFragment : Fragment() {
searchKeywordAdapter.submitList(KeywordList.searchKeyword)
}


private fun initSubmitProjectButton() {
binding.floatingActionButton.setOnClickListener {
val projectFormUri = getString(com.zucchini.feature.projects.R.string.project_form)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(projectFormUri))
startActivity(intent)
}
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.zucchini.projects.projects.adapter

import android.content.Intent
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.zucchini.domain.model.ProjectsDetailModel
import com.zucchini.feature.projects.databinding.ItemProjectDetailDevBinding
import com.zucchini.projects.developer.DevDetailActivity
import com.zucchini.view.ItemDiffCallback

class ProjectDetailDevAdapter :
Expand Down Expand Up @@ -40,6 +43,12 @@ class ProjectDetailDevAdapter :
tvDeveloperInfo1.text = developerListInProjectDetail.partList[0] ?: ""
tvDeveloperInfo2.text = developerListInProjectDetail.partList[1] ?: ""
}

root.setOnClickListener {
val intent = Intent(binding.root.context, DevDetailActivity::class.java)
intent.putExtra("developerId", developerListInProjectDetail.id)
ContextCompat.startActivity(binding.root.context, intent, null)
}
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions feature/projects/src/main/res/layout/fragment_dev_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,4 @@
app:layout_constraintStart_toStartOf="parent"
tools:listitem="@layout/item_page_indicator" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floating_action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:contentDescription="@string/floating_btn"
app:backgroundTint="@color/olive_black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_plus_24" />
</androidx.constraintlayout.widget.ConstraintLayout>
5 changes: 3 additions & 2 deletions feature/projects/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
<string name="tv_terms_of_use">이용약관</string>
<string name="tv_privacy_policy">개인정보 처리방침</string>
<string name="tv_complaint">신고하기</string>
<string name="service_docs_uri">https://coordinated-muskmelon-1dd.notion.site/c2d326eb516f48a48633bffa5df05936?pvs=4</string>
<string name="tv_complaint_link">https://open.kakao.com/o/sDP9VYRb</string>
<string name="service_use_docs_uri">https://www.notion.so/c2d326eb516f48a48633bffa5df05936?pvs=4</string>
<string name="privacy_docs_uri">https://www.notion.so/c223b37f5ba44f05b162bf9c3f463ea5?pvs=4</string>
<string name="tv_complaint_link">https://open.kakao.com/o/gnLnw8pg</string>
<string name="developer_form">https://forms.gle/UsAn9zX74vrJYxG37</string>
<string name="project_form">https://forms.gle/3rsgKP3UFLPySJBFA</string>
<string name="github_default_link">https://github.com/</string>
Expand Down

0 comments on commit d3449bc

Please sign in to comment.