-
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.
- Loading branch information
Showing
21 changed files
with
404 additions
and
41 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/c7z/mappilogue_aos/data/data/MyPageMenuItem.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,6 @@ | ||
package com.c7z.mappilogue_aos.data.data | ||
|
||
data class MyPageMenuItem( | ||
val icon : Int, | ||
val title : String | ||
) |
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
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
37 changes: 37 additions & 0 deletions
37
...main/java/com/c7z/mappilogue_aos/presentation/ui/main/mypage/adapter/MyPageMenuAdapter.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,37 @@ | ||
package com.c7z.mappilogue_aos.presentation.ui.main.mypage.adapter | ||
|
||
import android.view.LayoutInflater | ||
import android.view.MenuItem | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.c7z.mappilogue_aos.data.data.MyPageMenuItem | ||
import com.c7z.mappilogue_aos.databinding.ItemRvMyPageMenuBinding | ||
|
||
class MyPageMenuAdapter( | ||
private val menuItems: List<MyPageMenuItem>, | ||
private val onItemClicked: (Int) -> Unit | ||
) : RecyclerView.Adapter<MyPageMenuAdapter.MyPageMenuViewHolder>() { | ||
inner class MyPageMenuViewHolder(private val binding: ItemRvMyPageMenuBinding) : | ||
RecyclerView.ViewHolder(binding.root) { | ||
fun bind(item: MyPageMenuItem) { | ||
binding.data = item | ||
binding.root.setOnClickListener { onItemClicked.invoke(absoluteAdapterPosition) } | ||
} | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyPageMenuViewHolder { | ||
return MyPageMenuViewHolder( | ||
ItemRvMyPageMenuBinding.inflate( | ||
LayoutInflater.from(parent.context), | ||
parent, | ||
false | ||
) | ||
) | ||
} | ||
|
||
override fun getItemCount(): Int = menuItems.size | ||
|
||
override fun onBindViewHolder(holder: MyPageMenuViewHolder, position: Int) { | ||
holder.bind(menuItems[position]) | ||
} | ||
} |
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.