Created
January 14, 2021 06:31
-
-
Save hi-manshu/6370f80f2e32e4e46a4381c50bcb8e8c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class DetailBrowsePeopleAdapter : BaseRecyclerViewAdapter<DetailBrowsePeopleItem>(mutableListOf()) { | |
override fun registerItemClick(holder: BaseBindingViewHolder, viewType: Int, position: Int) { | |
} | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<data> | |
<variable | |
name="item" | |
type="com.roomiapp.core.models.User" /> | |
</data> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="@android:color/white" | |
android:orientation="horizontal" | |
android:paddingStart="16dp" | |
android:paddingTop="8dp" | |
android:paddingEnd="16dp" | |
android:paddingBottom="8dp"> | |
<androidx.appcompat.widget.AppCompatTextView | |
android:id="@+id/textTextName" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:fontFamily="@font/avenir_next_regular" | |
android:lineSpacingExtra="8dp" | |
android:text="@{item.usrFirstName}" | |
android:textColor="@android:color/black" | |
android:textSize="24sp" | |
app:fontFamily="@font/avenir_next_bold" | |
tools:text="safdsad" /> | |
<androidx.appcompat.widget.AppCompatTextView | |
android:id="@+id/textViewAge" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:visibility="gone" | |
android:layout_marginStart="4dp" | |
android:fontFamily="@font/avenir_next_regular" | |
android:lineSpacingExtra="8dp" | |
android:textColor="@android:color/black" | |
android:textSize="24sp" | |
app:fontFamily="@font/avenir_next_regular" | |
tools:text="safdsad" /> | |
</LinearLayout> | |
</layout> |
This file contains hidden or 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
sealed class DetailBrowsePeopleItem(private val layoutId: Int) : IRecyclerItemViewModel { | |
override fun getLayoutId(): Int = layoutId | |
} | |
class PhotoListItem(private val user: User, private val onClicks: OnClicks) : DetailBrowsePeopleItem(R.layout.browse_people_image) { | |
override fun getBindingPairs(): List<Pair<Int, Any>> { | |
return listOf(Pair(BR.item, user), Pair(BR.callback, onClicks)) | |
} | |
} | |
class NameItem(private val user: User) : DetailBrowsePeopleItem(R.layout.browse_people_name) { | |
override fun getBindingPairs(): List<Pair<Int, Any>> { | |
return listOf(Pair(BR.item, user)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment