Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

내 계정 화면 내에 세부 화면 구성 #100

Merged
merged 13 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dependencies {
projects.main,
projects.onboard,
projects.registerCafe,
projects.setting,
projects.designResource,
projects.common,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
~ Designed and developed by Wedemy 2023.
~
~ Licensed under the MIT.
~ Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="17dp"
android:viewportWidth="16"
android:viewportHeight="17">
<path
android:fillColor="#00000000"
android:pathData="M2,5.5L8,11.5L14,5.5"
android:strokeWidth="1.5"
android:strokeColor="#9CA3AF"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>
20 changes: 20 additions & 0 deletions design-resource/src/main/res/drawable/ic_arrow_up_outlined_16.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
~ Designed and developed by Wedemy 2023.
~
~ Licensed under the MIT.
~ Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="17dp"
android:viewportWidth="16"
android:viewportHeight="17">
<path
android:fillColor="#00000000"
android:pathData="M14,11.5L8,5.5L2,11.5"
android:strokeWidth="1.5"
android:strokeColor="#9CA3AF"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>
29 changes: 29 additions & 0 deletions design-resource/src/main/res/drawable/ic_close_filled_16.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<group>
<clip-path
android:pathData="M0,0h16v16h-16z"/>
<path
android:pathData="M8,8m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"
android:strokeAlpha="0.5"
android:fillColor="#9CA3AF"
android:fillAlpha="0.5"/>
<path
android:pathData="M5,11L11,5"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#ffffff"
android:strokeLineCap="round"/>
<path
android:pathData="M5,5L11,11"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#ffffff"
android:strokeLineCap="round"/>
</group>
</vector>
27 changes: 0 additions & 27 deletions design-resource/src/main/res/drawable/ic_x_colored_24.xml

This file was deleted.

20 changes: 20 additions & 0 deletions design-resource/src/main/res/drawable/ic_x_filled_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2,22L22,2"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#111827"
android:strokeLineCap="round"/>
<path
android:pathData="M2,2L22,22"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#111827"
android:strokeLineCap="round"/>
</vector>
1 change: 1 addition & 0 deletions main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ android {

buildFeatures {
viewBinding = true
buildConfig = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CafeImageAdapter(
with(holder) {
bind(imageUrl)
binding.root.setOnClickListener {
clickListener(adapterPosition)
clickListener(bindingAdapterPosition)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NewCafeAdapter(
with(holder) {
bind(cafe)
binding.root.setOnClickListener {
clickListener(adapterPosition)
clickListener(bindingAdapterPosition)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@ import us.wedemy.eggeum.android.main.ui.item.NoticeItem

class NoticeAdapter(
private var noticeList: List<NoticeItem> = emptyList(),
private val clickListener: (Int) -> Unit,
) : RecyclerView.Adapter<NoticeViewHolder>() {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
NoticeViewHolder(ItemNoticeBinding.inflate(parent.context.layoutInflater, parent, false))

override fun onBindViewHolder(holder: NoticeViewHolder, position: Int) {
val notice = noticeList[position]
with(holder) {
bind(notice)
binding.root.setOnClickListener {
clickListener(adapterPosition)
}
}
holder.bind(notice)
}

override fun getItemCount() = noticeList.size
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Designed and developed by Wedemy 2023.
*
* Licensed under the MIT.
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

package us.wedemy.eggeum.android.main.ui.adapter

import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import us.wedemy.eggeum.android.common.extension.layoutInflater
import us.wedemy.eggeum.android.main.databinding.ItemNoticeCardBinding
import us.wedemy.eggeum.android.main.ui.adapter.viewholder.NoticeCardViewHolder
import us.wedemy.eggeum.android.main.ui.item.NoticeCardItem

class NoticeCardAdapter(
private var noticeList: List<NoticeCardItem> = emptyList(),
private val clickListener: (Int) -> Unit,
) : RecyclerView.Adapter<NoticeCardViewHolder>() {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
NoticeCardViewHolder(ItemNoticeCardBinding.inflate(parent.context.layoutInflater, parent, false))

override fun onBindViewHolder(holder: NoticeCardViewHolder, position: Int) {
val notice = noticeList[position]
with(holder) {
bind(notice)
binding.root.setOnClickListener {
clickListener(bindingAdapterPosition)
}
}
}

override fun getItemCount() = noticeList.size
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Designed and developed by Wedemy 2023.
*
* Licensed under the MIT.
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

package us.wedemy.eggeum.android.main.ui.adapter.viewholder

import androidx.recyclerview.widget.RecyclerView
import us.wedemy.eggeum.android.main.databinding.ItemNoticeCardBinding
import us.wedemy.eggeum.android.main.ui.item.NoticeCardItem

class NoticeCardViewHolder(val binding: ItemNoticeCardBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(notice: NoticeCardItem) {
binding.tvHomeNoticeTitle.text = notice.title
binding.tvNotificationDate.text = notice.date
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import us.wedemy.eggeum.android.main.ui.item.NoticeItem

class NoticeViewHolder(val binding: ItemNoticeBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(notice: NoticeItem) {
binding.tvHomeNoticeTitle.text = notice.title
binding.tvNotificationDate.text = notice.date
"[공지] ${notice.title}".also { binding.tvNoticeTitle.text = it }
// binding.tvNoticeContent.text = notice.content
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

package us.wedemy.eggeum.android.main.ui
package us.wedemy.eggeum.android.main.ui.home

import android.os.Bundle
import android.view.View
Expand All @@ -15,16 +15,16 @@ import us.wedemy.eggeum.android.common.ui.BaseFragment
import us.wedemy.eggeum.android.common.extension.addDivider
import us.wedemy.eggeum.android.main.databinding.FragmentHomeBinding
import us.wedemy.eggeum.android.main.ui.adapter.NewCafeAdapter
import us.wedemy.eggeum.android.main.ui.adapter.NoticeAdapter
import us.wedemy.eggeum.android.main.ui.adapter.NoticeCardAdapter
import us.wedemy.eggeum.android.main.ui.item.NewCafeItem
import us.wedemy.eggeum.android.main.ui.item.NoticeItem
import us.wedemy.eggeum.android.main.ui.item.NoticeCardItem

@AndroidEntryPoint
class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override fun getViewBinding() = FragmentHomeBinding.inflate(layoutInflater)

private lateinit var newCafeAdapter: NewCafeAdapter
private lateinit var noticeAdapter: NoticeAdapter
private lateinit var noticeAdapter: NoticeCardAdapter

private val newCafes = listOf(
NewCafeItem("스타벅스 강남역신분당역사점", "서울특별시 강남구 강남대로 396"),
Expand All @@ -43,12 +43,12 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
)

private val notices = listOf(
NoticeItem("공부하기 좋은 카페 찾는 법", "23.03.01"),
NoticeItem("카페 평가하는 법", "23.03.01"),
NoticeItem("일이삼사오육칠팔구십일이삼사오육", "23.03.01"),
NoticeItem("공부하기 좋은 카페 찾는 법", "23.03.01"),
NoticeItem("카페 평가하는 법", "23.03.01"),
NoticeItem("일이삼사오육칠팔구십일이삼사오육", "23.03.01"),
NoticeCardItem("공부하기 좋은 카페 찾는 법", "23.03.01"),
NoticeCardItem("카페 평가하는 법", "23.03.01"),
NoticeCardItem("일이삼사오육칠팔구십일이삼사오육", "23.03.01"),
NoticeCardItem("공부하기 좋은 카페 찾는 법", "23.03.01"),
NoticeCardItem("카페 평가하는 법", "23.03.01"),
NoticeCardItem("일이삼사오육칠팔구십일이삼사오육", "23.03.01"),
)

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand All @@ -59,9 +59,11 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
}

private fun initView() {
newCafeAdapter = NewCafeAdapter(newCafes) { _ -> run {} }
noticeAdapter = NoticeCardAdapter(notices) { _ -> run {} }
with(binding) {
newCafeAdapter = NewCafeAdapter(newCafes) { _ -> run {} }
noticeAdapter = NoticeAdapter(notices) { _ -> run {} }
noticeAdapter = NoticeCardAdapter(notices) { _ -> run {} }

rvHomeNewCafe.apply {
setHasFixedSize(true)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Designed and developed by Wedemy 2023.
*
* Licensed under the MIT.
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

package us.wedemy.eggeum.android.main.ui.item

data class NoticeCardItem(
val title: String,
val date: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ package us.wedemy.eggeum.android.main.ui.item

data class NoticeItem(
val title: String,
val date: String,
val content: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

package us.wedemy.eggeum.android.setting.ui
package us.wedemy.eggeum.android.main.ui.myaccount

import android.content.res.ColorStateList
import android.os.Bundle
Expand All @@ -19,14 +19,14 @@ import coil.load
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import timber.log.Timber
import us.wedemy.eggeum.android.setting.R
import us.wedemy.eggeum.android.setting.databinding.FragmentEditMyInfoBinding
import us.wedemy.eggeum.android.setting.viewmodel.EditMyInfoViewModel
import us.wedemy.eggeum.android.common.extension.repeatOnStarted
import us.wedemy.eggeum.android.common.extension.textChangesAsFlow
import us.wedemy.eggeum.android.common.ui.BaseFragment
import us.wedemy.eggeum.android.common.util.EditTextState
import us.wedemy.eggeum.android.common.util.TextInputError
import us.wedemy.eggeum.android.main.R
import us.wedemy.eggeum.android.main.databinding.FragmentEditMyInfoBinding
import us.wedemy.eggeum.android.main.viewmodel.EditMyInfoViewModel

@AndroidEntryPoint
class EditMyInfoFragment : BaseFragment<FragmentEditMyInfoBinding>() {
Expand Down Expand Up @@ -124,7 +124,7 @@ class EditMyInfoFragment : BaseFragment<FragmentEditMyInfoBinding>() {
private fun setTooShortTextError() {
binding.tilEditNickname.apply {
error = getString(R.string.too_short_text_error)
setEndIconDrawable(us.wedemy.eggeum.android.design.R.drawable.ic_x_filled_16)
setEndIconDrawable(us.wedemy.eggeum.android.design.R.drawable.ic_x_colored_16)
val color = ContextCompat.getColor(requireContext(), us.wedemy.eggeum.android.design.R.color.gray_400)
setEndIconTintList(ColorStateList.valueOf(color))
setEndIconOnClickListener {
Expand Down
Loading