-
Notifications
You must be signed in to change notification settings - Fork 97
Redesign #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lethargicpanda
wants to merge
27
commits into
main
Choose a base branch
from
redesign
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6,040
−3,241
Open
Redesign #115
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b6c2c77
Color, Font and Theme update (#59)
lethargicpanda 8415e58
ui-component module (#60)
lethargicpanda 7dc8dd9
Sample list UI redesign (#70)
lethargicpanda 12a998f
Add theme & asset exported from Figma (#73)
lethargicpanda fe46e1b
Imagen redesign (#81)
lethargicpanda b32bea2
Gemini multimodal sample redesign (#84)
lethargicpanda c732b36
Genai Image Description redesign (#86)
lethargicpanda 9a0434a
Apply new design to Nano Summarization sample (#90)
calren 21104db
Gemini Live sample redesign (#83)
lethargicpanda 0ed365b
Redesign Gemini Chatbot (#92)
lethargicpanda 1f4da64
Magic Selfie sample redesign (#85)
lethargicpanda 3ec9fbb
Video summary sample redesign (#98)
lethargicpanda 23ee720
Apply new design to Nano writing assistance sample (#93)
calren 6b8c86f
Merge main into redesign (#94)
JolandaVerhoef 2d9918d
Fix Nano image description bug + use undo button (#101)
lethargicpanda 65a53ba
Implement back in sample detail top bar (#100)
lethargicpanda 9a753c0
Add Video Player ui component that is reused for both media use cases…
lethargicpanda f6cbeea
Implement design for Nanobanana sample (#104)
lethargicpanda 18e33f8
Add collapsable appbar to sample list (#103)
lethargicpanda 2a00981
Video metadata screen redesign (#99)
JolandaVerhoef 4d4bce7
Adaptive layout #1 (#106)
lethargicpanda 0a64873
Post rebase fix
lethargicpanda dd22574
Adaptive layout #2
lethargicpanda eb39b75
New Image Input component, used in Multimodal sample (#112)
JolandaVerhoef 0a0f26a
Improve loading states
lethargicpanda 81d2e47
Imagen Editing sample redesign (#114)
lethargicpanda 3f8366e
🤖 Apply Spotless formatting
lethargicpanda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -13,8 +13,11 @@ | |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.android.ai.catalog.ui.domain | ||
package com.android.ai.catalog.domain | ||
|
||
import android.Manifest | ||
import androidx.annotation.DrawableRes | ||
import androidx.annotation.RequiresPermission | ||
import androidx.annotation.StringRes | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.graphics.Color | ||
|
@@ -23,16 +26,17 @@ import com.android.ai.samples.geminichatbot.GeminiChatbotScreen | |
import com.android.ai.samples.geminiimagechat.GeminiImageChatScreen | ||
import com.android.ai.samples.geminilivetodo.ui.TodoScreen | ||
import com.android.ai.samples.geminimultimodal.ui.GeminiMultimodalScreen | ||
import com.android.ai.samples.geminivideometadatacreation.VideoMetadataCreationScreen | ||
import com.android.ai.samples.geminivideosummary.VideoSummarizationScreen | ||
import com.android.ai.samples.geminivideometadatacreation.ui.VideoMetadataCreationScreen | ||
import com.android.ai.samples.geminivideosummary.ui.VideoSummarizationScreen | ||
import com.android.ai.samples.genai_image_description.GenAIImageDescriptionScreen | ||
import com.android.ai.samples.genai_summarization.GenAISummarizationScreen | ||
import com.android.ai.samples.genai_writing_assistance.GenAIWritingAssistanceScreen | ||
import com.android.ai.samples.imagen.ui.ImagenScreen | ||
import com.android.ai.samples.imagenediting.ui.ImagenEditingScreen | ||
import com.android.ai.samples.magicselfie.ui.MagicSelfieScreen | ||
import com.android.ai.theme.extendedColorScheme | ||
|
||
@androidx.annotation.RequiresPermission(android.Manifest.permission.RECORD_AUDIO) | ||
@RequiresPermission(Manifest.permission.RECORD_AUDIO) | ||
val sampleCatalog = listOf( | ||
SampleCatalogItem( | ||
title = R.string.gemini_image_chat, | ||
|
@@ -49,6 +53,8 @@ val sampleCatalog = listOf( | |
sampleEntryScreen = { GeminiMultimodalScreen() }, | ||
tags = listOf(SampleTags.GEMINI_FLASH, SampleTags.FIREBASE), | ||
needsFirebase = true, | ||
isFeatured = true, | ||
keyArt = R.drawable.img_keyart_multimodal, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.gemini_chatbot_sample_title, | ||
|
@@ -57,27 +63,31 @@ val sampleCatalog = listOf( | |
sampleEntryScreen = { GeminiChatbotScreen() }, | ||
tags = listOf(SampleTags.GEMINI_FLASH, SampleTags.FIREBASE), | ||
needsFirebase = true, | ||
keyArt = R.drawable.img_keyart_chatbot, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.genai_summarization_sample_title, | ||
description = R.string.genai_summarization_sample_description, | ||
route = "GenAISummarizationScreen", | ||
sampleEntryScreen = { GenAISummarizationScreen() }, | ||
tags = listOf(SampleTags.GEMINI_NANO, SampleTags.ML_KIT), | ||
keyArt = R.drawable.img_keyart_summary, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.genai_image_description_sample_title, | ||
description = R.string.genai_image_description_sample_description, | ||
route = "GenAIImageDescriptionScreen", | ||
sampleEntryScreen = { GenAIImageDescriptionScreen() }, | ||
tags = listOf(SampleTags.GEMINI_NANO, SampleTags.ML_KIT), | ||
keyArt = R.drawable.img_keyart_img_desc, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.genai_writing_assistance_sample_title, | ||
description = R.string.genai_writing_assistance_sample_description, | ||
route = "GenAIWritingAssistanceScreen", | ||
sampleEntryScreen = { GenAIWritingAssistanceScreen() }, | ||
tags = listOf(SampleTags.GEMINI_NANO, SampleTags.ML_KIT), | ||
keyArt = R.drawable.img_keyart_text, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.imagen_sample_title, | ||
|
@@ -86,14 +96,16 @@ val sampleCatalog = listOf( | |
sampleEntryScreen = { ImagenScreen() }, | ||
tags = listOf(SampleTags.IMAGEN, SampleTags.FIREBASE), | ||
needsFirebase = true, | ||
keyArt = R.drawable.img_keyart_imagen, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.imagen_editing_sample_title, | ||
description = R.string.imagen_editing_sample_description, | ||
route = "ImagenMaskEditing", | ||
sampleEntryScreen = { ImagenEditingScreen() }, | ||
tags = listOf(SampleTags.IMAGEN, SampleTags.FIREBASE, SampleTags.MEDIA3), | ||
tags = listOf(SampleTags.IMAGEN, SampleTags.FIREBASE), | ||
needsFirebase = true, | ||
keyArt = R.drawable.img_keyart_imagen, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.magic_selfie_sample_title, | ||
|
@@ -102,6 +114,7 @@ val sampleCatalog = listOf( | |
sampleEntryScreen = { MagicSelfieScreen() }, | ||
tags = listOf(SampleTags.IMAGEN, SampleTags.FIREBASE, SampleTags.ML_KIT), | ||
needsFirebase = true, | ||
keyArt = R.drawable.img_keyart_magic_selfie, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.gemini_video_summarization_sample_title, | ||
|
@@ -118,6 +131,16 @@ val sampleCatalog = listOf( | |
sampleEntryScreen = { VideoMetadataCreationScreen() }, | ||
tags = listOf(SampleTags.GEMINI_FLASH, SampleTags.FIREBASE, SampleTags.MEDIA3), | ||
needsFirebase = true, | ||
keyArt = R.drawable.img_keyart_video_summary, | ||
), | ||
SampleCatalogItem( | ||
title = R.string.gemini_video_metadata_creation_sample_title, | ||
description = R.string.gemini_video_metadata_creation_sample_description, | ||
route = "VideoMetadataCreationScreen", | ||
sampleEntryScreen = { VideoMetadataCreationScreen() }, | ||
tags = listOf(SampleTags.GEMINI_FLASH, SampleTags.FIREBASE, SampleTags.MEDIA3), | ||
needsFirebase = true, | ||
keyArt = R.drawable.img_keyart_video_summary, | ||
), | ||
Comment on lines
+136
to
144
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
SampleCatalogItem( | ||
title = R.string.gemini_live_todo_title, | ||
|
@@ -126,6 +149,7 @@ val sampleCatalog = listOf( | |
sampleEntryScreen = { TodoScreen() }, | ||
tags = listOf(SampleTags.GEMINI_FLASH, SampleTags.FIREBASE), | ||
needsFirebase = true, | ||
keyArt = R.drawable.img_keyart_todo, | ||
), | ||
|
||
// To create a new sample entry, add a new SampleCatalogItem here. | ||
|
@@ -138,17 +162,18 @@ data class SampleCatalogItem( | |
val sampleEntryScreen: @Composable () -> Unit, | ||
val tags: List<SampleTags> = emptyList(), | ||
val needsFirebase: Boolean = false, | ||
val isFeatured: Boolean = false, | ||
@DrawableRes val keyArt: Int? = null, | ||
) | ||
|
||
enum class SampleTags( | ||
val label: String, | ||
val backgroundColor: Color, | ||
val textColor: Color, | ||
) { | ||
FIREBASE("Firebase", Color(0xFFFF9100), Color.White), | ||
GEMINI_FLASH("Gemini Flash", Color(0xFF4285F4), Color.White), | ||
GEMINI_NANO("Gemini Nano", Color(0xFF7abafe), Color.White), | ||
IMAGEN("Imagen", Color(0xFF7CB342), Color.White), | ||
MEDIA3("Media3", Color(0xFF7CB584), Color.White), | ||
ML_KIT("ML Kit", Color.White, Color(0xFF4285F4)), | ||
FIREBASE("Firebase", extendedColorScheme.firebase), | ||
GEMINI_FLASH("Gemini Flash", extendedColorScheme.geminiProFlash), | ||
GEMINI_NANO("Gemini Nano", extendedColorScheme.geminiNano), | ||
IMAGEN("Imagen", extendedColorScheme.imagen), | ||
MEDIA3("Media3", extendedColorScheme.media3), | ||
ML_KIT("ML Kit", extendedColorScheme.mLKit), | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
sampleEntryScreen
for the "Video Summarization" sample is pointing toVideoMetadataCreationScreen()
instead ofVideoSummarizationScreen()
. This will cause the wrong sample to be opened when selected from the catalog.