Skip to content

Commit

Permalink
first prototype as proof of concept
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanfiq committed May 25, 2024
1 parent c94a8ff commit 466fde9
Show file tree
Hide file tree
Showing 102 changed files with 2,340 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
78 changes: 78 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
}

android {
namespace = "com.yanfiq.streamfusion"
compileSdk = 34

defaultConfig {
applicationId = "com.yanfiq.streamfusion"
minSdk = 30
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
viewBinding = true
}
packaging {
resources.excludes.add("META-INF/DEPENDENCIES")
resources.excludes.add("META-INF/LICENSE")
resources.excludes.add("META-INF/LICENSE.txt")
resources.excludes.add("META-INF/license.txt")
resources.excludes.add("META-INF/NOTICE")
resources.excludes.add("META-INF/NOTICE.txt")
resources.excludes.add("META-INF/notice.txt")
resources.excludes.add("META-INF/ASL2.0")
resources.excludes.add("META-INF/*.kotlin_module")
}
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation("de.hdodenhof:circleimageview:3.1.0")
implementation("androidx.viewpager2:viewpager2:1.0.0")
implementation("com.google.android.material:material:1.11.0")
implementation("com.google.apis:google-api-services-youtube:v3-rev222-1.25.0")
implementation("com.pierfrancescosoffritti.androidyoutubeplayer:core:12.1.0")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("com.squareup.okhttp3:okhttp:4.9.1")
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")
implementation("com.github.bumptech.glide:glide:4.16.0")
implementation("com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava")
implementation(libs.androidx.activity)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.yanfiq.streamfusion

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.yanfiq.streamfusion", appContext.packageName)
}
}
33 changes: 33 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.StreamFusion"
tools:targetApi="31">
<activity
android:name=".ui.search.audius.PlayAudiusActivity"
android:exported="false" />
<activity
android:name=".ui.search.youtube.PlayYoutubeActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
35 changes: 35 additions & 0 deletions app/src/main/java/com/yanfiq/streamfusion/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.yanfiq.streamfusion

import android.os.Bundle
import com.google.android.material.bottomnavigation.BottomNavigationView
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import com.yanfiq.streamfusion.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

val navView: BottomNavigationView = binding.navView

val navController = findNavController(R.id.nav_host_fragment_activity_main)
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
val appBarConfiguration = AppBarConfiguration(
setOf(
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications
)
)
setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.yanfiq.streamfusion.data.response.audius

data class Artist(
val name: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.yanfiq.streamfusion.data.response.audius

import com.google.gson.annotations.SerializedName

data class Artwork(
@SerializedName("150x150") val small: String,
@SerializedName("480x480") val medium: String,
@SerializedName("1000x1000") val large: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.yanfiq.streamfusion.data.response.audius

data class AudiusResponse(val data: List<Track>)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.yanfiq.streamfusion.data.response.audius

data class EndpointsResponse(val data: List<String>)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.yanfiq.streamfusion.data.response.audius

data class Track(
val id: String,
val artwork: Artwork,
val title: String,
val user: Artist,
val stream_url: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.yanfiq.youcloudify.data.response.soundcloud

data class Track(
val id: Int,
val title: String,
val user: User,
val artwork_url: String?,
val stream_url: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.yanfiq.youcloudify.data.response.soundcloud

data class User(
val username: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.yanfiq.youcloudify.data.response.spotify

data class Album(val images: List<Image>)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.yanfiq.youcloudify.data.response.spotify

data class Artist(val name: String)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.yanfiq.youcloudify.data.response.spotify

data class Image(val url: String)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.yanfiq.youcloudify.data.response.spotify

data class SpotifyAuthResponse(val access_token: String)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.yanfiq.youcloudify.data.response.spotify

data class SpotifySearchResponse(val tracks: Tracks)
Loading

0 comments on commit 466fde9

Please sign in to comment.