Selaa lähdekoodia

fix api to new api

Dola 7 kuukautta sitten
vanhempi
commit
42f97d39c9

BIN
app/dev/release/Kun-Khmer_devRelease_1.0.0-dev.apk


+ 3 - 3
app/src/main/java/com/sambath/kunkhmer/adapter/EventAdapter.kt

@@ -24,9 +24,9 @@ class EventAdapter(var cardList: MutableList<EventInfo>) : RecyclerView.Adapter<
         val currentItem = cardList[position]
 
         Picasso.get().load(R.drawable.default_background).into(holder.imageView)
-        holder.subTitleTextView.text = currentItem.eventInfoId.desc
-        holder.titleTextView.text = currentItem.eventInfoId.title
-        holder.dateTitleTextView.text = parseAndFormatDate(currentItem.eventInfoId.createdAt)
+        holder.subTitleTextView.text = currentItem.desc
+        holder.titleTextView.text = currentItem.title
+//        holder.dateTitleTextView.text = currentItem.eventInfoId.createdAt
     }
 
     override fun getItemCount() = cardList.size

+ 1 - 1
app/src/main/java/com/sambath/kunkhmer/adapter/HighlightNewsAdapter.kt

@@ -37,7 +37,7 @@ class HighlightNewsAdapter (var cardList: MutableList<Highlight>, private val li
             .placeholder(R.drawable.ic_logo_header)
             .into(holder.imageView);
 
-        holder.dateTextView.text = parseAndFormatDate(currentItem.date)
+        holder.dateTextView.text = currentItem.date
         holder.titleTextView.text = currentItem.title
     }
 

+ 17 - 8
app/src/main/java/com/sambath/kunkhmer/remote/EventDataModel.kt

@@ -22,9 +22,18 @@ data class EventData(
 @JsonClass(generateAdapter = true)
 data class EventInfo(
     @Json(name = "_id")
-    val eventInfoId: EventInfoId,
-    @Json(name = "fighters")
-    val fighters: MutableList<EventInfoFighters>,
+    val id: String,
+    @Json(name = "title")
+    val title: String,
+    @Json(name = "desc")
+    val desc: String,
+    @Json(name = "match_fighter_id")
+    val fighterId: String,
+
+//    @Json(name = "_id")
+//    val eventInfoId: EventInfoId,
+//    @Json(name = "fighters")
+//    val fighters: MutableList<EventInfoFighters>,
 )
 
 @JsonClass(generateAdapter = true)
@@ -35,12 +44,12 @@ data class EventInfoId(
     val title: String,
     @Json(name = "desc")
     val desc: String,
-    @Json(name = "status")
-    val status: Boolean,
-    @Json(name = "fighter_id")
+    @Json(name = "match_fighter_id")
     val fighterId: String,
-    @Json(name = "createdAt")
-    val createdAt: String,
+//    @Json(name = "status")
+//    val status: Boolean,
+//    @Json(name = "createdAt")
+//    val createdAt: String,
 )
 
 @JsonClass(generateAdapter = true)

+ 1 - 0
app/src/main/res/layout/layout_event_item_card.xml

@@ -57,6 +57,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="match_parent"
                 android:gravity="center_vertical"
+                android:visibility="gone"
                 android:text="Your Date"
                 android:textColor="@color/color_white"
                 android:textSize="14sp" />