Skip to content

Commit

Permalink
add : title 추가 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
SeonHwan-Kim committed Apr 19, 2023
1 parent 41e7b51 commit d5049c0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.android.go.sopt.presentation.main

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import org.android.go.sopt.databinding.ItemTitleBinding

class TitleAdapter(context: Context): RecyclerView.Adapter<TitleAdapter.TitleViewHolder>() {
private val inflater by lazy { LayoutInflater.from(context) }

class TitleViewHolder(private val binding: ItemTitleBinding): RecyclerView.ViewHolder(binding.root)

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TitleViewHolder {
val binding = ItemTitleBinding.inflate(inflater, parent, false)
return TitleViewHolder(binding)
}

override fun getItemCount(): Int = 1

override fun onBindViewHolder(holder: TitleViewHolder, position: Int) {

}
}

15 changes: 15 additions & 0 deletions app/src/main/res/layout/item_title.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">

<TextView
android:id="@+id/tv_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/item_title_dog"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit d5049c0

Please sign in to comment.