Skip to content

Commit

Permalink
Merge pull request #2323 from HedvigInsurance/ds/claim-flow
Browse files Browse the repository at this point in the history
GEN-2529 and GEN-2533: New DS in claim flow
  • Loading branch information
StylianosGakis authored Nov 25, 2024
2 parents f620aff + 9525ff8 commit c38b040
Show file tree
Hide file tree
Showing 69 changed files with 2,082 additions and 1,643 deletions.
3 changes: 1 addition & 2 deletions app/audio-player-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies {
implementation(libs.androidx.lifecycle.runtime)
implementation(projects.audioPlayerData)
implementation(projects.coreCommonAndroidPublic)
implementation(projects.coreDesignSystem)
implementation(projects.coreIcons)
implementation(projects.coreResources)
implementation(projects.designSystemHedvig)
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,35 @@

package com.hedvig.android.audio.player.internal

import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.detectHorizontalDragGestures
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.input.pointer.PointerInputChange
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.lerp
import com.hedvig.android.core.designsystem.material3.DisabledAlpha
import com.hedvig.android.core.designsystem.preview.HedvigPreview
import com.hedvig.android.core.designsystem.theme.HedvigTheme
import com.hedvig.android.design.system.hedvig.HedvigPreview
import com.hedvig.android.design.system.hedvig.HedvigTheme
import com.hedvig.android.design.system.hedvig.LocalContentColor
import com.hedvig.android.design.system.hedvig.Surface
import com.hedvig.audio.player.data.ProgressPercentage
import kotlin.math.abs
import kotlin.math.absoluteValue
Expand Down Expand Up @@ -123,25 +124,25 @@ private fun FakeAudioWavePill(
val hasPlayedThisWave = remember(progressPercentage, numberOfWaves, waveIndex) {
progressPercentage.value * numberOfWaves > waveIndex
}
Surface(
shape = CircleShape,
color = if (hasPlayedThisWave) playedColor else notPlayedColor,
modifier = modifier.fillMaxHeight(fraction = height),
) {}
Box(
modifier = modifier.fillMaxHeight(fraction = height)
.clip(CircleShape)
.background(if (hasPlayedThisWave) playedColor else notPlayedColor),
)
}

@HedvigPreview
@Composable
private fun PreviewFakeAudioWaves() {
HedvigTheme {
Surface(
color = MaterialTheme.colorScheme.surface,
color = HedvigTheme.colorScheme.surfacePrimary,
modifier = Modifier.height(150.dp),
) {
FakeAudioWaves(
ProgressPercentage(0.2f),
LocalContentColor.current,
LocalContentColor.current.copy(DisabledAlpha).compositeOver(MaterialTheme.colorScheme.surface),
LocalContentColor.current.copy(0.38f).compositeOver(HedvigTheme.colorScheme.surfacePrimary),
{},
)
}
Expand Down
Loading

0 comments on commit c38b040

Please sign in to comment.