Skip to content

Commit

Permalink
Merge pull request #35 from ttoklip/feat/#3_우리동네_화면_구현
Browse files Browse the repository at this point in the history
Feat/#3 우리동네 화면 구현
  • Loading branch information
hangunhee39 authored Feb 6, 2024
2 parents e43c3cd + 7548fc0 commit 0fe639a
Show file tree
Hide file tree
Showing 57 changed files with 4,294 additions and 87 deletions.
51 changes: 51 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,48 @@
android:name=".presentation.mypage.MyHoneyTipActivity"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".presentation.intro.IntroActivity"
android:exported="false" />
<activity
android:name=".presentation.login.LoginActivity"
android:exported="false" />
<activity
android:name=".presentation.signup.SignupActivity"
android:exported="false" />
<activity
android:name=".presentation.hometown.TogetherActivity"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".presentation.hometown.CommunicationActivity"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".presentation.hometown.WriteTogetherActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="false" />
<activity
android:name=".presentation.hometown.WriteCommunicationActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="false" />
<activity
android:name=".presentation.hometown.ReadCommunicationActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="false" />
<activity
android:name=".presentation.hometown.TradeLocationActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="false" />
<activity
android:name=".presentation.hometown.ReadTogetherActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="false" />
<activity android:name=".presentation.intro.IntroActivity"
android:exported="false"/>
<activity android:name=".presentation.login.LoginActivity"
Expand All @@ -105,6 +147,15 @@
<activity
android:name=".presentation.MainActivity"
android:exported="false"/>
<!-- <activity-->
<!-- android:name=".presentation.MainActivity"-->
<!-- android:exported="true">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->

<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->

<service
android:name="com.google.android.gms.metadata.ModuleDependencies"
Expand Down
60 changes: 0 additions & 60 deletions app/src/main/java/com/umc/ttoklip/presentation/TownFragment.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
package com.umc.ttoklip.presentation.hometown

import androidx.recyclerview.widget.LinearLayoutManager
import com.umc.ttoklip.R
import com.umc.ttoklip.databinding.ActivityCommunicationBinding
import com.umc.ttoklip.presentation.base.BaseActivity
import com.umc.ttoklip.presentation.hometown.adapter.Communication
import com.umc.ttoklip.presentation.hometown.adapter.CommunicationAdapter
import com.umc.ttoklip.presentation.hometown.adapter.OnItemClickListener
import com.umc.ttoklip.presentation.mypage.SortSpinnerAdapter
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class CommunicationActivity :
BaseActivity<ActivityCommunicationBinding>(R.layout.activity_communication),
OnItemClickListener {
override fun initView() {
val sortFilters = listOf(
getString(R.string.sort_most_recent),
getString(R.string.sort_popularity),
getString(R.string.sort_most_comments),
getString(R.string.sort_most_scrap)
)
binding.honeyTipFilterSpinner.adapter =
SortSpinnerAdapter(this, sortFilters)
binding.honeyTipFilterSpinner.setSelection(0)

val honeyTipList = listOf(
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
Communication(
"똑똑이",
"음식물 쓰레기 냄새 방지!!",
"집에 가끔씩이지만 나타나는 바퀴벌레, 잘못 처리하면 알깐다고도...",
"1일전",
0
),
)
val adapter = CommunicationAdapter(this)
binding.communicationRv.layoutManager = LinearLayoutManager(this)
binding.communicationRv.adapter = adapter
adapter.submitList(honeyTipList)

binding.backBtn.setOnClickListener {
finish()
}
}

override fun initObserver() {

}

override fun onClick(communication: Communication) {

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
package com.umc.ttoklip.presentation.hometown

import android.content.Intent
import androidx.recyclerview.widget.LinearLayoutManager
import com.umc.ttoklip.R
import com.umc.ttoklip.databinding.FragmentMyHometownBinding
import com.umc.ttoklip.presentation.alarm.AlarmActivity
import com.umc.ttoklip.presentation.base.BaseFragment
import com.umc.ttoklip.presentation.hometown.adapter.OnTogetherClickListener
import com.umc.ttoklip.presentation.hometown.adapter.Together
import com.umc.ttoklip.presentation.hometown.adapter.TogetherAdapter
import com.umc.ttoklip.presentation.mypage.MyHometownAddressActivity
import com.umc.ttoklip.presentation.mypage.SortSpinnerAdapter
import com.umc.ttoklip.presentation.search.SearchActivity
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MyHometownFragment : BaseFragment<FragmentMyHometownBinding>(R.layout.fragment_my_hometown),
OnTogetherClickListener {
private val togetherAdapter by lazy {
TogetherAdapter(
this,
getString(R.string.together_title)
)
}
private val communicationAdapter by lazy {
TogetherAdapter(
this,
getString(R.string.communication_title)
)
}

override fun initObserver() {

}

override fun initView() {
binding.seeDetailTogetherBtn.setOnClickListener {
val intent = Intent(requireContext(), TogetherActivity::class.java)
startActivity(intent)
}

binding.seeDetailCommunicationBtn.setOnClickListener {
val intent = Intent(requireContext(), CommunicationActivity::class.java)
startActivity(intent)
}
binding.bellBtn.setOnClickListener {
startActivity(AlarmActivity.newIntent(requireContext()))
}
binding.searchBtn.setOnClickListener {
startActivity(SearchActivity.newIntent(requireContext()))
}
binding.myHometownFilterSpinner.setOnLongClickListener {
val intent = Intent(requireContext(), MyHometownAddressActivity::class.java)
startActivity(intent)
true
}
binding.writeTogetherBtn.setOnClickListener {
val intent = Intent(requireContext(), WriteTogetherActivity::class.java)
startActivity(intent)
}
binding.writeTogetherPlus.setOnClickListener {
val intent = Intent(requireContext(), WriteTogetherActivity::class.java)
startActivity(intent)
}
binding.writeCommunicationBtn.setOnClickListener {
val intent = Intent(requireContext(), WriteCommunicationActivity::class.java)
startActivity(intent)
}
binding.writeCommunicationPlus.setOnClickListener {
val intent = Intent(requireContext(), WriteCommunicationActivity::class.java)
startActivity(intent)
}
initDropdownSortFilter()
initTogetherRv()
initCommunicationRv()
}

private fun initCommunicationRv() {
val togethers = listOf(
Together("같이 햇반 대량 구매하실 분?", "상록구 해양동 한양대학로 12"),
Together("같이 햇반 대량 구매하실 분?", "상록구 해양동 한양대학로 12"),
Together("같이 햇반 대량 구매하실 분?", "상록구 해양동 한양대학로 12")
)

binding.communicationRv.apply {
adapter = communicationAdapter
layoutManager = LinearLayoutManager(requireContext())
}
communicationAdapter.submitList(togethers)
}

private fun initTogetherRv() {
val togethers = listOf(
Together("같이 햇반 대량 구매하실 분?", "상록구 해양동 한양대학로 12"),
Together("같이 햇반 대량 구매하실 분?", "상록구 해양동 한양대학로 12"),
Together("같이 햇반 대량 구매하실 분?", "상록구 해양동 한양대학로 12")
)

binding.togetherRv.apply {
adapter = togetherAdapter
layoutManager = LinearLayoutManager(requireContext())
}
togetherAdapter.submitList(togethers)
}

private fun initDropdownSortFilter() {
val sortFilters = listOf(
getString(R.string.sort_most_recent),
getString(R.string.sort_popularity),
getString(R.string.sort_most_comments),
getString(R.string.sort_most_scrap)
)
binding.myHometownFilterSpinner.adapter =
SortSpinnerAdapter(requireContext(), sortFilters)
binding.myHometownFilterSpinner.setSelection(0)
}

override fun onClick(items: Together, type: String) {
if (type == getString(R.string.together_title)) {
val intent = Intent(requireContext(), ReadTogetherActivity::class.java)
startActivity(intent)
} else {
val intent = Intent(requireContext(), ReadCommunicationActivity::class.java)
startActivity(intent)
}
}
}
Loading

0 comments on commit 0fe639a

Please sign in to comment.