SHARE
TWEET

Untitled

a guest Jun 24th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class LobbyFragment : Fragment() {
  2.  
  3.     @Inject
  4.     lateinit var lobbyFragmentHelloService: LobbyFragmentHelloService
  5.  
  6.     @BindView(R.id.lobby_fragment_hello)
  7.     lateinit var lobbyFragmentHelloTextView: TextView
  8.  
  9.     lateinit var unbinder: Unbinder
  10.  
  11.     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
  12.         val view = inflater.inflate(R.layout.lobby_fragment, container, false)
  13.         unbinder = ButterKnife.bind(this, view)
  14.         return view
  15.     }
  16.  
  17.     override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
  18.         super.onViewCreated(view, savedInstanceState)
  19.  
  20.         sayFragmentHello()
  21.     }
  22.  
  23.     override fun onAttach(context: Context?) {
  24.         AndroidInjection.inject(this)
  25.         super.onAttach(context)
  26.     }
  27.  
  28.     override fun onDestroyView() {
  29.         super.onDestroyView()
  30.         unbinder.unbind()
  31.     }
  32.  
  33.     private fun sayFragmentHello() {
  34.         lobbyFragmentHelloTextView.text = lobbyFragmentHelloService.sayHello()
  35.     }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top