Created
January 24, 2020 03:27
-
-
Save danielmalone/f2fe9f082ba252e2a8e665d973d8e84d to your computer and use it in GitHub Desktop.
This file contains 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
package com.danielmalone.podcast | |
import android.os.Bundle | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.recyclerview.widget.LinearLayoutManager | |
import kotlinx.android.synthetic.main.activity_main.* | |
import kotlinx.android.synthetic.main.content_main.* | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
setSupportActionBar(toolbar) | |
val podcasts = | |
listOf( | |
Podcast("What's up with Justin Bieber?", "145 minutes"), | |
Podcast("Taylor Swift giving me a blank space", "145 minutes"), | |
Podcast("Is Nick Jonas a Sucker?", "145 minutes"), | |
Podcast("Is Christmas music real?", "145 minutes"), | |
Podcast("Why am I overthinking these podcasts?", "145 minutes"), | |
Podcast("Is Comedy the Answer?", "145 minutes"), | |
Podcast("But don't we need more Podcasts?", "145 minutes"), | |
Podcast("I'm running out of things to say", "145 minutes"), | |
Podcast("How about one more?", "145 minutes") | |
) | |
val podcastsAdapter = PodcastsAdapter() | |
podcastEpisodes.apply { | |
layoutManager = LinearLayoutManager(this@MainActivity) | |
adapter = podcastsAdapter | |
} | |
podcastsAdapter.submitList(podcasts) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment