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

[AN] refactor: 클럽 ui 개선 #510

Merged
merged 4 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -16,7 +16,7 @@ class DetailProfileAdapter(
oldItem: ClubDetailProfileUiModel,
newItem: ClubDetailProfileUiModel,
): Boolean {
return oldItem.imageUrl == newItem.imageUrl
return oldItem.id == newItem.id
}

override fun areContentsTheSame(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.happy.friendogly.presentation.ui.mylocation

import android.annotation.SuppressLint
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.databinding.BindingAdapter
import com.happy.friendogly.R
Expand All @@ -18,3 +20,13 @@ fun TextView.bindMyLocation(userAddress: UserAddress?) {
userAddress.thoroughfare ?: "",
)
}

@BindingAdapter("myLocationIcon")
fun ImageView.bindMyLocationIcon(userAddress: UserAddress?) {
this.visibility =
if (userAddress == null) {
View.GONE
} else {
View.VISIBLE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import com.naver.maps.map.LocationTrackingMode
import com.naver.maps.map.MapView
import com.naver.maps.map.NaverMap
import com.naver.maps.map.OnMapReadyCallback
import com.naver.maps.map.overlay.Marker
import com.naver.maps.map.overlay.OverlayImage
import com.naver.maps.map.util.FusedLocationSource
import java.util.Locale

Expand Down Expand Up @@ -113,7 +111,6 @@ class SettingMyLocationActivity :
latLng = LatLng(lastLocation.latitude, lastLocation.longitude)
moveCameraCenterPosition()
cancelAnimation()
initMarker()
loadAddress()
}
}
Expand All @@ -129,15 +126,6 @@ class SettingMyLocationActivity :
map.locationTrackingMode = LocationTrackingMode.Follow
}

private fun initMarker() {
val marker = Marker()
marker.position = latLng
marker.icon = OverlayImage.fromResource(R.drawable.ic_marker_mine_clicked)
marker.width = MARKER_WIDTH
marker.height = MARKER_HEIGHT
marker.map = map
}

private fun initMap(map: NaverMap) {
this.map = map
map.locationSource = locationSource
Expand Down Expand Up @@ -211,8 +199,6 @@ class SettingMyLocationActivity :

companion object {
private const val DEFAULT_ZOOM = 13.5
private const val MARKER_WIDTH = 24
private const val MARKER_HEIGHT = 37

fun getIntent(context: Context): Intent {
return Intent(context, SettingMyLocationActivity::class.java)
Expand Down
10 changes: 10 additions & 0 deletions android/app/src/main/res/drawable/ripple_rect_fill12_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/gray300">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="12dp"/>
</shape>
</item>
</ripple>
10 changes: 10 additions & 0 deletions android/app/src/main/res/drawable/ripple_rect_fill16_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/gray300">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="16dp"/>
</shape>
</item>
</ripple>
10 changes: 10 additions & 0 deletions android/app/src/main/res/drawable/ripple_rect_fill20_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/gray300">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="20dp"/>
</shape>
</item>
</ripple>
10 changes: 10 additions & 0 deletions android/app/src/main/res/drawable/ripple_rect_fill8_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/gray300">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="8dp"/>
</shape>
</item>
</ripple>
9 changes: 9 additions & 0 deletions android/app/src/main/res/drawable/ripple_rect_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/gray300">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
</shape>
</item>
</ripple>
59 changes: 32 additions & 27 deletions android/app/src/main/res/layout/activity_club_modify.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,40 @@
android:layout_width="wrap_content"
android:layout_height="10dp" />

<LinearLayout
onSingleClick="@{()->vm.openSelectState()}"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="48dp"
android:background="@drawable/rect_coral300_fill_20"
android:orientation="horizontal"
android:gravity="center"
android:paddingHorizontal="15dp"
app:selectModifyStateBackground="@{vm.clubState}">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:clubStateText="@{vm.clubState}"
app:selectModifyStateTypeStyle="@{vm.clubState}"
tools:style="@style/Theme.AppCompat.TextView.SemiBold.White.Size16"
tools:text="모집중" />

<Space
android:layout_width="5dp"
android:layout_height="wrap_content" />

<ImageView
app:selectModifyStateImageTint="@{vm.clubState}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_arrow_bottom"
tools:tint="@color/white" />
</LinearLayout>
android:layout_height="48dp">
<LinearLayout
android:background="@drawable/ripple_rect_fill20_white"
onSingleClick="@{()->vm.openSelectState()}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center"
android:paddingHorizontal="15dp"
app:selectModifyStateBackground="@{vm.clubState}">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:clubStateText="@{vm.clubState}"
app:selectModifyStateTypeStyle="@{vm.clubState}"
tools:style="@style/Theme.AppCompat.TextView.SemiBold.White.Size16"
tools:text="모집중" />

<Space
android:layout_width="5dp"
android:layout_height="wrap_content" />

<ImageView
app:selectModifyStateImageTint="@{vm.clubState}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_arrow_bottom"
tools:tint="@color/white" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

<Space
android:layout_width="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,15 @@
app:layout_constraintTop_toBottomOf="@+id/view_my_location_top_bar"
app:lottie_fileName="animation_loading.json"
app:lottie_loop="true" />
<ImageView
app:myLocationIcon = "@{vm.userAddress}"
android:src="@drawable/ic_marker_mine_clicked"
app:layout_constraintBottom_toTopOf="@+id/linear_layout_my_location"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view_my_location_top_bar"
android:layout_marginTop="60dp"
android:layout_width="50dp"
android:layout_height="100dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
android:layout_height="wrap_content">

<TextView
style="@style/Theme.AppCompat.TextView.Regular.Black.Size14"
style="@style/Theme.AppCompat.TextView.Regular.Red.Size14"
android:text="@string/club_detail_report"
android:paddingHorizontal="30dp"
android:paddingVertical="10dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/rect_white_fill_10"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="24dp">
android:paddingEnd="16dp">

<TextView
android:id="@+id/btn_club_open"
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/layout/fragment_club_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
android:layout_marginStart="16dp"
android:gravity="center"
android:orientation="horizontal"
android:background="@drawable/ripple_circle_white">
android:background="@drawable/ripple_rect_white">

<TextView
app:address="@{vm.myAddress}"
Expand Down
51 changes: 30 additions & 21 deletions android/app/src/main/res/layout/include_club_filter.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

<variable
name="filterName"
type="java.lang.String" />
</data>

<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:background="@drawable/rect_coral100_fill_12"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<TextView
style="@style/Theme.AppCompat.TextView.SemiBold.White.Size14"
android:text="@{filterName}"
tools:text="참여 가능"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Space
android:layout_width="5dp"
android:layout_height="wrap_content" />

<ImageView
android:tint="@color/white"
android:src="@drawable/ic_arrow_bottom"
android:layout_width="16dp"
android:layout_height="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ripple_rect_fill12_white"
android:gravity="center"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp">

<TextView
style="@style/Theme.AppCompat.TextView.SemiBold.White.Size14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{filterName}"
tools:text="참여 가능" />

<Space
android:layout_width="5dp"
android:layout_height="wrap_content" />

<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/ic_arrow_bottom"
app:tint="@color/white" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

27 changes: 17 additions & 10 deletions android/app/src/main/res/layout/include_club_not_address.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android">

<data>

<variable
name="vm"
type="com.happy.friendogly.presentation.ui.club.list.ClubListViewModel" />
</data>

<LinearLayout
android:id="@+id/linear_layout_club_not_address"
android:orientation="vertical"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">

<ImageView
android:layout_width="200dp"
Expand Down Expand Up @@ -43,14 +44,20 @@
android:layout_width="wrap_content"
android:layout_height="20dp" />

<TextView
onSingleClick="@{()->vm.addMyLocation()}"
style="@style/Theme.AppCompat.TextView.Regular.Black.Size14"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rect_gray01_line_gray03_16"
android:paddingHorizontal="24dp"
android:paddingVertical="8dp"
android:text="@string/club_list_submit_text" />
android:background="@drawable/rect_gray01_line_gray03_16">

<TextView
style="@style/Theme.AppCompat.TextView.Regular.Black.Size14"
onSingleClick="@{()->vm.addMyLocation()}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ripple_rect_fill16_white"
android:paddingHorizontal="24dp"
android:paddingVertical="8dp"
android:text="@string/club_list_submit_text" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</layout>
21 changes: 13 additions & 8 deletions android/app/src/main/res/layout/include_club_not_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,19 @@
android:layout_width="wrap_content"
android:layout_height="20dp" />

<TextView
onSingleClick="@{()->actionHandler.addClub()}"
style="@style/Theme.AppCompat.TextView.Regular.Black.Size14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:background="@drawable/rect_gray01_line_gray03_16"
android:paddingHorizontal="24dp"
android:paddingVertical="8dp"
android:text="@string/club_list_submit_text" />
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
onSingleClick="@{()->actionHandler.addClub()}"
style="@style/Theme.AppCompat.TextView.Regular.Black.Size14"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ripple_rect_fill16_white"
android:paddingHorizontal="24dp"
android:paddingVertical="8dp"
android:text="@string/club_list_submit_text" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</layout>
Loading
Loading