1. ApiInterface.java__[Retrofitμ μ¬μ©νμ¬ μλ²μμ ν΅μ μ²λ¦¬ λ©μλ]
/*μν μ΄λ―Έμ§λ₯Ό μ
λ‘λ*/
@Multipart
@POST("/api/v1/product/newimage/{productId}")
Call<ProductImageResponse> uploadProductImage(@Header("Authorization") String TOKEN, @Path("productId") Integer productId, @Part MultipartBody.Part image);
/*μ¬μ©μκ° μ’μνλ μν λͺ©λ‘ κ°μ Έμ€κΈ°*/
@GET("/api/v1/product/like")
Call<List<FavModel>> getMyFav(@Header("Authorization") String TOKEN);
κ°κ°μ λ©μλλ μλ²μ API μλν¬μΈνΈμ ν΅μ νκΈ° μν μμ² νμ μ μ, λΉλκΈ°μ μΈ νΈμΆμ μ²λ¦¬ν μ μλ βCallβ κ°μ²΄ λ°ν
@Multipart : λ©ν°ννΈ μμ²μ μ¬μ©, ν
μ€νΈμ νμΌ λ± λ€μν μ’
λ₯μ λ°μ΄ν°λ₯Ό ν¨κ» μλ²λ‘ μ μ‘
@post : post λ©μλλ₯Ό μ¬μ©νμ¬ μ§μ λ κ²½λ‘("/api/v1/product/newimage/{productId}")λ‘ μμ²μ 보λ, {productId}λ κ²½λ‘ λ³μλ‘, μμ²ν λ μ€μ prodectId κ°μ λ체
Call<ProductImageResponse> : Retrofitμ βcallβ ν΄λμ€λ₯Ό μ¬μ©νμ¬ λΉλκΈ°μ μΌλ‘ μλ²λ‘λΆν° μλ΅ λ°μ μ μλ νΈμΆ μ μ
@Header("Authorization")String TOKEN : μμ² ν€λμ TOKEN κ° ν¬ν¨, μ΄λ₯Ό ν΅ν΄ μλ²λ μμ²μ λ³΄λΈ μ¬μ©μλ₯Ό μΈμ¦νκ³ κΆν νμΈ
@Path : λ©ν°ννΈ μμ²μ μΌλΆμΈ image κ° μ μ
@GET**("/api/v1/product/like")** : GET λ©μλλ₯Ό μ¬μ©νμ¬ ("/api/v1/product/like") κ²½λ‘λ‘ μμ²μ 보λ
@Call<List<FavModel>> : FavModel κ°μ²΄μ 리μ€νΈλ₯Ό λΉλκΈ°μ μΌλ‘ λ°μ μ μλ νΈμΆ μ μ
@Header("Authorization" String TOKEN) : ν€λμ ν¨κ» TOKEN κ° μμ² ν€λμ ν¬ν¨
2. fragment_favorite.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/detail_navbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/greenbtn"
android:elevation="4dp">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:textColor="@color/black"
android:drawableStart="@drawable/ic_favorite_border"
android:drawablePadding="5dp"
android:text="MY"
android:textSize="22sp"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>
<ListView
android:id="@+id/favListV"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
</FrameLayout>
**android:orientation="vertical" :** ν¬ν¨λ λ·°λ€μ μμ§ λ°©ν₯μΌλ‘ λ°°μΉνλ λ°©ν₯ μ§μ
**android:elevation** : ν΄λ°μ κ³ λλ₯Ό μ€μ , κ³ λ κ°μ΄ λμμλ‘ ν΄λ°κ° λ λμ μμΉμ λ μμ

3. fav_item.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:id="@+id/productImage"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="@drawable/ic_user" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="4">
<ImageButton
android:id="@+id/removeFav"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#00ff0000"
android:src="@drawable/ic_favorite"
app:tint="@color/pink3" />
</LinearLayout>
<TextView
android:id="@+id/productTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="product name"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/productPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hohoho"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>

1. ApiInterface.java__[Retrofitμ μ¬μ©νμ¬ μλ²μμ ν΅μ μ²λ¦¬ λ©μλ]
κ°κ°μ λ©μλλ μλ²μ API μλν¬μΈνΈμ ν΅μ νκΈ° μν μμ² νμ μ μ, λΉλκΈ°μ μΈ νΈμΆμ μ²λ¦¬ν μ μλ βCallβ κ°μ²΄ λ°ν
@Multipart: λ©ν°ννΈ μμ²μ μ¬μ©, ν μ€νΈμ νμΌ λ± λ€μν μ’ λ₯μ λ°μ΄ν°λ₯Ό ν¨κ» μλ²λ‘ μ μ‘@post: post λ©μλλ₯Ό μ¬μ©νμ¬ μ§μ λ κ²½λ‘("/api/v1/product/newimage/{productId}")λ‘ μμ²μ 보λ, {productId}λ κ²½λ‘ λ³μλ‘, μμ²ν λ μ€μ prodectId κ°μ λ체Call<ProductImageResponse>: Retrofitμ βcallβ ν΄λμ€λ₯Ό μ¬μ©νμ¬ λΉλκΈ°μ μΌλ‘ μλ²λ‘λΆν° μλ΅ λ°μ μ μλ νΈμΆ μ μ@Header("Authorization")String TOKEN: μμ² ν€λμ TOKEN κ° ν¬ν¨, μ΄λ₯Ό ν΅ν΄ μλ²λ μμ²μ λ³΄λΈ μ¬μ©μλ₯Ό μΈμ¦νκ³ κΆν νμΈ@Path: λ©ν°ννΈ μμ²μ μΌλΆμΈ image κ° μ μ@GET**("/api/v1/product/like")**: GET λ©μλλ₯Ό μ¬μ©νμ¬ ("/api/v1/product/like") κ²½λ‘λ‘ μμ²μ 보λ@Call<List<FavModel>>: FavModel κ°μ²΄μ 리μ€νΈλ₯Ό λΉλκΈ°μ μΌλ‘ λ°μ μ μλ νΈμΆ μ μ@Header("Authorization" String TOKEN): ν€λμ ν¨κ» TOKEN κ° μμ² ν€λμ ν¬ν¨2. fragment_favorite.xml
**android:orientation="vertical" :**ν¬ν¨λ λ·°λ€μ μμ§ λ°©ν₯μΌλ‘ λ°°μΉνλ λ°©ν₯ μ§μ **android:elevation**: ν΄λ°μ κ³ λλ₯Ό μ€μ , κ³ λ κ°μ΄ λμμλ‘ ν΄λ°κ° λ λμ μμΉμ λ μμ3. fav_item.xml