Dola TENG il y a 1 an
Parent
commit
9f8d0aabfb

BIN
app/dev/release/SBC-Mobile_devRelease_1.0.0-dev.apk


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

@@ -7,6 +7,7 @@ import android.widget.ImageView
 import android.widget.TextView
 import androidx.recyclerview.widget.RecyclerView
 import com.sambath.kunkhmer.R
+import com.squareup.picasso.Picasso
 
 class EventAdapter(private val cardList: List<EventCardItem>) : RecyclerView.Adapter<EventAdapter.ViewHolder>() {
 
@@ -18,7 +19,7 @@ class EventAdapter(private val cardList: List<EventCardItem>) : RecyclerView.Ada
     override fun onBindViewHolder(holder: EventAdapter.ViewHolder, position: Int) {
         val currentItem = cardList[position]
 
-        holder.imageView.setImageResource(currentItem.imageResource)
+        Picasso.get().load(currentItem.imageResource).into(holder.imageView)
         holder.subTitleTextView.text = currentItem.subTitle
         holder.titleTextView.text = currentItem.title
         holder.dateTitleTextView.text = currentItem.dateTitle

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

@@ -1,3 +1,3 @@
 package com.sambath.kunkhmer.adapter
 
-data class EventCardItem(val imageResource: Int, val title: String, val subTitle: String, val dateTitle: String)
+data class EventCardItem(val imageResource: String, val title: String, val subTitle: String, val dateTitle: String)

+ 6 - 5
app/src/main/java/com/sambath/kunkhmer/screen/event/EventFragment.kt

@@ -46,11 +46,12 @@ class EventFragment : Fragment() {
     private fun createCardList(): List<EventCardItem> {
         // Create and return your list of CardItems
         return listOf(
-            EventCardItem(R.drawable.ic_bg_dashboard, "Title 1", "SubTitle 1", "DateTitle"),
-            EventCardItem(R.drawable.ic_bg_dashboard, "Title 2", "SubTitle 2", "DateTitle"),
-            EventCardItem(R.drawable.ic_bg_dashboard, "Title 3", "SubTitle 3", "DateTitle"),
-            EventCardItem(R.drawable.ic_bg_dashboard, "Title 4", "SubTitle 4", "DateTitle"),
-            EventCardItem(R.drawable.ic_bg_dashboard, "Title 5", "SubTitle 5", "DateTitle"),
+            EventCardItem("https://i.ytimg.com/vi/Lh5O00zo_pc/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCEQ100buCWUuyBKWe_96UbevbIEA",
+                "ទស្សនាការប្រកួតសង្វៀនប្រដាល់គុនខ្មែរឯកភ្នំ", "ម៉ន សាម៉េត(ខ្មែរ) vs (ថៃ)ហ្វាម៉ែ សែងចាក់", "កម្មវិធីប្រកួតថ្ងៃអាទិត្យ ទី៣១ ខែមិនា ឆ្នាំ២០២៣"),
+            EventCardItem("https://i.ytimg.com/vi/Lh5O00zo_pc/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCEQ100buCWUuyBKWe_96UbevbIEA",
+                "ទស្សនាការប្រកួតសង្វៀនប្រដាល់គុនខ្មែរឯកភ្នំ", "ម៉ន សាម៉េត(ខ្មែរ) vs (ថៃ)ហ្វាម៉ែ សែងចាក់", "កម្មវិធីប្រកួតថ្ងៃអាទិត្យ ទី៣១ ខែមិនា ឆ្នាំ២០២៣"),
+            EventCardItem("https://i.ytimg.com/vi/Lh5O00zo_pc/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCEQ100buCWUuyBKWe_96UbevbIEA",
+                "ទស្សនាការប្រកួតសង្វៀនប្រដាល់គុនខ្មែរឯកភ្នំ", "ម៉ន សាម៉េត(ខ្មែរ) vs (ថៃ)ហ្វាម៉ែ សែងចាក់", "កម្មវិធីប្រកួតថ្ងៃអាទិត្យ ទី៣១ ខែមិនា ឆ្នាំ២០២៣"),
             // Add more card items as needed
         )
     }

+ 27 - 0
app/src/main/java/com/sambath/kunkhmer/screen/shop/ShopFragment.kt

@@ -0,0 +1,27 @@
+package com.sambath.kunkhmer.screen.shop
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.sambath.kunkhmer.R
+
+
+class ShopFragment : Fragment() {
+
+    private var _root: View? = null
+    private val binding get() = _root!!
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        _root = inflater.inflate(R.layout.fragment_shop, container, false)
+        return binding
+    }
+}

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

@@ -4,6 +4,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@color/color_black"
     tools:context=".screen.event.EventFragment">
 
     <androidx.recyclerview.widget.RecyclerView

+ 24 - 0
app/src/main/res/layout/fragment_shop.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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"
+    android:background="@drawable/ads_popout"
+    tools:context=".screen.shop.ShopFragment">
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:alpha="0.7"
+        android:background="@color/color_black" />
+
+    <!-- TODO: Update blank fragment layout -->
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:gravity="center"
+        android:text="@string/hello_blank_fragment"
+        android:textColor="@color/color_white"
+        android:textSize="25sp" />
+
+</FrameLayout>

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

@@ -22,7 +22,7 @@
         <View
             android:layout_width="match_parent"
             android:layout_height="200dp"
-            android:alpha="0.5"
+            android:alpha="0.7"
             android:background="@color/color_black" />
 
         <LinearLayout

+ 1 - 1
app/src/main/res/navigation/mobile_navigation.xml

@@ -31,7 +31,7 @@
 
     <fragment
         android:id="@+id/navigation_shop"
-        android:name="com.sambath.kunkhmer.screen.notifications.NotificationsFragment"
+        android:name="com.sambath.kunkhmer.screen.shop.ShopFragment"
         android:label="@string/title_shop"
         tools:layout="@layout/fragment_notifications" />
 

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -75,7 +75,7 @@
     <string name="title_shop">Shop</string>
     <string name="title_live">Lives</string>
     <!-- TODO: Remove or change this placeholder text -->
-    <string name="hello_blank_fragment">Hello blank fragment</string>
+    <string name="hello_blank_fragment">Coming Soon!</string>
     <string name="title_vs">Vs</string>
     <string name="title_date">Date</string>
     <string name="agreement_hint"><![CDATA[By signing up, you agree with our <font color="#0000FF">Term & Condition</font> and <font color="#0000FF">Privacy Policy</font>]]></string>