Skip to content

Commit

Permalink
fix createEmoji to return unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
2018JunyoungLim committed Nov 15, 2023
1 parent 63f14f0 commit 81f574f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,7 @@ class EmojiViewModel @Inject constructor(
}

fun createEmoji(videoUri: Uri): Pair<String, String>? {
val (emojiName, emojiUnicode) = emojiUseCase.createEmoji(videoUri)?: return null

val emojiCharArray = emojiUnicode.replace("U+", "")
.split(" ").map {
val codePoint = it.toInt(16)
codePoint.toChar()
}.toCharArray()
val emoji = String(emojiCharArray)
return Pair(emojiName, emoji)
return emojiUseCase.createEmoji(videoUri)
}

suspend fun uploadEmoji(emojiUnicode: String, emojiLabel: String, videoFile: File): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import androidx.media3.common.Player
import androidx.media3.exoplayer.ExoPlayer
import androidx.media3.ui.PlayerView
import com.goliath.emojihub.LocalNavController
import com.goliath.emojihub.extensions.toEmoji
import com.goliath.emojihub.viewmodels.EmojiViewModel
import com.goliath.emojihub.views.components.CustomDialog
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -130,7 +131,7 @@ fun TransformVideoPage(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = resultEmoji!!.second,
text = resultEmoji!!.second.toEmoji(),
fontSize = 48.sp
)
Text (
Expand Down

0 comments on commit 81f574f

Please sign in to comment.