-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUD-50] fix : Buddy 이미지 api 고화질 이미지 업로드 안되던 버그 픽스(#34)
- Loading branch information
Showing
16 changed files
with
183 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
buddy/src/main/java/com/nocapstone/buddyvet/buddy/HomeBuddyProfileListAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.nocapstone.buddyvet.buddy | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.DiffUtil | ||
import androidx.recyclerview.widget.ListAdapter | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.nocapstone.buddyvet.buddy.databinding.ItemBuddyProfileBinding | ||
import com.nocapstone.buddyvet.buddy.databinding.ItemBuddyProfileHomeBinding | ||
import com.nocapstone.buddyvet.buddy.domain.entity.BuddyData | ||
|
||
class HomeBuddyProfileListAdapter() : | ||
ListAdapter<BuddyData, RecyclerView.ViewHolder>(HomeBuddyProfileListDiffCallback()) { | ||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { | ||
return BuddyListViewHolder( | ||
ItemBuddyProfileHomeBinding.inflate( | ||
LayoutInflater.from(parent.context), | ||
parent, | ||
false | ||
) | ||
) | ||
} | ||
|
||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { | ||
if (holder is BuddyListViewHolder) { | ||
val buddyData = getItem(position) | ||
holder.bind(buddyData, position) | ||
} | ||
} | ||
|
||
inner class BuddyListViewHolder(private val binding: ItemBuddyProfileHomeBinding) : | ||
RecyclerView.ViewHolder(binding.root) { | ||
fun bind(data: BuddyData, position: Int) { | ||
|
||
binding.apply { | ||
buddyData = data | ||
} | ||
} | ||
} | ||
} | ||
|
||
private class HomeBuddyProfileListDiffCallback : DiffUtil.ItemCallback<BuddyData>() { | ||
override fun areItemsTheSame(oldItem: BuddyData, newItem: BuddyData): Boolean { | ||
return oldItem === newItem | ||
} | ||
|
||
override fun areContentsTheSame(oldItem: BuddyData, newItem: BuddyData): Boolean { | ||
return oldItem == newItem | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?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> | ||
|
||
<import type="android.view.View" /> | ||
|
||
<variable | ||
name="buddyData" | ||
type="com.nocapstone.buddyvet.buddy.domain.entity.BuddyData" /> | ||
|
||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_marginHorizontal="8dp" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content"> | ||
|
||
|
||
<de.hdodenhof.circleimageview.CircleImageView | ||
android:id="@+id/buddy_profile" | ||
photoUrl="@{buddyData.profile}" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_gravity="center" | ||
app:civ_border_overlay="true" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginVertical="8dp" | ||
android:fontFamily="@font/cafe24_ssurround_air" | ||
android:text="@{buddyData.name}" | ||
android:textColor="@color/black" | ||
app:layout_constraintEnd_toEndOf="@id/buddy_profile" | ||
app:layout_constraintStart_toStartOf="@id/buddy_profile" | ||
app:layout_constraintTop_toBottomOf="@id/buddy_profile" | ||
tools:text="주주" /> | ||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
</layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="32dp" android:tint="#969696" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/> | ||
</vector> |
5 changes: 2 additions & 3 deletions
5
...c/main/res/menu/detail_community_menu.xml → common-ui/src/main/res/menu/common_menu.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.