Skip to content

Commit

Permalink
[FEAT] #6 #8 - 홈 > 찜한 목록 리스트, 교육 > 찜
Browse files Browse the repository at this point in the history
  • Loading branch information
jung0115 committed Aug 4, 2023
1 parent 0785f6e commit 0836439
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class EducationFragment : Fragment() {
}

fun addEducationCount(count: Int) {
initViewPager(count, 0)
initViewPager(count, 2)
}

// viewPager 세팅
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ class EduAllFragment : Fragment(), EduOrderBottomFragment.EduOrderListener {
fun getEducation(count: Int) {
// 처음 보여줄 교육 데이터 10개 가져와서 나열
apiGetEducationInfo(
1,
count,
20,
22,
addEducationList = {
addEducationItems(it)
}
Expand All @@ -188,7 +188,7 @@ class EduAllFragment : Fragment(), EduOrderBottomFragment.EduOrderListener {
+ education.ENDDATE.replace("-", "/"), // 교육 기간
applicationStart = education.APPLICATIONSTARTDATE,
applicationEnd = education.APPLICATIONSTARTDATE,
isBookmark = false // 찜 유무
isBookmark = true // 찜 유무
)
)
if(education.APPLY_STATE == "접수중") {
Expand Down Expand Up @@ -231,15 +231,15 @@ class EduAllFragment : Fragment(), EduOrderBottomFragment.EduOrderListener {
educationAdapter.notifyDataSetChanged()

// 모두보기 선택
binding.linearEduFilterAll.setBackgroundResource(R.drawable.shape_select_day_selected)
binding.linearEduFilterAll.setBackgroundResource(R.drawable.shape_edu_filter_blue)
binding.textEduFilterAll.setTextColor(requireContext().getColor(R.color.white))

// 접수중 해제
binding.linearEduFilterIng.setBackgroundResource(R.drawable.shape_select_day_unselected)
binding.linearEduFilterIng.setBackgroundResource(R.drawable.shape_edu_filter_gray)
binding.textEduFilterIng.setTextColor(requireContext().getColor(R.color.gray05))

// 마감 해제
binding.linearEduFilterEnd.setBackgroundResource(R.drawable.shape_select_day_unselected)
binding.linearEduFilterEnd.setBackgroundResource(R.drawable.shape_edu_filter_gray)
binding.textEduFilterEnd.setTextColor(requireContext().getColor(R.color.gray05))
}

Expand All @@ -260,15 +260,15 @@ class EduAllFragment : Fragment(), EduOrderBottomFragment.EduOrderListener {
educationAdapter.notifyDataSetChanged()

// 모두보기 해제
binding.linearEduFilterAll.setBackgroundResource(R.drawable.shape_select_day_unselected)
binding.linearEduFilterAll.setBackgroundResource(R.drawable.shape_edu_filter_gray)
binding.textEduFilterAll.setTextColor(requireContext().getColor(R.color.gray05))

// 접수중 선택
binding.linearEduFilterIng.setBackgroundResource(R.drawable.shape_select_day_selected)
binding.linearEduFilterIng.setBackgroundResource(R.drawable.shape_edu_filter_blue)
binding.textEduFilterIng.setTextColor(requireContext().getColor(R.color.white))

// 마감 해제
binding.linearEduFilterEnd.setBackgroundResource(R.drawable.shape_select_day_unselected)
binding.linearEduFilterEnd.setBackgroundResource(R.drawable.shape_edu_filter_gray)
binding.textEduFilterEnd.setTextColor(requireContext().getColor(R.color.gray05))
}

Expand All @@ -289,15 +289,15 @@ class EduAllFragment : Fragment(), EduOrderBottomFragment.EduOrderListener {
educationAdapter.notifyDataSetChanged()

// 모두보기 해제
binding.linearEduFilterAll.setBackgroundResource(R.drawable.shape_select_day_unselected)
binding.linearEduFilterAll.setBackgroundResource(R.drawable.shape_edu_filter_gray)
binding.textEduFilterAll.setTextColor(requireContext().getColor(R.color.gray05))

// 접수중 해제
binding.linearEduFilterIng.setBackgroundResource(R.drawable.shape_select_day_unselected)
binding.linearEduFilterIng.setBackgroundResource(R.drawable.shape_edu_filter_gray)
binding.textEduFilterIng.setTextColor(requireContext().getColor(R.color.gray05))

// 마감 선택
binding.linearEduFilterEnd.setBackgroundResource(R.drawable.shape_select_day_selected)
binding.linearEduFilterEnd.setBackgroundResource(R.drawable.shape_edu_filter_blue)
binding.textEduFilterEnd.setTextColor(requireContext().getColor(R.color.white))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import com.ssjm.sw_hackathon.databinding.FragmentEduBookmarkBinding
import com.ssjm.sw_hackathon.education.recycler.EducationAdapter
import com.ssjm.sw_hackathon.education.recycler.EducationItem
import com.ssjm.sw_hackathon.education.recycler.EducationItemInterface
import com.ssjm.sw_hackathon.educationApi.EducationRow
import com.ssjm.sw_hackathon.educationApi.apiGetEducationInfo

// 교육 > 찜
class EduBookmarkFragment : Fragment() {
Expand Down Expand Up @@ -42,6 +44,15 @@ class EduBookmarkFragment : Fragment() {
// recyclerview 세팅
initRecycler()

binding.textBookmarkNoticeCount.text = "총 2건이 있습니다."

apiGetEducationInfo(
1,
2,
addEducationList = {
addEducationItems(it)
}
)

}

Expand All @@ -61,6 +72,35 @@ class EduBookmarkFragment : Fragment() {
bookmarkEducationItems!!.add(edu)
educationAdapter.notifyDataSetChanged()
}
private fun addEducationItems(educationItems: MutableList<EducationRow>?) {
if(educationItems != null) {
for(education in educationItems) {
bookmarkEducationItems!!.add(
EducationItem(
status = education.APPLY_STATE, // 모집중 or 마감
title = education.SUBJECT, // 교육 제목
applicationPeriod
= "신청기간: "
+ education.APPLICATIONSTARTDATE.replace("-", "/")
+ " ~ "
+ education.APPLICATIONENDDATE.replace("-", "/"), // 신청 기간
educationPeriod
= "교육기간: "
+ education.STARTDATE.replace("-", "/")
+ " ~ "
+ education.ENDDATE.replace("-", "/"), // 교육 기간
applicationStart = education.APPLICATIONSTARTDATE,
applicationEnd = education.APPLICATIONSTARTDATE,
isBookmark = false // 찜 유무
)
)
}

// adapter 새로고침
educationAdapter.notifyDataSetChanged()
}
}


override fun onDestroy() {
super.onDestroy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class HomeFragment : Fragment() {
)
binding.recyclerviewHomeTodo.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
binding.recyclerviewHomeTodo.adapter = homeTodoAdapter
binding.recyclerviewHomeTodo.isNestedScrollingEnabled = true
binding.recyclerviewHomeTodo.isNestedScrollingEnabled = false
homeTodoAdapter.items = homeTodoItems!!
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:background="@drawable/shape_select_day_selected">
android:background="@drawable/shape_edu_filter_blue">

<TextView
android:id="@+id/text_edu_filter_all"
Expand All @@ -43,7 +43,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:background="@drawable/shape_select_day_unselected">
android:background="@drawable/shape_edu_filter_gray">

<TextView
android:id="@+id/text_edu_filter_ing"
Expand All @@ -62,7 +62,7 @@
android:id="@+id/linear_edu_filter_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_select_day_unselected">
android:background="@drawable/shape_edu_filter_gray">

<TextView
android:id="@+id/text_edu_filter_end"
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layouts/home/drawable/shape_show_all_btn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle">

<solid android:color="@color/main_color_1"/>
<corners
android:radius="19dp" />

</shape>
46 changes: 45 additions & 1 deletion app/src/main/res/layouts/home/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
android:id="@+id/recyclerview_home_todo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:paddingLeft="20dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="48dp"
android:layout_below="@id/relative_home_title"
Expand All @@ -131,5 +131,49 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_todo_of_home"/>

<!-- 교육 목록 -->
<RelativeLayout
android:id="@+id/relative_edu_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray07"
android:layout_below="@id/recyclerview_home_todo"
android:layout_alignParentBottom="true">

<TextView
android:id="@+id/text_name2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:layout_marginLeft="20dp"
android:text="우먼테크"
android:textSize="26sp"
android:textStyle="bold"
android:textColor="@color/black01" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="31dp"
android:layout_marginRight="20dp"
android:paddingHorizontal="10dp"
android:paddingVertical="6dp"
android:text="@string/show_all"
android:textSize="14sp"
android:textColor="@color/white"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:background="@drawable/shape_show_all_btn"/>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview_edu_all"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_below="@+id/text_name2"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

</RelativeLayout>

</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<string name="home_title1">을(를) 꿈꾸는</string>
<string name="home_title2">님 의</string>
<string name="home_title3">오늘의 실천사항</string>
<string name="show_all">모두 보기</string>

<!-- 교육 -->
<string name="info_education">중장년을 위한\n교육 정보입니다.</string>
Expand Down

0 comments on commit 0836439

Please sign in to comment.