Skip to content

Commit ea9c384

Browse files
authored
Merge pull request #15 from tuuhin/fixes-changes
Some issues related to previous PR fixes
2 parents 48f8167 + 2facde0 commit ea9c384

7 files changed

Lines changed: 64 additions & 12 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Android Build CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up JDK
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: '17'
21+
cache: 'gradle'
22+
23+
- name: Set up Android SDK
24+
uses: android-actions/setup-android@v3
25+
26+
- name: Grant execute permission for gradlew
27+
run: chmod +x gradlew
28+
29+
- name: Validate Gradle wrapper
30+
uses: gradle/wrapper-validation-action@v1
31+
32+
- name: Create a debug build
33+
run: ./gradlew assembleDebug
34+
35+
- name: Check if there is any build errors
36+
run: |
37+
if grep -q "BUILD FAILED" build/outputs/logs/*.txt; then
38+
echo "Build failed with errors!"
39+
exit 1
40+
else
41+
echo "Build successful with no errors."
42+
fi

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ android {
1616
applicationId = "com.eva.recorderapp"
1717
minSdk = 29
1818
targetSdk = 35
19-
versionCode = 7
20-
versionName = "1.2.2"
19+
versionCode = 8
20+
versionName = "1.3.0"
2121

2222
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2323
vectorDrawables {

data/recorder/src/main/java/com/eva/recorder/data/service/RecorderServiceBinderImpl.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import kotlinx.coroutines.flow.emptyFlow
1515
import kotlinx.coroutines.flow.filter
1616
import kotlinx.coroutines.flow.flatMapLatest
1717
import kotlinx.coroutines.flow.update
18+
import kotlinx.coroutines.flow.updateAndGet
1819
import kotlin.time.Duration
1920

2021
private const val TAG = "RECORDER_SERVICE_BINDER"
@@ -45,14 +46,14 @@ internal class RecorderServiceBinderImpl(private val context: Context) : Recorde
4546
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
4647
val binder = (service as? VoiceRecorderService.LocalBinder)
4748
_service = binder?.getService()
48-
_isBounded.update { true }
49-
Log.d(TAG, "SERVICE CONNECTED")
49+
val isBounded = _isBounded.updateAndGet { true }
50+
Log.d(TAG, "SERVICE CONNECTED :BOUNDED :$isBounded")
5051
}
5152

5253
override fun onServiceDisconnected(name: ComponentName?) {
53-
_isBounded.update { false }
54+
val bounded = _isBounded.updateAndGet { false }
5455
_service = null
55-
Log.d(TAG, "SERVICE DISCONNECTED")
56+
Log.d(TAG, "SERVICE DISCONNECTED :BOUNDED:$bounded")
5657
}
5758
}
5859

@@ -70,14 +71,15 @@ internal class RecorderServiceBinderImpl(private val context: Context) : Recorde
7071
override fun unBindService() {
7172
try {
7273
context.unbindService(serviceConnection)
73-
Log.d(TAG, "SERVICE UN-BIND")
74+
val isBounded = _isBounded.updateAndGet { false }
75+
Log.d(TAG, "SERVICE UN-BIND BOUNDED:$isBounded")
7476
} catch (e: Exception) {
7577
e.printStackTrace()
7678
}
7779
}
7880

7981
override fun cleanUp() {
80-
Log.d(TAG,"SERVICE BINDER CLEANUP")
82+
Log.d(TAG, "SERVICE BINDER CLEANUP")
8183
_service = null
8284
_isBounded.update { false }
8385
}

feature/player-shared/src/main/java/com/eva/player_shared/util/PlayerGraphDrawUtil.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import androidx.compose.ui.unit.Dp
1616
import androidx.compose.ui.unit.dp
1717
import com.eva.utils.LocalTimeFormats
1818
import com.eva.utils.RecorderConstants
19-
import com.eva.utils.asLocalTime
19+
import com.eva.utils.toLocalTime
2020
import kotlinx.datetime.format
2121
import kotlin.time.Duration
2222
import kotlin.time.Duration.Companion.milliseconds
@@ -115,7 +115,7 @@ fun DrawScope.drawTimeLineCompressed(
115115
repeat(sampleSize + 20) { idx ->
116116
val xAxis = idx * spacing
117117
if (idx % 20 == 0) {
118-
val time = (blockTime * idx).milliseconds.asLocalTime
118+
val time = (blockTime * idx).milliseconds.toLocalTime()
119119
val readable = time.format(LocalTimeFormats.LOCALTIME_FORMAT_MM_SS)
120120

121121
val layoutResult = textMeasurer.measure(readable, style = textStyle)
@@ -181,7 +181,7 @@ fun DrawScope.drawTimeLine(
181181
val xAxis = millis * spacing
182182
if (millis % 2_000 == 0) {
183183

184-
val time = millis.milliseconds.asLocalTime
184+
val time = millis.milliseconds.toLocalTime()
185185
val readable = time.format(LocalTimeFormats.LOCALTIME_FORMAT_MM_SS)
186186

187187
val layoutResult = textMeasurer.measure(readable, style = textStyle)

feature/recorder/src/main/java/com/eva/feature_recorder/composable/RecordButton.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ internal fun RecordButton(
3939
onClick: () -> Unit,
4040
modifier: Modifier = Modifier,
4141
elevation: Dp = 4.dp,
42+
enabled: Boolean = true,
4243
) {
4344
val recorderRed = colorResource(id = R.color.recorder_button_color)
4445
val rimColor = colorResource(id = R.color.recorder_button_rim_color)
@@ -68,7 +69,7 @@ internal fun RecordButton(
6869
}
6970
.size(64.dp)
7071
.clip(CircleShape)
71-
.clickable(onClick = onClick, role = Role.Button)
72+
.clickable(enabled = enabled, onClick = onClick, role = Role.Button)
7273
.shadow(elevation = elevation)
7374
.drawBehind {
7475
drawCircle(color = recorderRed)

feature/recorder/src/main/java/com/eva/feature_recorder/composable/RecorderPausePlayAction.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ internal fun RecorderPausePlayAction(
3939
onCancel: () -> Unit,
4040
onStop: () -> Unit,
4141
modifier: Modifier = Modifier,
42+
enabled: Boolean = true,
4243
) {
4344

4445
var showCancelDialog by remember { mutableStateOf(false) }
@@ -71,6 +72,7 @@ internal fun RecorderPausePlayAction(
7172
if (isPaused) {
7273
IconButton(
7374
onClick = onResume,
75+
enabled = enabled,
7476
colors = IconButtonDefaults.iconButtonColors(
7577
containerColor = MaterialTheme.colorScheme.tertiary,
7678
contentColor = MaterialTheme.colorScheme.onTertiary
@@ -85,6 +87,7 @@ internal fun RecorderPausePlayAction(
8587
} else {
8688
IconButton(
8789
onClick = onPause,
90+
enabled = enabled,
8891
colors = IconButtonDefaults.iconButtonColors(
8992
containerColor = MaterialTheme.colorScheme.tertiary,
9093
contentColor = MaterialTheme.colorScheme.onTertiary
@@ -105,6 +108,7 @@ internal fun RecorderPausePlayAction(
105108
onPause()
106109
showCancelDialog = true
107110
},
111+
enabled = enabled,
108112
colors = IconButtonDefaults.iconButtonColors(
109113
containerColor = MaterialTheme.colorScheme.secondary,
110114
contentColor = MaterialTheme.colorScheme.onSecondary
@@ -124,6 +128,7 @@ internal fun RecorderPausePlayAction(
124128
onPause()
125129
showSaveDialog = true
126130
},
131+
enabled = enabled,
127132
colors = IconButtonDefaults.iconButtonColors(
128133
containerColor = MaterialTheme.colorScheme.primary,
129134
contentColor = MaterialTheme.colorScheme.onPrimary

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ protobufJavalite = "4.30.1"
3030
protobuf_version = "0.9.5"
3131
protobuf_gen_java_lite = "3.0.0"
3232
materialIconExtended = "1.7.8"
33+
moduleGrapher = "0.12.0"
3334

3435
[libraries]
3536
androidx-concurrent-futures-ktx = { module = "androidx.concurrent:concurrent-futures-ktx", version.ref = "concurrentFuturesKtx" }
@@ -109,6 +110,7 @@ androidx_room = { id = "androidx.room", version.ref = "roomCompiler" }
109110
google_protobuf = { id = "com.google.protobuf", version.ref = "protobuf_version" }
110111
jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
111112
android-library = { id = "com.android.library", version.ref = "agp" }
113+
module-grapher = { id = "dev.iurysouza.modulegraph", version.ref = "moduleGrapher" }
112114

113115
#custom plugins
114116
recorderapp-room = { id = "recorderapp.room.plugin", version = "unspecified" }

0 commit comments

Comments
 (0)