Skip to content

Instantly share code, notes, and snippets.

View naphatamity's full-sized avatar

Naphat Far naphatamity

View GitHub Profile
@naphatamity
naphatamity / video_comment.xml
Last active April 27, 2021 04:56
video_comment
<include
android:id="@+id/chat_reply"
layout="@layout/chat_reply"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/chat_text_input_player"
android:layout_marginEnd="0dp"
android:layout_marginBottom="0dp"
android:visibility="gone" />
@naphatamity
naphatamity / VideoFragment.kt
Created April 15, 2021 13:20
VideoFragment.kt
class HomeVideoFragment() : Fragment(R.layout.video_player) {
var fullScreen = 0
var name = ""
var url = ""
var count = 0
var videoThumbnail = ""
var currentPosition: Long = 0
var playWhenReady = true
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@naphatamity
naphatamity / video_player.xml
Created April 15, 2021 13:15
video_player.xml
<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="match_parent">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/matchPlayer"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:controller_layout_id="@layout/exoplay_custom_ui"
app:layout_constraintTop_toTopOf="parent">
@naphatamity
naphatamity / ChatAdapter.kt
Created April 15, 2021 13:11
ChatAdapter.kt
class ChatAdapter(
private val listener: ListListener
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val DIFF_CALLBACK = object : DiffUtil.ItemCallback<EkoMessage>() {
override fun areItemsTheSame(oldItem: EkoMessage, newItem: EkoMessage): Boolean {
return oldItem.getMessageId() == newItem.getMessageId()
}