Skip to content

Commit

Permalink
Merge pull request #37 from ttoklip/feat/#3_우리동네_화면_구현
Browse files Browse the repository at this point in the history
Feat/#3 우리동네 화면 구현
  • Loading branch information
posite authored Feb 6, 2024
2 parents 24a776f + ed1ee0b commit dd09c94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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

Expand Down Expand Up @@ -50,7 +49,7 @@ class MyHometownFragment : BaseFragment<FragmentMyHometownBinding>(R.layout.frag
binding.searchBtn.setOnClickListener {
startActivity(SearchActivity.newIntent(requireContext()))
}
binding.myHometownFilterSpinner.setOnLongClickListener {
binding.myHometownFilterTv.setOnClickListener {
val intent = Intent(requireContext(), MyHometownAddressActivity::class.java)
startActivity(intent)
true
Expand All @@ -71,7 +70,6 @@ class MyHometownFragment : BaseFragment<FragmentMyHometownBinding>(R.layout.frag
val intent = Intent(requireContext(), WriteCommunicationActivity::class.java)
startActivity(intent)
}
initDropdownSortFilter()
initTogetherRv()
initCommunicationRv()
}
Expand Down Expand Up @@ -104,18 +102,6 @@ class MyHometownFragment : BaseFragment<FragmentMyHometownBinding>(R.layout.frag
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)
Expand Down
48 changes: 7 additions & 41 deletions app/src/main/res/layout/fragment_my_hometown.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,55 +67,21 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/banner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/rectangle_corner_10_strok_1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/logoImg"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_margin="20dp"
android:src="@drawable/ic_logo_big"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:text="똑립에서 오늘 하루도 \n즐겁고 활기찬 하루되세요~"
android:textAppearance="@style/TextAppearance.App.14sp_700"
android:textColor="#FF333333"
app:layout_constraintBottom_toBottomOf="@id/logoImg"
app:layout_constraintStart_toEndOf="@id/logoImg"
app:layout_constraintTop_toTopOf="@id/logoImg" />


</androidx.constraintlayout.widget.ConstraintLayout>

<Spinner
android:id="@+id/my_hometown_filter_spinner"

<TextView
android:id="@+id/my_hometown_filter_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="8dp"
android:background="@drawable/rectangle_corner_10_strok_1"
android:dropDownWidth="wrap_content"
android:dropDownVerticalOffset="32dp"
android:text="수도권 어딘가"
android:drawablePadding="4dp"
android:paddingVertical="7dp"
android:drawableEnd="@drawable/ic_arrow_down"
android:paddingStart="10dp"
android:paddingEnd="6dp"
android:popupBackground="@drawable/sort_spinner_dropdown"
android:spinnerMode="dropdown"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/banner" />
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down

0 comments on commit dd09c94

Please sign in to comment.