Skip to content

Spotify Clone App: Lesson 0

Mert Şimşek edited this page Nov 8, 2019 · 8 revisions

Overview

In this lecture, we will

  • Examine the Spotify Clone App UI design structure.
  • Give a small overview of the libraries we will use. (Retrofit, RxJava 2, Data Binding, Architecture Components, Dagger 2, Exo Player 2.)
  • Data flow in Spotify Clone App.
  • Create the resources we will use. (strings.xml, dimens.xml, styles.xml)
  • Create skeleton UI

Examine the UI

We will have a single activity and two fragment in this app. First Fragment is RadiosFragment, second fragment is FavoritesFragment.

We have shared UI elements in both fragments. The shared element should be placed into activity design. In this design, we have TabLayout and Player Controller. So these UI elements should be placed into the activity_main.xml file.

In RadiosFragment, we design a LinearLayout for Popular Station and From your location items. They are horizontally scrolling separately.

Popular Station and From your location have the same UI. So we can use the same RecyclerView Adapter for them.

In FavoriteFragment, we have only FavoriteRadioRecyclerView to show favorited radios.

Overview of libraries

Retrofit: We have a rest API for radios. We will use the retrofit HTTP client library to fetch the radio list.

RxJava 2: Wee need to handle threading while fetching radios.json. And also favorite radio lists will be placed into the database. So Threading is important in that case too. So RxJava will help us with handling threading. And also our radios.json will have some inconsistent and broken data. We will user RxJava to filter out unwanted data. So RxJava will help us with functional operation too.

DataBinding: We don't want too many UI handling in our Activity/Fragments. So data binding will help us with this.

Architecture Components: We want our app support rotation and reactive. ViewModel and LiveData will come to help with this.

Dagger 2: Dagger 2 helps with dependency injection. We will be learn how dagger injects into fields and instances.

Exo Player 2: We need to play radios efficiently. Exo Player 2 supports tons of format when it comes to media playing. Exo Player 2 will do creating media sources, play/pause operation for us.

Required Resources

Dependencies

implementation 'com.google.android.material:material:1.1.0-alpha10'

Source Code

Branch Lesson 0

Lesson Video

Lesson Video