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.content.ContentUris; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.media.RingtoneManager; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.provider.MediaStore; | |
import android.provider.Settings; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.RequiresApi; |
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
// There is a new feature in gradle 3.0.0 called flavorDimension that allows you to combine | |
// different product flavors. We will be using just the "default" dimension | |
flavorDimensions "default" | |
productFlavors { | |
dev { | |
dimension "default" | |
applicationIdSuffix '.dev' // The applicationId now becomes "com.mobymagic.shazamclone.dev" | |
versionNameSuffix "-dev" // The versionName you define above now have a "-dev" suffix |
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"?> | |
<resources> | |
<!--Hex Opacity Values: | |
100% — FF | |
99% — FC | |
98% — FA | |
97% — F7 | |
96% — F5 | |
95% — F2 |
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
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="?attr/colorPrimary" | |
tools:context="com.mobymagic.shazamclone.discover.DiscoverFragment"> | |
<!-- The left and right constraint on the parent centers the view horizontally while the top |
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.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import com.google.gson.JsonArray; | |
import com.google.gson.JsonDeserializationContext; | |
import com.google.gson.JsonDeserializer; | |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonObject; | |
import com.google.gson.JsonParseException; |
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 com.google.gson.JsonDeserializationContext | |
import com.google.gson.JsonDeserializer | |
import com.google.gson.JsonElement | |
import com.google.gson.JsonObject | |
import com.google.gson.JsonParseException | |
import java.lang.reflect.Type | |
import java.util.ArrayList | |
class ACRCloudResponseDeserializer : JsonDeserializer<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
<!-- Start Permission Normal --> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<!-- End Permission Normal --> | |
<!-- Start Start Permission Dangerous --> | |
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | |
<!-- End Permission Dangerous --> |
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
/* | |
Dependency versions are defined in the top level build.gradle file. This helps keeping track of | |
all versions in a single place. This improves readability and helps managing project complexity. | |
*/ | |
dependencies { | |
implementation fileTree(dir: 'libs', include: ['*.jar']) | |
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" | |
// Support dependencies | |
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion" |
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
// Define library versions in a single place | |
ext { | |
compileSdkVersion = 26 | |
minSdkVersion = 16 | |
targetSdkVersion = 26 | |
supportLibraryVersion = '27.0.1' | |
constraintLayoutVersion = '1.0.2' |
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 android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import com.mobymagic.shazamclone.R | |
import com.mobymagic.shazamclone.utils.FragmentUtils | |
class DiscoverActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { |
OlderNewer