-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,156 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
core/ui/src/main/java/com/loki/ui/components/NotificationBubble.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package com.loki.ui.components | ||
|
||
import androidx.compose.animation.AnimatedVisibility | ||
import androidx.compose.animation.slideInVertically | ||
import androidx.compose.animation.slideOutVertically | ||
import androidx.compose.foundation.BorderStroke | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.alpha | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.unit.dp | ||
import com.loki.ui.theme.md_theme_light_primary | ||
import kotlinx.coroutines.delay | ||
|
||
@Composable | ||
fun NotificationBubble( | ||
modifier: Modifier = Modifier, | ||
message: String = "" | ||
) { | ||
|
||
var isBubbleVisible by remember { mutableStateOf(false) } | ||
var mess by remember { mutableStateOf(message) } | ||
|
||
LaunchedEffect(key1 = mess) { | ||
|
||
isBubbleVisible = true | ||
|
||
delay(3000L) | ||
|
||
isBubbleVisible = false | ||
mess = "" | ||
} | ||
|
||
AnimatedVisibility( | ||
visible = isBubbleVisible, | ||
enter = slideInVertically { -(it / 2) }, | ||
exit = slideOutVertically { 0 } | ||
) { | ||
Box(modifier = Modifier.fillMaxSize()) { | ||
Box( | ||
modifier = modifier | ||
.fillMaxWidth() | ||
.padding( | ||
horizontal = 24.dp, | ||
vertical = 16.dp | ||
) | ||
.clip(RoundedCornerShape(12.dp)) | ||
.height(70.dp) | ||
.background(md_theme_light_primary.copy(.5f)) | ||
.border( | ||
border = BorderStroke(width = 1.dp, color = md_theme_light_primary), | ||
shape = RoundedCornerShape(12.dp) | ||
) | ||
.alpha(1f) | ||
.align(Alignment.TopCenter), | ||
contentAlignment = Alignment.CenterStart | ||
) { | ||
|
||
Text( | ||
text = message, | ||
color = md_theme_light_primary, | ||
modifier = Modifier.padding(horizontal = 16.dp) | ||
) | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ package com.loki.ui.utils | |
object Constants { | ||
|
||
const val REPORT_ID = "reportId" | ||
const val VIDEO_URI = "videoUri" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.loki.di | ||
|
||
import android.app.Application | ||
import androidx.media3.common.Player | ||
import androidx.media3.exoplayer.ExoPlayer | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.components.ViewModelComponent | ||
import dagger.hilt.android.scopes.ViewModelScoped | ||
|
||
@Module | ||
@InstallIn(ViewModelComponent::class) | ||
object VideoPlayerModule { | ||
|
||
@Provides | ||
@ViewModelScoped | ||
fun provideVideoPlayer(app: Application): Player { | ||
return ExoPlayer.Builder(app) | ||
.build() | ||
} | ||
} |
Oops, something went wrong.