Skip to content

Comments

Fixed text-centering#24

Open
marcelthebridge wants to merge 1 commit intogoogle-developer-training:mainfrom
marcelthebridge:patch-1
Open

Fixed text-centering#24
marcelthebridge wants to merge 1 commit intogoogle-developer-training:mainfrom
marcelthebridge:patch-1

Conversation

@marcelthebridge
Copy link

The solution code does in fact not create the desired outcome from the Compose Basics: Four Quadrants task.

The current solution forces the title text to be sticked to the top of they're composable objects, and ignores the vertical centering as shown in the target screenshot.

Removing the following line from the "title" text composable, fixes this:
modifier = Modifier.padding(bottom = 16.dp),

This was the fix while running the following:
Android Studio Narwhal | 2025.1.1
Build #AI-251.25410.109.2511.13665796, built on June 18, 2025 Runtime version: 21.0.6+-13391695-b895.109 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.5
Kotlin plugin: K2 mode
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 2048M
Cores: 10
Metal Rendering is ON
Registry:
ide.experimental.ui=true
com.android.studio.ml.activeModel=com.android.studio.ml.AidaModel
Non-Bundled Plugins:
com.jetbrains.edu (2025.6-2025.1-1078)

The solution code does in fact not create the desired outcome from the Compose Basics: Four Quadrants task.

The current solution forces the title text to be sticked to the top of they're composable objects, and ignores the vertical centering as shown in the target screenshot.  

Upon removal of the .padding(bottom = 16.dp) modifier, the title snaps to where it is expected. 

This was the fix while running the following:
Android Studio Narwhal | 2025.1.1
Build #AI-251.25410.109.2511.13665796, built on June 18, 2025
Runtime version: 21.0.6+-13391695-b895.109 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.5
Kotlin plugin: K2 mode
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 10
Metal Rendering is ON
Registry:
  ide.experimental.ui=true
  com.android.studio.ml.activeModel=com.android.studio.ml.AidaModel
Non-Bundled Plugins:
  com.jetbrains.edu (2025.6-2025.1-1078)
@google-cla
Copy link

google-cla bot commented Jul 3, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@marcelthebridge
Copy link
Author

marcelthebridge commented Jul 3, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant