Skip to content

Commit

Permalink
Merge pull request #13 from vipulyaara/develop
Browse files Browse the repository at this point in the history
Release 0.13.0
  • Loading branch information
vipulyaara authored Mar 18, 2024
2 parents 31ec69c + a0bd8f8 commit 4e9ba15
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 128 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public/** linguist-vendored
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

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

1 change: 0 additions & 1 deletion .idea/vcs.xml

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

27 changes: 16 additions & 11 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import org.jetbrains.kotlin.konan.properties.Properties

plugins {
alias(libs.plugins.android.application)
Expand All @@ -13,19 +13,26 @@ plugins {
}

android {
buildFeatures.buildConfig = true

defaultConfig {
applicationId = "com.kafka.user"
versionCode = 52
versionCode = 53
versionName = libs.versions.versionname.toString()

val root = gradleLocalProperties(rootDir)
val googleServerClientId: String = (root.getProperty("GOOGLE_SERVER_CLIENT_ID")
?: System.getenv("GOOGLE_SERVER_CLIENT_ID")) as String
val pipelessAuthToken: String = (root.getProperty("PIPELESS_AUTH_TOKEN")
?: System.getenv("PIPELESS_AUTH_TOKEN")) as String
val properties = Properties()
properties.load(project.rootProject.file("local.properties").inputStream())

buildConfigField("String", "GOOGLE_SERVER_CLIENT_ID", googleServerClientId)
buildConfigField("String", "PIPELESS_AUTH_TOKEN", pipelessAuthToken)
buildConfigField(
"String",
"GOOGLE_SERVER_CLIENT_ID",
properties["PIPELESS_AUTH_TOKEN"]?.toString() ?: System.getenv("PIPELESS_AUTH_TOKEN")
)
buildConfigField(
"String",
"PIPELESS_AUTH_TOKEN",
properties["PIPELESS_AUTH_TOKEN"]?.toString() ?: System.getenv("PIPELESS_AUTH_TOKEN")
)
}

compileOptions {
Expand Down Expand Up @@ -107,8 +114,6 @@ android {
warning += "AutoboxingStateCreation"
}

buildFeatures.buildConfig = true

}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/kafka/user/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class MainActivity : ComponentActivity() {

override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
if (::navController.isInitialized) {
if (::navController.isInitialized && intent != null) {
navController.handleDeepLink(intent)
} else {
Timber.e(Error("navController is not initialized. isFinishing $isFinishing"))
Timber.e(Error("navController is not initialized or intent is null. isFinishing = $isFinishing, intent = $intent"))
}
}
}
18 changes: 12 additions & 6 deletions app/src/main/java/com/kafka/user/fcm/FirebaseMessageService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,20 @@ class FirebaseMessageService : FirebaseMessagingService() {

debug { "Received FCM message: $message" }

when {
message.data.isNotEmpty() -> notificationManager.buildNotification(
push = pushMapper.map(message),
pendingIntent = mainActivityIntent()
)
if (message.data.isNotEmpty()) {
val contentId = message.data["itemId"]

else -> super.onMessageReceived(message)
debug { "FCM contentId $contentId" }
}

// when {
// message.data.isNotEmpty() -> notificationManager.buildNotification(
// push = pushMapper.map(message),
// pendingIntent = mainActivityIntent()
// )
//
// else -> super.onMessageReceived(message)
// }
}

override fun onNewToken(token: String) {
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/com/kafka/user/injection/PlayerModule.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.kafka.user.injection

import com.kafka.remote.config.RemoteConfig
import com.kafka.remote.config.isExactAlarmEnabled
import com.kafka.user.playback.KafkaPlayerEventLogger
import com.kafka.user.playback.PlayerAudioDataSource
import com.sarahang.playback.core.PlayerRemoteConfig
import com.sarahang.playback.core.apis.AudioDataSource
import com.sarahang.playback.core.apis.PlayerEventLogger
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Inject

@InstallIn(SingletonComponent::class)
@Module
Expand All @@ -18,4 +22,15 @@ abstract class PlayerModule {

@Binds
abstract fun playerEventLogger(kafkaPlayerEventLogger: KafkaPlayerEventLogger): PlayerEventLogger

@Binds
abstract fun PlayerRemoteConfig(playerRemoteConfig: PlayerRemoteConfigImpl): PlayerRemoteConfig
}

class PlayerRemoteConfigImpl @Inject constructor(
private val remoteConfig: RemoteConfig
) : PlayerRemoteConfig {
override fun isExactAlarmEnabled(): Boolean {
return remoteConfig.isExactAlarmEnabled()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const val DOWNLOADER_TYPE = "downloader_type"
const val GOOGLE_LOGIN_ENABLED = "google_login_enabled"
const val RECOMMENDATION_ENABLED = "recommendation_data_enabled"
const val ONLINE_READER_ENABLED = "online_reader_enabled"
const val EXACT_ALARM_ENABLED = "exact_alarm_enabled"

fun RemoteConfig.getPlayerTheme() = get(REMOTE_CONFIG_PLAYER_THEME_KEY)

Expand All @@ -18,3 +19,5 @@ fun RemoteConfig.isGoogleLoginEnabled() = getBoolean(GOOGLE_LOGIN_ENABLED)
fun RemoteConfig.isRecommendationEnabled() = getBoolean(RECOMMENDATION_ENABLED)

fun RemoteConfig.isOnlineReaderEnabled() = getBoolean(ONLINE_READER_ENABLED)

fun RemoteConfig.isExactAlarmEnabled() = getBoolean(EXACT_ALARM_ENABLED)
40 changes: 20 additions & 20 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[versions]
accompanist = "0.34.0"
agp = "8.2.2"
androidxhilt = "1.1.0"
agp = "8.3.0"
androidxhilt = "1.2.0"
androidxlifecycle = "2.7.0"
navigation = "2.7.6"
coil = "2.5.0"
navigation = "2.7.7"
coil = "2.6.0"
compose-alpha = "2024.01.00-alpha01"
compose-bom = "2024.01.00"
compose-bom = "2024.02.02"
constraintlayout = "1.1.0-alpha13"
composecompiler = "1.5.4"
coroutines = "1.7.3"
dagger = "2.50"
composecompiler = "1.5.10"
coroutines = "1.8.0"
dagger = "2.51"
icons = "1.0.0"
kotlin = "1.9.20"
kotlin = "1.9.22"
kotlin-immutable = "0.3.7"
material3 = "1.2.0-rc01"
material3 = "1.2.1"
mixpanel = "7.0.0"
okhttp = "4.12.0"
paging = "3.2.1"
Expand All @@ -30,25 +30,25 @@ targetSdk = "33"
core-ktx = "1.12.0"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"
uiautomator = "2.2.0"
uiautomator = "2.3.0"
benchmark-macro-junit4 = "1.2.3"
androidx-baselineprofile = "1.2.3"
profileinstaller = "1.3.1"
review = "2.0.1"

versionname = "0.12.0"
versionname = "0.13.0"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
android-lint = { id = "com.android.lint", version.ref = "agp" }
cacheFixPlugin = { id = "org.gradle.android.cache-fix", version = "3.0" }
cacheFixPlugin = { id = "org.gradle.android.cache-fix", version = "3.0.1" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
ksp = "com.google.devtools.ksp:1.9.22-1.0.16"
gms-googleServices = "com.google.gms.google-services:4.4.0"
ksp = "com.google.devtools.ksp:1.9.23-1.0.19"
gms-googleServices = "com.google.gms.google-services:4.4.1"
firebase-crashlytics = "com.google.firebase.crashlytics:2.9.9"
spotless = "com.diffplug.spotless:6.24.0"
spotless = "com.diffplug.spotless:6.25.0"
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
androidTest = { id = "com.android.test", version.ref = "agp" }
Expand Down Expand Up @@ -76,7 +76,7 @@ androidx-collection = "androidx.collection:collection-ktx:1.4.0"
androidx-core = "androidx.core:core-ktx:1.12.0"

androidx-hilt-compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "androidxhilt" }
androidx-hilt-compose = "androidx.hilt:hilt-navigation-compose:1.1.0"
androidx-hilt-compose = "androidx.hilt:hilt-navigation-compose:1.2.0"
androidx-hilt-navigation = { module = "androidx.hilt:hilt-navigation", version.ref = "androidxhilt" }

hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "dagger" }
Expand Down Expand Up @@ -129,16 +129,16 @@ fetch-okhttp = "androidx.tonyodev.fetch2okhttp:xfetch2okhttp:3.1.6"

dagger-dagger = { module = "com.google.dagger:dagger", version.ref = "dagger" }

google-bom = "com.google.firebase:firebase-bom:32.7.1"
google-bom = "com.google.firebase:firebase-bom:32.7.4"
google-analytics = { module = "com.google.firebase:firebase-analytics" }
google-crashlytics = { module = "com.google.firebase:firebase-crashlytics" }
google-dynamic_links = { module = "com.google.firebase:firebase-dynamic-links" }
google-auth = { module = "com.google.firebase:firebase-auth" }
google-coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3"
google-coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.8.0"
google-firestore = { module = "com.google.firebase:firebase-firestore" }
google-messaging = { module = "com.google.firebase:firebase-messaging" }
google-performance = { module = "com.google.firebase:firebase-perf" }
google-playservices-auth = "com.google.android.gms:play-services-auth:20.7.0"
google-playservices-auth = "com.google.android.gms:play-services-auth:21.0.0"
google-remoteConfig = { module = "com.google.firebase:firebase-config" }
google-storage = { module = "com.google.firebase:firebase-storage-ktx" }

Expand Down
7 changes: 4 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Wed Sep 15 09:55:12 CEST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
15 changes: 15 additions & 0 deletions ui/common/src/main/java/org/kafka/common/LazyList.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.kafka.common

import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

val LazyListState.elevation: Dp
get() = if (firstVisibleItemIndex == 0) {
// For the first element, use the minimum of scroll offset and default elevation
// i.e. a value between 0 and 4.dp
minOf(firstVisibleItemScrollOffset.toFloat().dp, 24.dp)
} else {
// If not the first element, always set elevation and show the shadow
24.dp
}
41 changes: 0 additions & 41 deletions ui/common/src/main/java/org/kafka/common/extensions/Elevation.kt

This file was deleted.

41 changes: 0 additions & 41 deletions ui/common/src/main/java/org/kafka/common/extensions/elevation.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.kafka.data.entities.RecentItem
import kotlinx.collections.immutable.ImmutableList
import org.kafka.common.extensions.elevation
import org.kafka.common.elevation
import org.kafka.common.widgets.shadowMaterial
import org.kafka.homepage.R
import org.kafka.navigation.LocalNavigator
Expand Down
2 changes: 1 addition & 1 deletion ui/item/src/main/java/org/kafka/item/files/Files.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.kafka.data.entities.File
import kotlinx.coroutines.CoroutineScope
import org.kafka.common.extensions.elevation
import org.kafka.common.elevation
import org.kafka.common.test.testTagUi
import org.kafka.common.widgets.shadowMaterial
import org.kafka.navigation.LocalNavigator
Expand Down

0 comments on commit 4e9ba15

Please sign in to comment.