Skip to content

Commit

Permalink
[feat] : #16 마시멜로 레벨, 카테고리 분기처리
Browse files Browse the repository at this point in the history
  • Loading branch information
SsongSik committed May 15, 2023
1 parent 9c4a0a8 commit 4aca2df
Show file tree
Hide file tree
Showing 17 changed files with 190 additions and 139 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.teampome.pome.presentation.mypage

import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
Expand Down Expand Up @@ -36,11 +38,67 @@ class MarshmelloAdapter(
binding.myTabMarshmello = myTabMarshmello
context?.let{
when(myTabMarshmello.marshmelloName) {
"record" -> Glide.with(context).load(R.drawable.marshmallow_level_4_pink).into(binding.ivArticleImage)
"emotion" -> Glide.with(context).load(R.drawable.marshmallow_level_2_yellow).into(binding.ivArticleImage)
"growth" -> Glide.with(context).load(R.drawable.marshmallow_level_4_mint).into(binding.ivArticleImage)
"honest" -> Glide.with(context).load(R.drawable.ic_mashmellow).into(binding.ivArticleImage)
else -> Glide.with(context).load(R.drawable.ic_mashmellow).into(binding.ivArticleImage)
"record" -> binding.mypageCardRecordTv.text = "기록말랑"
"emotion" -> binding.mypageCardRecordTv.text = "공감말랑"
"growth" -> binding.mypageCardRecordTv.text = "발전말랑"
"honest" -> binding.mypageCardRecordTv.text = "솔직말랑"
}

if(myTabMarshmello.marshmelloLv == 0) {
Glide.with(context).load(R.drawable.ic_mashmellow).into(binding.ivArticleImage)
binding.mypageCardLevelTv.text = "Lv.1"
binding.mypageCardLevelTv.setTextColor(ContextCompat.getColor(context, R.color.grey_4))
binding.mypageCardLevelCl.setBackgroundResource(R.drawable.item_gray_oval)
binding.mypageCardRecordCl.setBackgroundResource(R.drawable.item_grey1_r8_background)
binding.mypageCardRecordTv.setTextColor(ContextCompat.getColor(context, R.color.grey_5))
} else if(myTabMarshmello.marshmelloLv == 1) {
binding.mypageCardLevelTv.text = "Lv.1"
if(myTabMarshmello.marshmelloName == "record") {
//기록
Glide.with(context).load(R.drawable.marshmallow_level_1_pink).into(binding.ivArticleImage)
} else if(myTabMarshmello.marshmelloName == "emotion") {
//공감
Glide.with(context).load(R.drawable.marshmallow_level_1_blue).into(binding.ivArticleImage)
} else if(myTabMarshmello.marshmelloName == "growth") {
//발전
Glide.with(context).load(R.drawable.marshmallow_level_1_yellow).into(binding.ivArticleImage)
} else {
//솔직
Glide.with(context).load(R.drawable.marshmallow_level_1_mint).into(binding.ivArticleImage)
}
} else if(myTabMarshmello.marshmelloLv == 2) {
binding.mypageCardLevelTv.text = "Lv.2"
if(myTabMarshmello.marshmelloName == "record") {
Glide.with(context).load(R.drawable.marshmallow_level_2_pink).into(binding.ivArticleImage)
} else if(myTabMarshmello.marshmelloName == "emotion") {
Glide.with(context).load(R.drawable.marshmallow_level_2_blue).into(binding.ivArticleImage)
} else if(myTabMarshmello.marshmelloName == "growth") {
Glide.with(context).load(R.drawable.marshmallow_level_2_yellow).into(binding.ivArticleImage)
} else {
Glide.with(context).load(R.drawable.marshmallow_level_2_mint).into(binding.ivArticleImage)
}
} else if(myTabMarshmello.marshmelloLv == 3) {
binding.mypageCardLevelTv.text = "Lv.3"
if(myTabMarshmello.marshmelloName == "record") {
Glide.with(context).load(R.drawable.marshmallow_level_3_pink).into(binding.ivArticleImage)
} else if(myTabMarshmello.marshmelloName == "emotion") {
Glide.with(context).load(R.drawable.marshmallow_level_3_blue).into(binding.ivArticleImage)
} else if(myTabMarshmello.marshmelloName == "growth") {
Glide.with(context).load(R.drawable.marshmallow_level_3_yellow).into(binding.ivArticleImage)
} else {
Glide.with(context).load(R.drawable.marshmallow_level_3_mint).into(binding.ivArticleImage)
}
} else {
binding.mypageCardLevelTv.text = "Lv.4"
if(myTabMarshmello.marshmelloName == "record") {
Glide.with(context).load(R.drawable.marshmallow_level_4_pink).into(binding.ivArticleImage)
} else if(myTabMarshmello.marshmelloName == "emotion") {
Glide.with(context).load(R.drawable.marshmallow_level_4_blue).into(binding.ivArticleImage)
} else if(myTabMarshmello.marshmelloName == "growth") {
Glide.with(context).load(R.drawable.marshmallow_level_4_yellow).into(binding.ivArticleImage)
} else {
Glide.with(context).load(R.drawable.marshmallow_level_4_mint).into(binding.ivArticleImage)
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/item_gray_oval.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<stroke android:width="1dp" android:color="@color/grey_4"/>
</shape>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 35 additions & 47 deletions app/src/main/res/layout/fragment_mypage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,121 +16,109 @@
android:id="@+id/mypage_setting_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginRight="20dp"
android:src="@drawable/ic_setting"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="16dp"
android:layout_marginRight="20dp"/>
app:layout_constraintTop_toTopOf="parent" />

<ImageView
android:id="@+id/mypage_profile_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="37dp"
android:src="@drawable/user_profile_example"
app:layout_constraintTop_toBottomOf="@+id/mypage_setting_iv"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="37dp"
/>
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mypage_setting_iv" />

<TextView
android:id="@+id/mypage_profile_name_tv"
android:text="@string/friend_profile_name"
style="@style/Pome.SemiBold.18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Pome.SemiBold.18"
android:layout_marginTop="8dp"
android:text="@string/friend_profile_name"
android:textColor="@color/grey_8"
app:layout_constraintTop_toBottomOf="@id/mypage_profile_iv"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="8dp"
/>
app:layout_constraintTop_toBottomOf="@id/mypage_profile_iv" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/mypage_main_cl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/mypage_main_cl"
app:layout_constraintTop_toBottomOf="@id/mypage_profile_name_tv"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="10dp"
>
android:background="@drawable/mypage_main_cl"
app:layout_constraintTop_toBottomOf="@id/mypage_profile_name_tv">

<ImageView
android:id="@+id/mypage_main_logo_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_mypage_main_logo"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginVertical="15dp"
android:paddingLeft="14dp"
/>
android:src="@drawable/ic_mypage_main_logo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/mypage_main_goal_tv"
android:text="@string/mypage_main_goal_text"
style="@style/Pome.SemiBold.16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Pome.SemiBold.16"
android:layout_marginLeft="10dp"
android:text="@string/mypage_main_goal_text"
android:textColor="@color/grey_8"
app:layout_constraintTop_toTopOf="@id/mypage_main_logo_iv"
app:layout_constraintLeft_toRightOf="@id/mypage_main_logo_iv"
android:layout_marginLeft="10dp"
/>
app:layout_constraintTop_toTopOf="@id/mypage_main_logo_iv" />

<TextView
android:id="@+id/mypage_main_last_goal_tv"
android:text="@string/mypage_main_last_goal_text"
style="@style/Pome.Medium.14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Pome.Medium.14"
android:layout_marginLeft="10dp"
android:text="@string/mypage_main_last_goal_text"
android:textColor="@color/grey_6"
app:layout_constraintBottom_toBottomOf="@id/mypage_main_logo_iv"
app:layout_constraintLeft_toRightOf="@id/mypage_main_logo_iv"
android:layout_marginLeft="10dp"
/>
app:layout_constraintLeft_toRightOf="@id/mypage_main_logo_iv" />

<ImageView
android:id="@+id/mypage_ic_arrow_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:src="@drawable/ic_mypage_goal_arrow"
app:layout_constraintTop_toTopOf="@id/mypage_main_goal_tv"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="15dp"
/>


app:layout_constraintTop_toTopOf="@id/mypage_main_goal_tv" />

</androidx.constraintlayout.widget.ConstraintLayout>

<TextView
android:id="@+id/mypage_marshmallow_tv"
android:text="@string/mypage_marshmallow_text"
style="@style/Pome.SemiBold.18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Pome.SemiBold.18"
android:textColor="@color/grey_9"
app:layout_constraintTop_toBottomOf="@+id/mypage_main_cl"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="21dp"
android:layout_marginTop="24dp"
/>
android:text="@string/mypage_marshmallow_text"
android:textColor="@color/grey_9"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mypage_main_cl" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/record_emotion_rv"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_mypage_card"
android:layout_marginHorizontal="16dp"
app:layout_constraintTop_toBottomOf="@id/mypage_marshmallow_tv"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />


app:layout_constraintTop_toBottomOf="@id/mypage_marshmallow_tv"
tools:listitem="@layout/item_mypage_card" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Loading

0 comments on commit 4aca2df

Please sign in to comment.