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

feat: add scroll action in ProfileFragment #158

Merged
merged 26 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
afb0ad5
chore: remove unused behavior.kt
HeewonP825 Jan 25, 2024
7782ba3
feat: add SwipeRefresh in Timeline
HeewonP825 Jan 25, 2024
17d0e2c
feat: try to forbid basicBackbtn in ProfileFragment
HeewonP825 Jan 25, 2024
1d4ccf3
feat: add nestedScrollableHost/icon & edit color theme name
HeewonP825 Jan 26, 2024
042d4f1
chore: add Timber in Dependency & MainActivity
HeewonP825 Jan 26, 2024
014b772
feat: remove scrollView in RV
HeewonP825 Jan 27, 2024
b211fba
feat: remove scrollView in RV
HeewonP825 Jan 27, 2024
1badc08
feat: remove scrollView in RV
HeewonP825 Jan 29, 2024
c9cd1fb
feat: divide ConstraintLayout into 2
HeewonP825 Jan 29, 2024
e0d8340
feat: edit xml for scrollView
HeewonP825 Jan 30, 2024
8fdee10
feat: add action in backbtn for ProfileFragment
HeewonP825 Jan 30, 2024
1522f5c
feat: add SwipeRefresh in xml
HeewonP825 Jan 30, 2024
e8d2945
feat: add swipe action in Tablayout
HeewonP825 Jan 30, 2024
cecabcb
extract Method for RV in ProfileFragment
HeewonP825 Jan 30, 2024
1815f38
feat: try to add Highlight RV for ProfileFragment Tablayout
HeewonP825 Jan 31, 2024
9e7eaeb
feat: make FAB cannot scroll
HeewonP825 Jan 31, 2024
551ee38
chore:add eol
HeewonP825 Jan 31, 2024
29ee044
feat: edit popupMenu constraintLayout
HeewonP825 Jan 31, 2024
c49fd90
chore: add eol
HeewonP825 Jan 31, 2024
ff578c2
chore: reflect review
HeewonP825 Jan 31, 2024
4a43b7b
chore: reflect review
HeewonP825 Jan 31, 2024
8a45fab
chore: reflect review
HeewonP825 Jan 31, 2024
301fbd8
chore: reflect review
HeewonP825 Jan 31, 2024
b8fa666
chore: reflect review
HeewonP825 Jan 31, 2024
843362c
chore: add eol
HeewonP825 Jan 31, 2024
6fb5420
chore: add eol
HeewonP825 Jan 31, 2024
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
2 changes: 0 additions & 2 deletions src/mobile/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ dependencies {
implementation("com.github.bumptech.glide:glide:4.14.1")
annotationProcessor("com.github.bumptech.glide:compiler:4.14.1")
implementation ("com.github.bumptech.glide:annotations:4.14.1")
// kapt 'com.github.bumptech.glide:compiler:4.14.1'
implementation ("de.hdodenhof:circleimageview:3.1.0") //Circle ImageView
implementation ("com.caverock:androidsvg:1.2.1")

// Navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {

super.onCreate(savedInstanceState)

setContentView(binding.root)

/* Status Bar & Navigation Bar */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
package com.smilegate.Easel.data

import com.smilegate.Easel.R
import com.smilegate.Easel.domain.model.HighlightItem
import com.smilegate.Easel.domain.model.TimelineItem

class ProfileTapRvDataHelper {
companion object {
fun getDataForTab(tabPosition: Int): List<TimelineItem> {
return when (tabPosition) {
0 -> generateDummyMyPostData() // 게시물
1 -> generateDummyReplyData() // 답글
2 -> generateDummyMyPostData() // 하이라이트
3 -> generateDummyMediaData() // 미디어
4 -> generateDummyLikedData() // 마음에 들어요
else -> emptyList() // 기본적으로 빈 리스트 반환
}
}
}
}

fun generateDummyMyPostData(): List<TimelineItem> {
val profileImgId = R.drawable.sample_profile_img5
val profileImgId1 = R.drawable.sample_profile_img1
val profileImgId2 = R.drawable.sample_profile_img2
val profileImgId3 = R.drawable.sample_profile_img3
val profileImgId4 = R.drawable.sample_profile_img4

val contentImgId = R.drawable.sample_content_img1
val contentImgId1 = R.drawable.sample_content_img2
val contentImgId2 = R.drawable.sample_content_img3
val contentImgId3 = R.drawable.sample_content_img4

val timelineList = listOf(
TimelineItem(profileImgId, "이원영", "@courtney81819", "1시간",
"아 슈뢰딩거가 아닌가?ㅋ", null, null,
2, 1, null, 24),


TimelineItem(profileImgId2, "이상민", "@isangmi92157279", "32분",
"비가 내리는 날이에요.\n추적이는 바닥을 보며 걷다보니 카페가 나와 커피를 사 봤어요.", contentImgId, null,
4, 2, 5, 121),

TimelineItem(profileImgId1, "박희원", "@_Parking1_", "18분",
"타래 스타트", contentImgId1, null,
1, 1, null, 114),

TimelineItem(profileImgId4, "김도율", "@doxxx93", "8분",
"테스트", null, null,
1, null, 2, 32),

TimelineItem(profileImgId2, "이상민", "@isangmi92157279", "1주",
"커피는 아이스 아메리카노에요.\n컵에 스며든 물방울처럼, 제 마음을 촉촉하게 만들어 주네요..^^", contentImgId2, null,
3, 4, 2, 89),

TimelineItem(profileImgId3, "김도현", "@KittenDiger", "4일",
"테스트 인용의 인용", null, null,
1, null, null, 30),

TimelineItem(profileImgId, "이원영", "@courtney81819", "3시간",
"청하 로제", contentImgId3, null,
3, null, 2, 334),

TimelineItem(profileImgId3, "김도현", "@KittenDiger", "4일",
"구글인ㅇㅎㅇ의 인용의 인용", null, null,
1, 2, null, 50),
)

return timelineList.shuffled()
}

fun generateDummyReplyData(): List<TimelineItem> {
val profileImgId = R.drawable.sample_profile_img5
val profileImgId1 = R.drawable.sample_profile_img1
val profileImgId2 = R.drawable.sample_profile_img2
val profileImgId4 = R.drawable.sample_profile_img4

val contentImgId = R.drawable.sample_content_img1
val contentImgId1 = R.drawable.sample_content_img2
val contentImgId2 = R.drawable.sample_content_img3

val timelineList = listOf(

TimelineItem(profileImgId1, "박희원", "@_Parking1_", "18분",
"타래 스타트", contentImgId1, null,
1, 1, null, 114),

TimelineItem(profileImgId, "이원영", "@courtney81819", "1시간",
"아 슈뢰딩거가 아닌가?ㅋ", null, null,
2, 1, null, 24),

TimelineItem(profileImgId2, "이상민", "@isangmi92157279", "32분",
"비가 내리는 날이에요.\n추적이는 바닥을 보며 걷다보니 카페가 나와 커피를 사 봤어요.", contentImgId, null,
4, 2, 5, 121),

TimelineItem(profileImgId4, "김도율", "@doxxx93", "8분",
"테스트", null, null,
1, null, 2, 32),

TimelineItem(profileImgId2, "이상민", "@isangmi92157279", "1주",
"커피는 아이스 아메리카노에요.\n컵에 스며든 물방울처럼, 제 마음을 촉촉하게 만들어 주네요..^^", contentImgId2, null,
3, 4, 2, 89),
)

return timelineList.shuffled()
}

fun generateDummyHighlightData(): List<HighlightItem> {

val highlightItem = listOf(
HighlightItem("프로필에 하이라이트 추가", "프로필에 게시물을 하이라이트하려면 Premium을 구독해\n야 합니다.", "Premium 구독하기"),
)

return highlightItem.shuffled()
}

fun generateDummyMediaData(): List<TimelineItem> {
val profileImgId = R.drawable.sample_profile_img5
val profileImgId2 = R.drawable.sample_profile_img2
val profileImgId3 = R.drawable.sample_profile_img3

val contentImgId = R.drawable.sample_content_img1
val contentImgId2 = R.drawable.sample_content_img3
val contentImgId3 = R.drawable.sample_content_img4

val timelineList = listOf(

TimelineItem(profileImgId, "이원영", "@courtney81819", "3시간",
"청하 로제", contentImgId3, null,
3, null, 2, 334),

TimelineItem(profileImgId3, "김도현", "@KittenDiger", "4일",
"구글인ㅇㅎㅇ의 인용의 인용", null, null,
1, 2, null, 50),

TimelineItem(profileImgId, "이원영", "@courtney81819", "1시간",
"아 슈뢰딩거가 아닌가?ㅋ", null, null,
2, 1, null, 24),


TimelineItem(profileImgId2, "이상민", "@isangmi92157279", "32분",
"비가 내리는 날이에요.\n추적이는 바닥을 보며 걷다보니 카페가 나와 커피를 사 봤어요.", contentImgId, null,
4, 2, 5, 121),

TimelineItem(profileImgId2, "이상민", "@isangmi92157279", "1주",
"커피는 아이스 아메리카노에요.\n컵에 스며든 물방울처럼, 제 마음을 촉촉하게 만들어 주네요..^^", contentImgId2, null,
3, 4, 2, 89),

TimelineItem(profileImgId3, "김도현", "@KittenDiger", "4일",
"테스트 인용의 인용", null, null,
1, null, null, 30),
)

return timelineList.shuffled()
}

fun generateDummyLikedData(): List<TimelineItem> {
val profileImgId = R.drawable.sample_profile_img5
val profileImgId1 = R.drawable.sample_profile_img1
val profileImgId2 = R.drawable.sample_profile_img2
val profileImgId3 = R.drawable.sample_profile_img3
val profileImgId4 = R.drawable.sample_profile_img4

val contentImgId1 = R.drawable.sample_content_img2
val contentImgId2 = R.drawable.sample_content_img3
val contentImgId3 = R.drawable.sample_content_img4

val timelineList = listOf(
TimelineItem(profileImgId, "이원영", "@courtney81819", "1시간",
"아 슈뢰딩거가 아닌가?ㅋ", null, null,
2, 1, null, 24),

TimelineItem(profileImgId1, "박희원", "@_Parking1_", "18분",
"타래 스타트", contentImgId1, null,
1, 1, null, 114),

TimelineItem(profileImgId4, "김도율", "@doxxx93", "8분",
"테스트", null, null,
1, null, 2, 32),

TimelineItem(profileImgId2, "이상민", "@isangmi92157279", "1주",
"커피는 아이스 아메리카노에요.\n컵에 스며든 물방울처럼, 제 마음을 촉촉하게 만들어 주네요..^^", contentImgId2, null,
3, 4, 2, 89),

TimelineItem(profileImgId, "이원영", "@courtney81819", "3시간",
"청하 로제", contentImgId3, null,
3, null, 2, 334),

TimelineItem(profileImgId3, "김도현", "@KittenDiger", "4일",
"구글인ㅇㅎㅇ의 인용의 인용", null, null,
1, 2, null, 50),
)

return timelineList.shuffled()
}
fun refreshTimelineData() {
//val shuffledTimelineList = ProfileTapRvDataHelper.getDataForTab().shuffled()
// (binding.rvProfile.adapter as? TimelineRecyclerViewAdapter)?.updateData(shuffledTimelineList)
//
// binding.swipeRefreshLayout.isRefreshing = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.smilegate.Easel.domain.model

data class HighlightItem(
val title: String,
val description: String,
val btnText: String
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.smilegate.Easel.presentation.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.smilegate.Easel.databinding.ItemHighlightBinding
import com.smilegate.Easel.domain.model.HighlightItem

class HighlightAdapter(private val context: Context, private val highlightList: List<HighlightItem>) :
RecyclerView.Adapter<HighlightAdapter.HighlightViewHolder>() {

inner class HighlightViewHolder(private val binding: ItemHighlightBinding) :
RecyclerView.ViewHolder(binding.root) {

fun bind(item: HighlightItem) {

binding.textView8.text = item.title.toString()
binding.textView9.text = item.description.toString()
binding.btnText.text = item.btnText.toString()

}
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HighlightViewHolder {
val inflater = LayoutInflater.from(parent.context)
val binding = ItemHighlightBinding.inflate(inflater, parent, false)
return HighlightViewHolder(binding)
}

override fun onBindViewHolder(holder: HighlightViewHolder, position: Int) {
val highlightItem = highlightList[position]
holder.bind(highlightItem)
}

override fun getItemCount(): Int {
return highlightList.size
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ class TimelineRecyclerViewAdapter(private val context: Context, private val time
RecyclerView.Adapter<TimelineRecyclerViewAdapter.TimelineViewHolder>() {

private val popupManager = TimelinePopupManager(context)
private val bottomSheetDialog = RetweetBottomSheetDialog()
private var timelineListItem: MutableList<TimelineItem> = mutableListOf()

fun updateData(newList: List<TimelineItem>) {
timelineListItem = newList.toMutableList()
notifyDataSetChanged()
}
@RequiresApi(Build.VERSION_CODES.S)
inner class TimelineViewHolder(private val binding: ItemTimelineBinding) :
RecyclerView.ViewHolder(binding.root) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
package com.smilegate.Easel.presentation.view.join

import android.graphics.Color
import android.graphics.PorterDuff
import android.os.Bundle
import android.text.Editable
import android.text.SpannableString
import android.text.TextPaint
import android.text.TextWatcher
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.View.GONE
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import android.widget.Toast
import android.widget.Toolbar
import androidx.appcompat.widget.AppCompatImageView
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import androidx.navigation.NavController
import androidx.navigation.fragment.findNavController
import com.smilegate.Easel.R
Expand Down Expand Up @@ -180,7 +174,7 @@ class CreateAccountFragment : Fragment() {
private fun validateEmail() {
val email = binding.createAccountInfoField.text.toString().trim()
val blue = ContextCompat.getColor(requireContext(), R.color.Blue_500)
val red = ContextCompat.getColor(requireContext(), R.color.Red_200)
val red = ContextCompat.getColor(requireContext(), R.color.Pink_200)

if (!isEmailValid(email)) {
// 이메일 형식이 유효하지 않은 경우
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ package com.smilegate.Easel.presentation.view.join
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
import android.view.KeyEvent
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.widget.Button
import android.widget.EditText
import android.widget.ImageView
import android.widget.Toast
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.navigation.NavController
import androidx.navigation.fragment.findNavController
import com.smilegate.Easel.R
Expand Down Expand Up @@ -136,7 +132,7 @@ class NeedPasswordFragment : Fragment() {

if (password.length < maxPasswordLength) {
// 비밀번호가 8자 미만인 경우
val pwColorResourceId = ContextCompat.getColor(requireContext(), R.color.Red_200)
val pwColorResourceId = ContextCompat.getColor(requireContext(), R.color.Pink_200)
binding.needPasswordFragmentPwField.setTextColor(pwColorResourceId)
// 토스트 메시지 표시
Toast.makeText(requireContext(), "비밀번호는 8자 이상이어야 합니다.", Toast.LENGTH_SHORT).show()
Expand Down
Loading