mirror of
https://github.com/google-ai-edge/gallery.git
synced 2025-07-06 06:30:30 -04:00
- Update genai task and app version.
- Fix edge-to-edge on three-button nav bar (thanks https://github.com/Goooler!) - Fix a layout issue where the added images are not properly positioned when text input grows in height. PiperOrigin-RevId: 771175188
This commit is contained in:
parent
f4006b35b0
commit
207cc50878
4 changed files with 165 additions and 158 deletions
|
@ -31,7 +31,7 @@ android {
|
|||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 1
|
||||
versionName = "1.0.3"
|
||||
versionName = "1.0.4"
|
||||
|
||||
// Needed for HuggingFace auth workflows.
|
||||
manifestPlaceholders["appAuthRedirectScheme"] = "com.google.ai.edge.gallery.oauth"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.google.ai.edge.gallery
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
|
@ -32,6 +33,11 @@ class MainActivity : ComponentActivity() {
|
|||
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
// Fix for three-button nav not properly going edge-to-edge.
|
||||
// See: https://issuetracker.google.com/issues/298296168
|
||||
window.isNavigationBarContrastEnforced = false
|
||||
}
|
||||
setContent { GalleryTheme { Surface(modifier = Modifier.fillMaxSize()) { GalleryApp() } } }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ import androidx.compose.foundation.clickable
|
|||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
|
@ -183,14 +184,12 @@ fun MessageInputText(
|
|||
}
|
||||
}
|
||||
|
||||
Box(contentAlignment = Alignment.CenterStart) {
|
||||
Column {
|
||||
// A preview panel for the selected image.
|
||||
if (pickedImages.isNotEmpty()) {
|
||||
Row(
|
||||
modifier =
|
||||
Modifier.offset(x = 16.dp, y = (-80).dp)
|
||||
.fillMaxWidth()
|
||||
.horizontalScroll(rememberScrollState()),
|
||||
Modifier.offset(x = 16.dp).fillMaxWidth().horizontalScroll(rememberScrollState()),
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
) {
|
||||
for (image in pickedImages) {
|
||||
|
@ -223,6 +222,7 @@ fun MessageInputText(
|
|||
}
|
||||
}
|
||||
|
||||
Box(contentAlignment = Alignment.CenterStart) {
|
||||
// A plus button to show a popup menu to add stuff to the chat.
|
||||
IconButton(
|
||||
enabled = !inProgress && !isResettingSession,
|
||||
|
@ -395,6 +395,7 @@ fun MessageInputText(
|
|||
Spacer(modifier = Modifier.width(4.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A bottom sheet to show the text input history to pick from.
|
||||
if (showTextInputHistorySheet) {
|
||||
|
|
|
@ -20,7 +20,7 @@ protobuf = "0.9.5"
|
|||
protobufJavaLite = "4.26.1"
|
||||
#noinspection GradleDependency
|
||||
mediapipeTasksText = "0.10.21"
|
||||
mediapipeTasksGenai = "0.10.24"
|
||||
mediapipeTasksGenai = "0.10.25"
|
||||
mediapipeTasksImageGenerator = "0.10.21"
|
||||
commonmark = "1.0.0-alpha02"
|
||||
richtext = "1.0.0-alpha02"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue