31 lines
999 B
Kotlin
31 lines
999 B
Kotlin
|
package org.mosad.teapod.ui.search
|
||
|
|
||
|
import android.os.Bundle
|
||
|
import android.view.LayoutInflater
|
||
|
import android.view.View
|
||
|
import android.view.ViewGroup
|
||
|
import android.widget.TextView
|
||
|
import androidx.fragment.app.Fragment
|
||
|
import androidx.lifecycle.Observer
|
||
|
import androidx.lifecycle.ViewModelProviders
|
||
|
import org.mosad.teapod.R
|
||
|
|
||
|
class SearchFragment : Fragment() {
|
||
|
|
||
|
private lateinit var notificationsViewModel: SearchViewModel
|
||
|
|
||
|
override fun onCreateView(
|
||
|
inflater: LayoutInflater,
|
||
|
container: ViewGroup?,
|
||
|
savedInstanceState: Bundle?
|
||
|
): View? {
|
||
|
notificationsViewModel =
|
||
|
ViewModelProviders.of(this).get(SearchViewModel::class.java)
|
||
|
val root = inflater.inflate(R.layout.fragment_search, container, false)
|
||
|
val textView: TextView = root.findViewById(R.id.text_notifications)
|
||
|
notificationsViewModel.text.observe(viewLifecycleOwner, Observer {
|
||
|
textView.text = it
|
||
|
})
|
||
|
return root
|
||
|
}
|
||
|
}
|