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

[UI/#66] 여행 친구 조회 뷰 / UI 수정 #72

Merged
merged 12 commits into from
Jan 10, 2024
12 changes: 8 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<activity
android:name="com.going.presentation.todo.TodoActivity"
android:exported="false"
android:exported="true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 좀...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅋㅋ ㅎㅎ pr 올릴 때는 false 부탁해요 ^^

android:screenOrientation="portrait" />

<activity
Expand Down Expand Up @@ -97,7 +97,7 @@
<activity
android:name="com.going.presentation.starttrip.StartTripSplashActivity"
android:exported="false"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.todo.mytodo.create.MyTodoCreateActivity"
Expand Down Expand Up @@ -132,13 +132,17 @@
<activity
android:name="com.going.presentation.profile.ProfileActivity"
android:exported="false"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.entertrip.EnterTripActivity"
android:exported="false"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.checkfriends.CheckFriendsActivity"
android:exported="false"
android:screenOrientation="portrait" />

</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package com.going.presentation.checkfriends

import android.os.Bundle
import android.view.View
import androidx.activity.viewModels
import com.going.presentation.R
import com.going.presentation.databinding.ActivityCheckFriendsBinding
import com.going.presentation.todo.ourtodo.OurTodoFriendAdapter
import com.going.ui.base.BaseActivity
import com.going.ui.extension.setOnSingleClickListener

class CheckFriendsActivity :
BaseActivity<ActivityCheckFriendsBinding>(R.layout.activity_check_friends) {

private var _adapter: OurTodoFriendAdapter? = null
private val adapter
get() = requireNotNull(_adapter) { getString(R.string.adapter_not_initialized_error_msg) }

private val viewModel by viewModels<CheckFriendsViewModel>()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

initBackClickListener()
initAdapter()
setProgressBarStatus()

}

private fun initBackClickListener() {
binding.btnCheckFriendsBack.setOnSingleClickListener {
finish()
}
}

private fun initAdapter() {
_adapter = OurTodoFriendAdapter()
binding.rvCheckFriendsMember.adapter = adapter
adapter.submitList(viewModel.mockParticipantsList)
}

private fun setProgressBarStatus() {
// styleA의 평균 값이 1이라고 가정
binding.progressBarCheckFriends1.progress = 1
if (binding.progressBarCheckFriends1.progress <= 2) {
// 평균 값이 0 ~2면 1 더하기
binding.progressBarCheckFriends1.progress = 1 + 1
binding.progressBarCheckFriends2.progress = 2 + 1
binding.progressBarCheckFriends3.progress = 0 + 1
}

// styleD의 평균 값이 3이라고 가정
binding.progressBarCheckFriends4.progress = 3
if (binding.progressBarCheckFriends4.progress > 2) {
// 프로그레스바 반대 방향으로 적용
binding.progressBarCheckFriends4.visibility = View.INVISIBLE
binding.progressBarCheckFriends4Revert.visibility = View.VISIBLE

binding.progressBarCheckFriends5.visibility = View.INVISIBLE
binding.progressBarCheckFriends5Revert.visibility = View.VISIBLE

// 평균 값이 4 ~5 라면 2 빼기
binding.progressBarCheckFriends4Revert.progress = 3 - 2
binding.progressBarCheckFriends5Revert.progress = 4 - 2
Comment on lines +42 to +64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지리네 유빈지노

이거를 해냈다~~~~~~~~~

}
}

override fun onDestroy() {
super.onDestroy()
_adapter = null
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.going.presentation.checkfriends

import androidx.lifecycle.ViewModel
import com.going.domain.entity.response.TripParticipantsListModel

class CheckFriendsViewModel : ViewModel() {

val mockParticipantsList: List<TripParticipantsListModel.TripParticipantModel> = listOf(
TripParticipantsListModel.TripParticipantModel(0, "일지민", 100),
TripParticipantsListModel.TripParticipantModel(1, "이지민", 100),
TripParticipantsListModel.TripParticipantModel(2, "삼지민", 100),
TripParticipantsListModel.TripParticipantModel(3, "사지민", 100),
TripParticipantsListModel.TripParticipantModel(4, "오지민", 100),
TripParticipantsListModel.TripParticipantModel(5, "육지민", 100),
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>(R.layout.activity_s
}

private fun initProfileClickListener() {
binding.btnSettingProfileEnter.setOnSingleClickListener {
binding.layoutSettingProfile.setOnSingleClickListener {

}
}

private fun initInquireClickListener() {
binding.btnSettingInquireEnter.setOnSingleClickListener {
binding.layoutSettingInquire.setOnSingleClickListener {

}
}

private fun initPolicyClickListener() {
binding.btnSettingPolicyEnter.setOnSingleClickListener {
binding.layoutSettingPolicy.setOnSingleClickListener {

}
}

private fun initAboutDooripClickListener() {
binding.btnSettingAboutDooripEnter.setOnSingleClickListener {
binding.layoutSettingAboutDoorip.setOnSingleClickListener {

}
}

private fun initLogoutClickListener() {
binding.btnSettingLogoutEnter.setOnSingleClickListener {
binding.layoutSettingLogout.setOnSingleClickListener {
showLogoutAlertDialog()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.going.presentation.todo.ourtodo

import android.content.Context
import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView

class OurTodoDecoration(val context: Context) : RecyclerView.ItemDecoration() {

override fun getItemOffsets(
outRect: Rect,
view: View,
parent: RecyclerView,
state: RecyclerView.State
) {
super.getItemOffsets(outRect, view, parent, state)
val position = parent.getChildAdapterPosition(view)

if (position == parent.adapter?.itemCount?.minus(1)) {
outRect.right = 150
}
Comment on lines +17 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

데코레이션마저 자유자재 ㄷㄷ

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class OurTodoFragment() : BaseFragment<FragmentOurTodoBinding>(R.layout.fragment

initAdapter()
initAddTodoBtnListener()
initItemDecoration()
setDateTextColor()
setProgressBarStatus()
setTabLayout()
Expand All @@ -53,6 +54,12 @@ class OurTodoFragment() : BaseFragment<FragmentOurTodoBinding>(R.layout.fragment
}
}

private fun initItemDecoration() {
val itemDeco = OurTodoDecoration(requireContext())
binding.rvOurTripFriend.addItemDecoration(itemDeco)
}


private fun setDateTextColor() {
binding.tvOurTodoTitleDown.apply {
text = SpannableStringBuilder(text).apply {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="4dp"/>
<solid android:color="@color/gray_50"/>
</shape>
</item>

<item android:id="@android:id/progress">
<scale android:scaleWidth="100%">
<shape>
<corners android:radius="4dp"/>
<solid android:color="@color/gray_400"/>
</shape>
</scale>
</item>
</layer-list>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1dp"/>
<stroke android:color="@color/gray_200"/>
<stroke android:color="@color/gray_100"/>
<solid android:color="@color/white_000" />
<corners android:radius="4dp" />
</shape>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white_000" />
<stroke android:width="1dp" />
<stroke android:color="@color/gray_200" />
<corners android:radius="6dp" />
</shape>
Loading