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

마이페이지 디자인 이슈 처리 #86

Merged
merged 23 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d59fa2a
[fix/mypage_design]: JMT-249 Alert Contet 줄간격 수정
dogdduddy Sep 24, 2023
c742074
[fix/mypage_design]: JMT-251 버튼 수정
dogdduddy Sep 24, 2023
03d515f
[fix/mypage_design]: JMT-248 툴바 보더 추가
dogdduddy Sep 24, 2023
1e77a9b
[fix/mypage_design]: JMT-247 계정 관리 divider 두께 수정
dogdduddy Sep 24, 2023
a7c7991
[fix/mypage_design]: JMT-246 회원탈퇴 설명 문구 숨김처리 수정
dogdduddy Sep 24, 2023
53a8290
[fix/mypage_design]: JMT-242 사용자 이름 수정 버튼 문구 변경
dogdduddy Sep 24, 2023
4bb1f8c
[fix/mypage_design]: JMT-239 정보 수정 페이지 네비바 노출 수정
dogdduddy Sep 24, 2023
9350d05
[fix/mypage_design]: SnackBar 수정
dogdduddy Sep 24, 2023
5e85f9e
[fix/mypage_design]: JMT-240 버전 정보 수정
dogdduddy Sep 25, 2023
482aef8
[fix/mypage_design]: JMT-235 마이페이지 세팅 버튼 수정
dogdduddy Sep 25, 2023
4a7b042
[fix/mypage_design]: JMT-234 탭바 리플 효과 제거
dogdduddy Sep 25, 2023
8a50a46
[fix/mypage_design]: JMT-232 마이페이지 탭 언더라인 추가
dogdduddy Sep 25, 2023
8ca9bb2
[fix/mypage_design]: JMT-243 입력 수 제한 풀기
dogdduddy Sep 25, 2023
eee65bf
[fix/mypage_design]: JMT-233 등록한 맛집 필터 수정
dogdduddy Sep 25, 2023
aed39ef
[fix/confirm_restaurant_design]: JMT-236 좋아한 맛집 숨김 처리
dogdduddy Sep 26, 2023
60df438
[fix/mypage_design]: XML 미리보기 안 되는 문제 해결
dogdduddy Sep 26, 2023
1cb4c79
[fix/confirm_restaurant_design]: JMT-244 EditText 수정
dogdduddy Sep 27, 2023
d800421
[fix/mypage_design]: JMT-243 입력 수 제한 롤백
dogdduddy Sep 27, 2023
bcf1f56
Merge branch 'develop' into fix/mypage_design
dogdduddy Sep 27, 2023
2e94bd4
[fix/mypage_design]: JMT-233 등록한 맛집 필터 수정
dogdduddy Sep 27, 2023
0b856ab
[fix/mypage_design]: JMT-251 버튼 수정
dogdduddy Sep 27, 2023
d32a38e
[fix/mypage_design]: JMT-252 Empty 레이아웃 표시
dogdduddy Sep 27, 2023
2fb7097
Merge branch 'develop' into fix/mypage_design
dogdduddy Sep 28, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ class RestaurantDataSourceImpl @Inject constructor(
) {
with(db.restaurantDao()) {
when (sortType) {
SortType.INIT -> getRegisteredRestaurants(userId, categoryFilter, isCanDrinkLiquor)
SortType.DISTANCE -> getRegisteredRestaurantsSortedDistance(userId, categoryFilter, isCanDrinkLiquor)
SortType.RECENCY -> getRegisteredRestaurantsSortedRecent(userId, categoryFilter, isCanDrinkLiquor)
SortType.LIKED -> getRegisteredRestaurants(userId, categoryFilter, isCanDrinkLiquor)
Expand Down
2 changes: 1 addition & 1 deletion domain/src/main/java/org/gdsc/domain/FoodCategory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum class FoodCategory(val id: Long, val text: String, val key:String) {
CAFE(6L, "카페", "CAFE"),
BAR(7L, "주점", "BAR"),
ETC(8L, "기타", "ETC"),
INIT(-1L, "(필수) 어떤 종류의 식당인가요?", "");
INIT(-1L, "종류", "");

companion object {
fun getAllText(): List<String> {
Expand Down
3 changes: 1 addition & 2 deletions domain/src/main/java/org/gdsc/domain/SortType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package org.gdsc.domain
enum class SortType(val text: String) {
DISTANCE("가까운 순"),
LIKED("좋아요 순"),
RECENCY("최신 순"),
INIT("정렬");
RECENCY("최신 순");


companion object {
Expand Down
2 changes: 1 addition & 1 deletion presentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ dependencies {

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MainActivity : BaseActivity() {
navController.addOnDestinationChangedListener { controller, destination, arguments ->

// bottomNavigationView Control
if (destination.id == R.id.home_fragment || destination.id == R.id.my_page_fragment)
if (destination.id == R.id.home_fragment || destination.id == R.id.my_page_fragment || destination.id == R.id.settings_fragment)
slideUpBottomNavigationView()
else
slideDownBottomNavigationView()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package org.gdsc.presentation.view.custom

import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Rect
import android.graphics.drawable.Drawable
import android.text.Editable
import android.text.InputType.TYPE_CLASS_TEXT
import android.text.TextWatcher
import android.util.AttributeSet
import android.util.Log
import android.view.MotionEvent
import android.widget.EditText
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.DrawableCompat
import com.google.android.material.textfield.TextInputEditText
import org.gdsc.presentation.R

class ClassicEditText(context: Context, attrs: AttributeSet) : TextInputEditText(context, attrs) {
private val underlinePaint = Paint()
private var clearIcon: Drawable? = null
private var showClearIcon = false

init {
inputType = TYPE_CLASS_TEXT
setLines(1)

underlinePaint.color = ContextCompat.getColor(context, R.color.grey400)
underlinePaint.strokeWidth = 4f

minHeight = height

// EditText 기본 배경 지우기
background = null
setPadding(0, paddingTop, paddingRight, paddingBottom)

// Clear 아이콘 초기화
val drawable = ContextCompat.getDrawable(context, R.drawable.ic_cancel)
clearIcon = DrawableCompat.wrap(drawable!!)
clearIcon!!.setBounds(0, 0, clearIcon!!.intrinsicWidth, clearIcon!!.intrinsicHeight)
val padding = resources.getDimensionPixelSize(R.dimen.drawable_icon_spacing)
setCompoundDrawablePadding(padding)

// Clear 아이콘 보이기/숨기기 설정
addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}

override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
setClearIconVisible(s?.isNotEmpty() == true)
}

override fun afterTextChanged(s: Editable?) {}
})
}

private fun setClearIconVisible(visible: Boolean) {
showClearIcon = visible
setCompoundDrawablesWithIntrinsicBounds(
null,
null,
if (visible) clearIcon else null,
null
)
}

override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)

val startY = height
val scrollX = scrollX

canvas.drawLine(
scrollX.toFloat(),
startY.toFloat() - paddingBottom,
(scrollX + width).toFloat(),
startY.toFloat() - paddingBottom,
underlinePaint
)
}

override fun onFocusChanged(focused: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
super.onFocusChanged(focused, direction, previouslyFocusedRect)

// 포커스가 없을 때 Clear 아이콘 숨기기
if (!focused) {
setClearIconVisible(false)
}
}

override fun onTouchEvent(event: MotionEvent): Boolean {
// Clear 아이콘 클릭 이벤트
if (event.action == MotionEvent.ACTION_DOWN) {
if (showClearIcon && event.x >= width - paddingRight - clearIcon!!.intrinsicWidth) {
setText("")
return true
}
}
return super.onTouchEvent(event)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class JmtAlert(private val context: Context) {
TextView(context).apply {
gravity = Gravity.CENTER
text = content
setLineSpacing(0f, 1.2f)
}.let {
binding.dialogContentLay.removeAllViewsInLayout()
binding.dialogContentLay.isVisible = true
Expand Down Expand Up @@ -125,6 +126,7 @@ class JmtAlert(private val context: Context) {
) {
leftButton = AppCompatButton(context).apply {
this.text = text
this.stateListAnimator = null
this.layoutParams =
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f).apply {
height = 48.toDp
Expand Down Expand Up @@ -167,34 +169,20 @@ class JmtAlert(private val context: Context) {
) {
rightButton = AppCompatButton(context).apply {
this.text = text
this.layoutParams =
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f).apply {
leftMargin = 12.toDp
height = 48.toDp
}
this.background = when (_fillType) {
FILL_FILL -> ContextCompat.getDrawable(
context,
R.drawable.jmt_button_background_main
)

FILL_OUTLINE -> ContextCompat.getDrawable(
context,
R.drawable.jmt_button_outline_background_main
)

else -> ContextCompat.getDrawable(
context,
R.drawable.jmt_button_background_main
)
this.layoutParams = LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f).apply {
leftMargin = 12.toDp
height = 48.toDp
}
this.setTextColor(
when (_fillType) {
FILL_FILL -> ContextCompat.getColor(context, R.color.white)
FILL_OUTLINE -> ContextCompat.getColor(context, R.color.main500)
else -> ContextCompat.getColor(context, R.color.white)
}
)
this.background = when(_fillType) {
FILL_FILL -> ContextCompat.getDrawable(context, R.drawable.jmt_button_background_main)
FILL_OUTLINE -> ContextCompat.getDrawable(context, R.drawable.jmt_button_outline_background_main)
else -> ContextCompat.getDrawable(context, R.drawable.jmt_button_background_main)
}
this.setTextColor(when(_fillType) {
FILL_FILL -> ContextCompat.getColor(context, R.color.white)
FILL_OUTLINE -> ContextCompat.getColor(context, R.color.main500)
else -> ContextCompat.getColor(context, R.color.white)
})
this.setOnClickListener {
onClick(it)
if (autoDismiss) dismiss()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import dagger.hilt.android.AndroidEntryPoint
Expand Down Expand Up @@ -38,6 +39,7 @@ class LikedRestaurantFragment : Fragment() {
observeState()
setSpinners()

binding.notYetLayout.root.isVisible = true
}

private fun setSpinners() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import com.bumptech.glide.Glide
import com.google.android.material.snackbar.Snackbar
import com.naver.maps.map.BuildConfig
import dagger.hilt.android.AndroidEntryPoint
import okhttp3.MediaType
import okhttp3.MultipartBody
Expand Down Expand Up @@ -64,6 +65,7 @@ class SettingsFragment: BaseFragment() {
initUserInfo()
setToolbarTitle()
observeState()
initVersion()

binding.profileImageButton.setOnClickListener {
BottomSheetDialog(requireContext())
Expand Down Expand Up @@ -101,6 +103,11 @@ class SettingsFragment: BaseFragment() {
}
}

// 업데이트는 플레이스토어에 출시 이후에 추가해주기
private fun initVersion() {
binding.tvVersionInfo.text = BuildConfig.VERSION_NAME + " v"
}

private fun initUserInfo() {
repeatWhenUiStarted {
viewModel.getUserInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import javax.inject.Inject
class LikedRestaurantViewModel
@Inject constructor() : ViewModel() {

private var _sortTypeState = MutableStateFlow(SortType.INIT)
private var _sortTypeState = MutableStateFlow(SortType.DISTANCE)
val sortTypeState: StateFlow<SortType>
get() = _sortTypeState

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class MyPageViewModel @Inject constructor(



private var _sortTypeState = MutableStateFlow(SortType.INIT)
private var _sortTypeState = MutableStateFlow(SortType.DISTANCE)
val sortTypeState: StateFlow<SortType>
get() = _sortTypeState

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<item>
<shape android:shape="rectangle">
<stroke android:color="@color/main500"
android:width="1.5dp"/>
android:width="1dp"/>
<corners android:radius="8dp" />
</shape>
</item>
Expand Down
15 changes: 15 additions & 0 deletions presentation/src/main/res/drawable/tab_underline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/grey100" />
</shape>
</item>
<item>
<inset android:insetBottom="1.5dp">
<shape android:shape="rectangle">
<solid android:color="@color/white" />
</shape>
</inset>
</item>
</layer-list>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<View
android:id="@+id/logOutDivider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_small"
android:layout_height="@dimen/divider_medium"
android:background="@color/grey100"
app:layout_constraintTop_toBottomOf="@+id/tv_log_out"/>

Expand Down Expand Up @@ -52,7 +52,6 @@
android:layout_marginTop="2dp"
android:text="계정을 영구적으로 삭제합니다."
android:textColor="@color/grey300"
android:visibility="gone"
app:layout_constraintStart_toStartOf="@+id/tv_sign_out"
app:layout_constraintTop_toBottomOf="@+id/tv_sign_out"
tools:visibility="visible"/>
Expand All @@ -62,7 +61,7 @@
<View
android:id="@+id/accountManagementDivider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_small"
android:layout_height="@dimen/divider_medium"
android:background="@color/grey100"
app:layout_constraintTop_toBottomOf="@+id/sign_out_lay"/>

Expand Down
15 changes: 7 additions & 8 deletions presentation/src/main/res/layout/fragment_edit_user_name.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"/>

<EditText
<org.gdsc.presentation.view.custom.ClassicEditText
android:id="@+id/username_edit_text"
style="@style/text_large_medium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
style="@style/text_large_medium"
android:layout_marginHorizontal="@dimen/default_spacing"
android:maxLength="10"
android:backgroundTint="@color/grey400"
android:drawableRight="@drawable/ic_cancel"
app:layout_constraintTop_toBottomOf="@+id/ask_nickname_text"/>

<LinearLayout
Expand All @@ -41,10 +39,11 @@

<ImageView
android:id="@+id/verify_icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/check_icon"
android:contentDescription="@string/content_description_nickname_verify" />

<Space
android:layout_width="4dp"
android:layout_height="wrap_content"/>
Expand All @@ -67,7 +66,7 @@
app:layout_constraintBottom_toBottomOf="parent">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/next_btn"
android:text="@string/next"
android:text="@string/change"
android:layout_width="0dp"
android:layout_height="62dp"
style="@style/JmtButtonMain"
Expand Down
Loading