Skip to content

Commit

Permalink
Feat search (#10)
Browse files Browse the repository at this point in the history
* update?

* update gradle

* updates

* some refactoring

* make app build

* remove hilt annotation from app
  • Loading branch information
Rick-AB authored Dec 25, 2024
1 parent 1c42824 commit 856ab3c
Show file tree
Hide file tree
Showing 72 changed files with 779 additions and 591 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

6 changes: 3 additions & 3 deletions .idea/gradle.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

135 changes: 0 additions & 135 deletions app/build.gradle

This file was deleted.

153 changes: 153 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrainsKotlinAndroid)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.ksp)
alias(libs.plugins.compose.compiler)
}

android {
namespace = "com.rickinc.decibels"
compileSdk = 35

defaultConfig {
applicationId = "com.rickinc.decibels"
minSdk = 26
targetSdk = 35
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "com.rickinc.decibels.CustomTestRunner"
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}

}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType(KotlinCompile::class.java) {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

buildFeatures {
compose = true
buildConfig = true
}
// composeOptions {
// kotlinCompilerExtensionVersion = '1.4.0'
// }
testOptions.unitTests.all {
it.testLogging {
events = setOf(
TestLogEvent.PASSED,
TestLogEvent.FAILED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT,
TestLogEvent.STANDARD_ERROR
)
}
}

packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}
}
}

dependencies {

implementation(libs.core.ktx)
implementation(libs.activity.compose)
implementation(libs.compose.ui)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.material3)
implementation(libs.constraintlayout.compose)
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.lifecycle.viewmodel.ktx)
implementation(libs.material)
implementation(libs.lifecycle.runtime.compose)
implementation(libs.google.material)

// accompanist
implementation(libs.accompanist.systemuicontroller)

// hilt
implementation(libs.hilt.android)
implementation(libs.hilt.navigation.compose)

// koin
implementation(libs.koin.core)
implementation(libs.koin.android)
implementation(libs.bundles.koin.compose)

implementation(libs.navigation.compose)

// timber
implementation(libs.timber)

// media3
implementation(libs.media3.exoplayer)
implementation(libs.media3.ui)
implementation(libs.media3.session)

// palette
implementation(libs.palette.ktx)

// preferences
implementation(libs.preference.ktx)

// room
implementation(libs.room.ktx)
implementation(libs.room.runtime)
ksp(libs.room.compiler)

// data store
implementation(libs.datastore)

// kotlin serialization
implementation(libs.kotlinx.serialization.json)

// gson
implementation(libs.converter.gson)

// Moshi
implementation(libs.moshi.kotlin)

// jsoup
implementation(libs.jsoup)

// retrofit
implementation(libs.retrofit)
implementation(libs.retrofit2.converter.moshi)

// lottie
implementation(libs.lottie.compose)

testImplementation(libs.junit)
testImplementation(libs.coroutine.test)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.ui.test.junit4)
androidTestImplementation(libs.hilt.android.testing)
debugImplementation(libs.ui.tooling)
debugImplementation(libs.ui.test.manifest)
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.rickinc.decibels.R
import com.rickinc.decibels.domain.model.Track
import com.rickinc.decibels.presentation.nowplaying.NowPlayingScreen
import com.rickinc.decibels.presentation.nowplaying.NowPlayingState
import com.rickinc.decibels.presentation.ui.theme.LocalController
import com.rickinc.decibels.presentation.theme.LocalController
import com.rickinc.decibels.presentation.util.formatTrackDuration

fun launchNowPlayingScreen(
Expand Down
14 changes: 12 additions & 2 deletions app/src/main/java/com/rickinc/decibels/DecibelsApplication.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
package com.rickinc.decibels

import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import com.rickinc.decibels.di.dataModule
import com.rickinc.decibels.di.databaseModule
import com.rickinc.decibels.di.networkModule
import com.rickinc.decibels.di.playerModule
import com.rickinc.decibels.di.viewModelModule
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin
import timber.log.Timber

@HiltAndroidApp
class DecibelsApplication : Application() {

override fun onCreate() {
super.onCreate()
Timber.plant(MyDebugTree())

startKoin {
androidContext(this@DecibelsApplication)
modules(databaseModule, dataModule, networkModule, playerModule, viewModelModule)
}
}

class MyDebugTree : Timber.DebugTree() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ import com.rickinc.decibels.domain.util.TrackConverter
import kotlinx.coroutines.*
import java.io.IOException

class DeviceDataSource(
private val context: Context,
) {
class DeviceDataSource(private val context: Context) {
@RequiresApi(Build.VERSION_CODES.Q)
suspend fun getDeviceAudioFiles(): List<Track> {
return withContext(Dispatchers.IO) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import timber.log.Timber
import java.net.URI
import javax.inject.Inject

data class SongInfo(val title: String, val artist: String?, val lyrics: String, val source: String?)

class LyricsScraper @Inject constructor() {
class LyricsScraper {
companion object {
val clearSpecialCharactersAndURL = "[|\\[\\]{}<>@].*".toRegex()
val clearTrackExtras =
Expand Down
Loading

0 comments on commit 856ab3c

Please # to comment.