Permalink
Browse files

Delegated Properties

  • Loading branch information...
imuhao committed Nov 4, 2017
1 parent 9a5fc71 commit 22bd5a789d192275dae300a5d3c1cd3ee484d325
Showing with 6 additions and 2 deletions.
  1. +6 −2 app/src/main/kotlin/com/caimuhao/kedditbysteps/NewsFragment.kt
@@ -16,14 +16,18 @@ import kotlinx.android.synthetic.main.fragment_news.*
*/
class NewsFragment : Fragment() {
private val newsList by lazy {
news_list.setHasFixedSize(true)
news_list.layoutManager = LinearLayoutManager(context)
news_list
}
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return container?.inflate(R.layout.fragment_news)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
news_list.setHasFixedSize(true)
news_list.layoutManager = LinearLayoutManager(context)
}
}

0 comments on commit 22bd5a7

Please sign in to comment.