-
Notifications
You must be signed in to change notification settings - Fork 2
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
Changes from 11 commits
478ea29
e12a0e4
ebbaaeb
5531ff6
7cf0703
cd246bd
e3437ac
dd7cb04
0cc8591
6327e7d
2d15fd1
fc7cd7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ | |
|
||
<activity | ||
android:name="com.going.presentation.todo.TodoActivity" | ||
android:exported="false" | ||
android:exported="true" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋ ㅎㅎ pr 올릴 때는 false 부탁해요 |
||
android:screenOrientation="portrait" /> | ||
|
||
<activity | ||
|
@@ -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" | ||
|
@@ -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> | ||
|
||
|
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
---|---|---|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 데코레이션마저 자유자재 ㄷㄷ |
||
} | ||
} |
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 |
---|---|---|
@@ -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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 좀...