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
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/donateFragmentContainer" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.mobymagic.shazamclone.donate.DonateActivity" /> |
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.mobymagic.shazamclone.discover | |
import com.mobymagic.shazamclone.BasePresenter | |
import com.mobymagic.shazamclone.BaseView | |
import com.mobymagic.shazamclone.data.identify.Song | |
interface DiscoverContract { | |
interface View: BaseView<Presenter> { | |
// Show/hide progress view |
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.mobymagic.shazamclone | |
interface BasePresenter<in V> { | |
// This method is called by the View on the presenter when it is active | |
fun takeView(view: V) | |
// This method is called by the View when it is no longer active | |
fun dropView() | |
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.mobymagic.shazamclone | |
// Well, we would call this one just a marker interface | |
interface BaseView<P> { | |
} |
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.mobymagic.shazamclone.discover | |
import com.mobymagic.shazamclone.data.identify.Song | |
import com.mobymagic.shazamclone.data.identify.SongIdentifyService | |
class DiscoverPresenter(private val songIdentifyService: SongIdentifyService): DiscoverContract.Presenter { | |
override fun takeView(view: DiscoverContract.View) { | |
} | |
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.mobymagic.shazamclone.discover | |
import com.mobymagic.shazamclone.data.identify.Song | |
import com.mobymagic.shazamclone.data.identify.SongIdentifyService | |
import com.nhaarman.mockito_kotlin.argumentCaptor | |
import com.nhaarman.mockito_kotlin.mock | |
import com.nhaarman.mockito_kotlin.verify | |
import org.junit.After | |
import org.junit.Before | |
import org.junit.Test |
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.mobymagic.shazamclone.data.identify | |
// A class that will hold information about the song that was identified/discovered. For now, it will have no properties. In future parts, | |
// we will update this class to include properties. | |
class Song { | |
} |
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.mobymagic.shazamclone.data.identify | |
interface SongIdentifyService { | |
// Called to start identifying/discovering the song that is currently playing | |
fun startIdentication(callback: SongIdentificationCallback) | |
// Called to stop identifying/discovering song | |
fun stopIdentification() | |
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.mobymagic.shazamclone.discover | |
import com.mobymagic.shazamclone.data.identify.Song | |
import com.mobymagic.shazamclone.data.identify.SongIdentifyService | |
class DiscoverPresenter(private val songIdentifyService: SongIdentifyService): DiscoverContract.Presenter, | |
SongIdentifyService.SongIdentificationCallback { | |
private var mDiscoverView: DiscoverContract.View? = null | |
override fun takeView(view: DiscoverContract.View) { |
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
import android.os.Bundle | |
import android.support.v4.app.Fragment | |
import android.support.v7.app.AlertDialog | |
import android.util.Log | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import com.mobymagic.shazamclone.R | |
import com.mobymagic.shazamclone.data.identify.Song | |
import com.mobymagic.shazamclone.di.Injection |